Commit 631052e6 authored by Ian Lapham's avatar Ian Lapham Committed by GitHub

fix: update balance check in derived swap state (#2054)

* update balance check in derived swap state

* replace balance check with correct version of trade
parent c63bb84f
......@@ -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`
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment