Skip to content

Commit

Permalink
Fix trading apr for balancer
Browse files Browse the repository at this point in the history
  • Loading branch information
MirthFutures committed Dec 31, 2024
1 parent b1a0cd6 commit 3402e13
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions src/utils/getBalancerTradingFeeAndLstApr.js
Original file line number Diff line number Diff line change
Expand Up @@ -60,10 +60,9 @@ export const getBalTradingAndLstApr = async (chain, poolAddresses) => {

const responseData = await data.json();

const poolAddressesLowerCase = poolAddresses.map(address => address.toLowerCase());
poolAddressesLowerCase.forEach(address => {
poolAddresses.forEach(address => {
responseData.data.poolGetPools.forEach(pool => {
if (pool.address.toLowerCase() === address) {
if (pool.address.toLowerCase() === address.toLowerCase()) {
let tradingApr = 0;
let lstApr = new BigNumber(0);
pool.dynamicData.aprItems.forEach(aprItem => {
Expand All @@ -73,7 +72,7 @@ export const getBalTradingAndLstApr = async (chain, poolAddresses) => {
lstApr = lstApr.plus(new BigNumber(aprItem.apr));
}
});
tradingAprMap[address.address] = tradingApr;
tradingAprMap[address.toLowerCase()] = tradingApr;
lstAprs.push(lstApr);
}
});
Expand Down

0 comments on commit 3402e13

Please sign in to comment.