Skip to content

Commit

Permalink
Merge pull request #1842 from scallop-io/master
Browse files Browse the repository at this point in the history
feat: add scallop aggregator adapter
  • Loading branch information
dtmkeng committed Sep 1, 2024
2 parents 548d1b0 + dbb01de commit b99f6f2
Showing 1 changed file with 22 additions and 0 deletions.
22 changes: 22 additions & 0 deletions aggregators/scallop/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
import fetchURL from '../../utils/fetchURL';
import { FetchV2, SimpleAdapter } from '../../adapters/types';
import { CHAIN } from '../../helpers/chains';

const fetch: FetchV2 = async ({ startTimestamp, endTimestamp }) => {
const dailyVolume = await fetchURL(
`https://sui.apis.scallop.io/statistic/swap/daily-volume?fromTimestamp=${startTimestamp}&toTimestamp=${endTimestamp}`,
);
return { dailyVolume: dailyVolume.swapVolume };
};

const adapter: SimpleAdapter = {
version: 2,
adapter: {
[CHAIN.SUI]: {
fetch,
start: 1722877683,
},
},
};

export default adapter;

0 comments on commit b99f6f2

Please sign in to comment.