fix: update balance check in derived swap state (#2054)
* update balance check in derived swap state * replace balance check with correct version of trade
This commit is contained in:
parent
c63bb84f09
commit
631052e6a5
@ -202,7 +202,7 @@ export function useDerivedSwapInfo(toggledVersion: Version): {
|
||||
const allowedSlippage = useSwapSlippageTolerance(toggledTrade)
|
||||
|
||||
// compare input balance to max input based on version
|
||||
const [balanceIn, amountIn] = [currencyBalances[Field.INPUT], v2Trade?.maximumAmountIn(allowedSlippage)]
|
||||
const [balanceIn, amountIn] = [currencyBalances[Field.INPUT], toggledTrade?.maximumAmountIn(allowedSlippage)]
|
||||
|
||||
if (balanceIn && amountIn && balanceIn.lessThan(amountIn)) {
|
||||
inputError = t`Insufficient ${amountIn.currency.symbol} balance`
|
||||
|
Loading…
Reference in New Issue
Block a user