diff --git a/src/components/Trade/TradeModule/SwapForm/index.tsx b/src/components/Trade/TradeModule/SwapForm/index.tsx index 0d5dc412..2e299ed8 100644 --- a/src/components/Trade/TradeModule/SwapForm/index.tsx +++ b/src/components/Trade/TradeModule/SwapForm/index.tsx @@ -241,6 +241,11 @@ export default function SwapForm(props: Props) { } }, [account?.id, swapTx, setIsConfirming]) + useEffect(() => { + if (sellAssetAmount.isEqualTo(maxSellAmount) || buyAssetAmount.isZero()) return + if (buyAssetAmount.isEqualTo(maxBuyableAmountEstimation)) setSellAssetAmount(maxSellAmount) + }, [sellAssetAmount, maxSellAmount, buyAssetAmount, maxBuyableAmountEstimation]) + return ( <>