Skip to content

Commit

Permalink
fix dollar value math (#214)
Browse files Browse the repository at this point in the history
* fix dollar value math

* fix my liquidity

Co-authored-by: ben <[email protected]>
  • Loading branch information
sashimi36 and ben2x4 authored May 14, 2022
1 parent 68077b2 commit 0430122
Showing 1 changed file with 11 additions and 3 deletions.
14 changes: 11 additions & 3 deletions hooks/usePoolLiquidity.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -140,14 +140,16 @@ export const useMultiplePoolsLiquidity = ({
tokenAmount: lp_token_supply,
dollarValue:
convertMicroDenomToDenom(reserve[0], tokenADecimals) *
tokenADollarPrice,
tokenADollarPrice *
2,
}

const myLiquidity = {
tokenAmount: providedLiquidityBalance,
dollarValue:
convertMicroDenomToDenom(myLiquidityReserve[0], tokenADecimals) *
tokenADollarPrice,
tokenADollarPrice *
2,
}

/* staked liquidity math */
Expand All @@ -172,10 +174,16 @@ export const useMultiplePoolsLiquidity = ({
),
]

console.log(tokenADollarPrice)
const myStakedLiquidity = {
tokenAmount: stakedBalanceInMicroDenom || 0,
dollarValue: stakedBalanceInDenom
? stakedBalanceInDenom * tokenADollarPrice
? convertMicroDenomToDenom(
(stakedBalanceInMicroDenom / lp_token_supply) * reserve[0],
tokenADecimals
) *
tokenADollarPrice *
2
: 0,
}

Expand Down

0 comments on commit 0430122

Please sign in to comment.