Skip to content

Commit

Permalink
Fix balance breakdown endpoint for reward pool holders
Browse files Browse the repository at this point in the history
  • Loading branch information
prevostc committed Dec 9, 2024
1 parent 83a254f commit 2ccdd2a
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/vault-breakdown/fetchAllUserBreakdown.ts
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ export const getUserTVLAtBlock = async (
(typeof investorPositions)[0]
> = {};
for (const position of investorPositions) {
const vaultAddress = vaultRewardPoolMap[position.token_address];
const vaultAddress = vaultRewardPoolMap[position.token_address.toLowerCase()] as Hex;
const key = `${position.user_address}_${vaultAddress}`;
if (!mergedInvestorPositionsByInvestorAndClmAddress[key]) {
mergedInvestorPositionsByInvestorAndClmAddress[key] = position;
Expand Down Expand Up @@ -97,7 +97,8 @@ export const getUserTVLAtBlock = async (
>
> = {};
for (const position of mergedPositions) {
const breakdown = breakdownByVaultAddress[position.token_address];
const vaultAddress = vaultRewardPoolMap[position.token_address.toLowerCase()] as Hex;
const breakdown = breakdownByVaultAddress[vaultAddress];
if (!breakdown) {
// some test vaults were never available in the api
continue;
Expand Down

0 comments on commit 2ccdd2a

Please sign in to comment.