Skip to content

Commit

Permalink
fix missing ada
Browse files Browse the repository at this point in the history
  • Loading branch information
dtmkeng committed Feb 19, 2024
1 parent 4510852 commit 1ffeda3
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions dexs/jediswap-v2/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ interface IGraph {
date: string;
pairId: string;
totalVolumeUSD: string;
dailyVolumeUSD: string;
volumeUSD: string;
reserveUSD: string;
}

Expand All @@ -26,12 +26,11 @@ const fetch = async (timestamp: number, _: ChainBlocks, { createBalances }: Fet
}
}
`
const response: IGraph[] = (await request(URL, query)).pairDayDatas;
const volume = response.filter(e =>Number(e.reserveUSD) > 10000)
const response: IGraph[] = (await request(URL, query)).poolsDayData;
const volume = response
.filter((e: IGraph) => e.dayId === dayID)
.sort((a: IGraph, b: IGraph) => Number(b.dailyVolumeUSD) - Number(a.dailyVolumeUSD))
.filter((e: IGraph) => Number(e.dailyVolumeUSD) < 10_000_000)
.reduce((acc: number, e: IGraph) => e.dailyVolumeUSD ? acc + Number(e.dailyVolumeUSD) : acc, 0);
.filter((e: IGraph) => Number(e.volumeUSD) < 10_000_000)
.reduce((acc: number, e: IGraph) => e.volumeUSD ? acc + Number(e.volumeUSD) : acc, 0);
const dailyVolume = createBalances();
dailyVolume.addCGToken('tether', volume);
return {
Expand Down

0 comments on commit 1ffeda3

Please sign in to comment.