Skip to content

Commit

Permalink
pass missing price
Browse files Browse the repository at this point in the history
  • Loading branch information
dtmkeng committed Sep 25, 2023
1 parent d0a6aaa commit fdb50f9
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions dexs/chronos-v2/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -97,10 +97,10 @@ const fetchVolume = async (timestamp: number): Promise<FetchResultVolume> => {
const index = poolAddresses.indexOf(e.address);
const token0 = tokens0[index];
const token1 = tokens1[index];
const price0 = prices[`${CHAIN.ARBITRUM}:${token0}`].price;
const price1 = prices[`${CHAIN.ARBITRUM}:${token1}`].price;
const decimals0 = prices[`${CHAIN.ARBITRUM}:${token0}`].decimals;
const decimals1 = prices[`${CHAIN.ARBITRUM}:${token1}`].decimals;
const price0 = prices[`${CHAIN.ARBITRUM}:${token0}`]?.price || 0;
const price1 = prices[`${CHAIN.ARBITRUM}:${token1}`]?.price || 0;
const decimals0 = prices[`${CHAIN.ARBITRUM}:${token0}`]?.decimals || 0;
const decimals1 = prices[`${CHAIN.ARBITRUM}:${token1}`]?.decimals || 0;
return price0 ? (amount0 / 10 ** decimals0) * price0 : (amount1/10**decimals1) * price1;
}).reduce((a: number, b: number) => a + b, 0)

Expand Down

0 comments on commit fdb50f9

Please sign in to comment.