On a constant-product AMM your trade literally bends the price curve. This calculator takes pool reserves and a trade size and reports the spot price, the post-trade marginal price, the percentage impact, and the output you receive after the protocol fee.
How it works
The pool obeys x × y = k. Swapping dx of the input token (after fee f):
dx_eff = dx × (1 − f)
new x = x + dx_eff
new y = k / new x where k = x × y
dy = y − new y ← output received
spot price (out per in) = y / x
post-trade price (out per in) = new y / new x
price impact = 1 − post-trade / spot
Because k is fixed, draining the output reserve raises the price of each
remaining unit — the curve is convex, so impact accelerates with trade size.
Example and tips
Trading 300 input tokens into a pool of 1,000 in and 1,000 out (0.3% fee) drains the output reserve hard: post-trade price drops well below the 1.0 spot and price impact runs into double digits. The same 300-token trade against a 100,000-token pool is nearly impact-free. The lesson for large orders is to split across pools or use a TWAP — and for researchers, high single-swap impact is precisely the signal that a sandwich is profitable.