Skip to content
This repository has been archived by the owner on Jan 24, 2024. It is now read-only.

Commit

Permalink
fix(velodrome): Fix bribe balances (#2236)
Browse files Browse the repository at this point in the history
  • Loading branch information
wpoulin authored Feb 3, 2023
1 parent 5714ead commit 33639ea
Showing 1 changed file with 6 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -107,11 +107,13 @@ export class OptimismVelodromeBribeContractPositionFetcher extends ContractPosit
}),
);

const tokenBalances = tokenBalancesRaw.flat();
const allTokensRaw = contractPosition.tokens.map((cp, idx) => {
return veTokenIds.map((_id, index) => {
return drillBalance(cp, tokenBalancesRaw[idx][index]?.toString() ?? '0');
});
});

const allTokens = contractPosition.tokens.map((cp, idx) =>
drillBalance(cp, tokenBalances[idx]?.toString() ?? '0'),
);
const allTokens = allTokensRaw.flat();

const tokens = allTokens.filter(v => Math.abs(v.balanceUSD) > 0.01);
const balanceUSD = sumBy(tokens, t => t.balanceUSD);
Expand Down

0 comments on commit 33639ea

Please sign in to comment.