Every DEX swap pays the pool fee and moves the price against you. This calculator uses the exact Uniswap V2 constant-product formula to show your expected output, price impact, effective price, and the minimum-received floor that protects the trade.
How it works
For a swap of dx of token A into a pool with reserves x and y, with fee
f:
dx_eff = dx × (1 − f)
dy = (y × dx_eff) / (x + dx_eff) ← output of token B
spot price = y / x (B per A, pre-trade)
effective price = dy / dx (B per A you actually get)
price impact = 1 − effective / spot
min received = dy × (1 − slippage tolerance)
Because x × y must stay constant, the more you buy the steeper the marginal
price, which is exactly why large trades suffer.
Example and tips
Swapping 10 token A into a pool of 1,000 A and 2,000 B at a 0.3% fee yields about 19.7 B at an effective price near 1.97 versus a 2.0 spot — roughly 1.5% price impact, plus a min-received floor below that once you apply, say, a 0.5% slippage tolerance. Shallower pools punish you harder: halve both reserves and the same trade’s impact roughly doubles. Set tolerance just above expected impact — too tight and the swap reverts, too loose and you invite sandwich attacks.