Skip to content

Commit

Permalink
show wallet balance while condition is true
Browse files Browse the repository at this point in the history
  • Loading branch information
groninge01 committed Oct 3, 2024
1 parent 01cfca4 commit a02db28
Showing 1 changed file with 7 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -216,7 +216,13 @@ export function _useRemoveLiquidity(urlTxHash?: Hash) {
})
)

const totalUSDValue: string = safeSum(Object.values(usdAmountOutMap))
// while the single token balance is more than 25% of the pool, we use the wallet balance usd for the view
const totalUSDValue = isSingleTokenBalanceMoreThat25Percent
? bn(pool.userBalance?.walletBalanceUsd || '0')
.times(bn(humanBptInPercent).div(100))
.toString()
: safeSum(Object.values(usdAmountOutMap))

const totalAmountsOut: string = safeSum(quoteAmountsOut.map(a => a.amount))

const { isDisabled, disabledReason } = isDisabledWithReason(
Expand Down

0 comments on commit a02db28

Please sign in to comment.