Skip to content

Commit

Permalink
feat: getting reward tokens price from API
Browse files Browse the repository at this point in the history
  • Loading branch information
Makeev Ivan committed May 23, 2022
1 parent 35b61fb commit 0744be2
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/utils.ts
Expand Up @@ -2,7 +2,7 @@ import axios from 'axios';
import memoize from 'memoizee';
import { ethers } from 'ethers';
import BigNumber from 'bignumber.js';
import {DictInterface, IStats } from './interfaces';
import { DictInterface, IStats } from './interfaces';
import { curve, POOLS_DATA, LP_TOKENS, GAUGES } from "./curve";
import { COINS, DECIMALS_LOWER_CASE } from "./curve";
import { _getPoolsFromApi } from "./external-api";
Expand Down Expand Up @@ -223,6 +223,10 @@ export const _getUsdPricesFromApi = async (): Promise<DictInterface<number>> =>
for (const coin of pool.coins) {
if (typeof coin.usdPrice === "number") priceDict[coin.address.toLowerCase()] = coin.usdPrice;
}

for (const coin of pool.gaugeRewards ?? []) {
if (typeof coin.tokenPrice === "number") priceDict[coin.tokenAddress.toLowerCase()] = coin.tokenPrice;
}
}
}

Expand Down

0 comments on commit 0744be2

Please sign in to comment.