Skip to content

Commit

Permalink
feat: add scallop adapter
Browse files Browse the repository at this point in the history
  • Loading branch information
nicetomeetyou1 committed Aug 29, 2024
1 parent 26686ff commit dbb01de
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 dbb01de

Please sign in to comment.