Below the swap fields, display a summary row showing the calculated fee, price impact, slippage tolerance input, and the resulting min-received / max-sent guarantee.
Calculations
Fee (deducted from input before the swap):
fee_amount = swap_amount_in × fees / 10_000
Price impact (how much the trade moves the pool price):
price_before = reserve_a / reserve_b
price_after = (reserve_a + amount_in) / (reserve_b − amount_out)
price_impact = (price_after − price_before) / price_before × 100
Min received (exact-input mode, applying user slippage tolerance s in %):
min_received = amount_out × (1 − s / 100)
Max sent (exact-output mode):
max_sent = amount_in × (1 + s / 100)
Requirements
- Slippage tolerance input defaulting to
0.5%, with preset buttons for 0.1%, 0.5%, 1.0%
- Fee shown in input token units (e.g.
0.30 USDC)
- Price impact shown as a percentage; highlight amber when > 1%, red when > 5%
- Min received / max sent updates in real time as amounts or slippage changes
Acceptance criteria
Below the swap fields, display a summary row showing the calculated fee, price impact, slippage tolerance input, and the resulting min-received / max-sent guarantee.
Calculations
Fee (deducted from input before the swap):
Price impact (how much the trade moves the pool price):
Min received (exact-input mode, applying user slippage tolerance
sin %):Max sent (exact-output mode):
Requirements
0.5%, with preset buttons for0.1%,0.5%,1.0%0.30 USDC)Acceptance criteria