Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add 24H swap volume in kokonutswap #566

Merged
merged 3 commits into from
Jun 21, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions dexs/kokonut-swap/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,15 @@ const fetch = async (timestamp: number) => {
};
};

const fetchZKEVM = async (timestamp: number) => {
const dayTimestamp = getUniqStartOfTodayTimestamp(new Date(timestamp * 1000))
const volume24hrOnlySwap = (await fetchURL('https://prod.kokonut-api.com/zkevm-24hr-volume'))?.data;
return {
dailyVolume: volume24hrOnlySwap,
timestamp: dayTimestamp,
};
};


const adapter: SimpleAdapter = {
adapter: {
Expand All @@ -26,6 +35,11 @@ const adapter: SimpleAdapter = {
start: async () => 1672358400,
runAtCurrTime: true
},
[CHAIN.POLYGON_ZKEVM]: {
fetch: fetchZKEVM,
start: async () => 1687335466,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

could you set start time eq 1687132800 ?

runAtCurrTime: true
},
},
};

Expand Down
Loading