AMM Swap Output Calculator
Automated market makers price swaps with a constant-product curve: the product of the two token reserves stays fixed. This calculator takes the pool reserves, your input amount, and the pool fee, then returns how many output tokens you receive, the effective price, and the price impact of the trade. Use it to preview a swap before sending it and to judge whether the trade is too large for the pool's depth.
Constant-product swap formula
dx after fee = dx * (1 - fee)
Output dy = (y * dx after fee) / (x + dx after fee)
Effective price = dy / dx
Spot price = y / x
Price impact = (1 - effective price / spot price) * 100
x is the input reserve, y is the output reserve, and fee is the pool fee as a decimal. The output is always less than a linear quote because the curve moves the price as you trade.
Reading the result
- The output amount is what the pool releases after the fee and curve.
- The effective price is the average rate across the whole trade, not the starting spot price.
- Price impact rises sharply once the input is large relative to the input reserve.
- For shallow pools, splitting a large trade or routing it elsewhere can reduce impact.
AMM swaps: frequently asked questions
How does a constant-product AMM price a swap?
A constant-product automated market maker holds two token reserves whose product (x times y) stays constant, ignoring fees. When you add input tokens to one side, you can remove output tokens from the other so the product is preserved. Because the curve is not linear, larger swaps move the price more, producing price impact.
What is price impact?
Price impact is the difference between the spot price before your swap and the effective price you actually receive across the whole trade. It grows with trade size relative to pool depth. A swap that is small compared with the reserves has minimal impact; a large swap can move the price sharply.
How is the pool fee applied?
Most constant-product pools take a fee on the input amount before it reaches the curve. For example a 0.30% fee means only 99.70% of your input is swapped, with the rest retained by the pool for liquidity providers. Enter your pool's fee tier so the output reflects it.
Does this include slippage or gas?
No. This shows the expected output from the pool reserves and fee at the moment of calculation. Actual settlement can differ because other trades may change the reserves before yours confirms (slippage), and network gas is paid separately. Use a slippage tolerance and a gas estimate alongside this figure.
Sources and method
- The output formula is the constant-product invariant x*y=k applied to a swap with a fee on the input. It is a deterministic mathematical identity; all inputs are user-editable and no figure is hardcoded.
- U.S. Securities and Exchange Commission: Investor.gov on decentralized finance risk.
Reviewed by the CalculatorHub team, edited by James Graham, 19 June 2026. See our methodology.