Skip to content

Commit

Permalink
Fix: classic interaction usd value calc
Browse files Browse the repository at this point in the history
  • Loading branch information
ReflectiveChimp committed Dec 11, 2024
1 parent 879717c commit 47a0610
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/utils/timeline.ts
Original file line number Diff line number Diff line change
Expand Up @@ -307,6 +307,7 @@ const mergeClassicPositionInteractions = (
const nativeToUsd = interpretAsDecimal(interaction.nativeToUSDPrice, 18);
const shareToUnderlying = totalUnderlyingInVault.div(vaultTotalSupply);
const underlyingToUsd = underlyingToNative.mul(nativeToUsd);
const shareToUsd = shareToUnderlying.mul(underlyingToUsd);
const underlyingToBreakdown = underlyingBreakdownTokens.map((breakdownToken, i) =>
interpretAsDecimal(
interaction.vaultUnderlyingBreakdownBalances[i] || '0',
Expand Down Expand Up @@ -341,8 +342,8 @@ const mergeClassicPositionInteractions = (
delta: vault.delta.add(rewardPoolTotal.delta),
};
const usd: BalanceDelta = {
balance: total.balance.mul(underlyingToUsd),
delta: total.delta.mul(underlyingToUsd),
balance: total.balance.mul(shareToUsd),
delta: total.delta.mul(shareToUsd),
};
const txHash: string = interaction.createdWith.hash;

Expand Down

0 comments on commit 47a0610

Please sign in to comment.