Skip to content

Commit

Permalink
fix volume
Browse files Browse the repository at this point in the history
  • Loading branch information
dtmkeng committed Feb 18, 2024
1 parent 2468dd0 commit e94eedc
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions dexs/synfutures/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,14 +27,14 @@ const fetch = (chain: Chain) => {
return async (timestamp: number , _: ChainBlocks, { createBalances, startOfDay }: FetchOptions) => {
const dailyVolume = createBalances()
const endDayId = dayIdFromTimestamp(startOfDay);

const graphQL = `{
quoteDataDailySnapshots(first: 1000, where: {dayId: ${endDayId}}) {
id
dayId
quote{
id
symbol
decimals
}
dayTradeVolume
}
Expand All @@ -43,7 +43,7 @@ const fetch = (chain: Chain) => {
const data = await request(info[chain].subgraph, graphQL);

for (const dailyData of data.quoteDataDailySnapshots) {
dailyVolume.add(dailyData.quote.id, Number(dailyData.dayTradeVolume));
dailyVolume.add(dailyData.quote.id, Number(dailyData.dayTradeVolume) / (10 ** (18 - Number(dailyData.quote.decimals))));
}

return {
Expand All @@ -70,10 +70,8 @@ const adapter: SimpleAdapter = {
[CHAIN.BSC]: {
fetch: fetch(CHAIN.BSC),
start: 1628128417,
},
},
},
};

export default adapter;


0 comments on commit e94eedc

Please sign in to comment.