From 0f7325083265a05b3bd91d0659f7ee4681b346d5 Mon Sep 17 00:00:00 2001 From: Cho Young-Hwi Date: Fri, 20 Mar 2026 20:46:05 +0000 Subject: [PATCH] [#395] Display slippage-adjusted cost in TradingWidget Show "Max cost (incl. 3% slippage)" for buys and "Min return (incl. 3% slippage)" for sells instead of raw estimate. The displayed value now matches what the balance check uses, so "Insufficient balance" makes sense to users. Co-Authored-By: Claude Opus 4.6 (1M context) --- src/components/TradingWidget.tsx | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/components/TradingWidget.tsx b/src/components/TradingWidget.tsx index eca4940a..ae124be6 100644 --- a/src/components/TradingWidget.tsx +++ b/src/components/TradingWidget.tsx @@ -252,11 +252,11 @@ export function TradingWidget({ tokenAddress }: { tokenAddress: Address }) { {/* Estimate */} {estimate != null && parsedAmount > BigInt(0) && (
- {tab === "buy" ? "Estimated cost" : "Estimated return"}:{" "} + {tab === "buy" ? "Max cost" : "Min return"}:{" "} - {formatUnits(estimate, 18)} {RESERVE_LABEL} + {formatUnits(applySlippage(estimate, tab === "buy"), 18)} {RESERVE_LABEL} - (3% slippage tolerance) + (incl. 3% slippage)
)}