Skip to content

Commit

Permalink
fix cal price llama have
Browse files Browse the repository at this point in the history
  • Loading branch information
dtmkeng committed Jun 20, 2023
1 parent 25f8549 commit a09c108
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions dexs/ambient/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,8 @@ const graphs = (chain: Chain) => {
const coins = [...new Set(graphRes.map((e: ISwap) => `${chain}:${e.pool.quote.toLowerCase()}`))]
const prices = await getPrices(coins, todaysTimestamp);
const dailyVolume = graphRes.map((e: ISwap) => {
const decimals = prices[`${chain}:${e.pool.quote.toLowerCase()}`].decimals;
const price = prices[`${chain}:${e.pool.quote.toLowerCase()}`].price;
const decimals = prices[`${chain}:${e.pool.quote.toLowerCase()}`]?.decimals || 0;
const price = prices[`${chain}:${e.pool.quote.toLowerCase()}`]?.price || 0;
return (Number(e.quoteFlow.replace('-','')) / 10 ** decimals) * price
}).reduce((a: number, b: number) => a + b, 0)
return {
Expand Down

0 comments on commit a09c108

Please sign in to comment.