The constant-product formula
A Uniswap v2-style pool keeps x · y = k: the product of the two reserves stays constant after each trade (the fee aside). Adding dx of token X means the pool must give out enough Y to keep the product, so each extra unit you sell gets a slightly worse price. The fee is taken from your input before the swap and stays in the pool for liquidity providers.
Price impact is the difference between the spot price before the trade and the average price you get, excluding the fee. As a rule of thumb, selling a share s of the X reserve moves the price by roughly s for small trades — 1% of the reserve, about 1% impact.
amount out = y·dx·(1−fee) / (x + dx·(1−fee))
spot = y / x, your price = amount out / dx
minimum received = amount out × (1 − slippage tolerance)Price impact vs slippage
Price impact is caused by your trade and is known before you sign. Slippage is the extra change between quoting and execution, caused by other trades landing first — including bots that sandwich large swaps. The slippage tolerance in a DEX interface sets the minimum amount out; if the price moves beyond it, the transaction reverts and you only lose the gas. A tolerance that is too wide invites sandwich attacks; one that is too narrow makes swaps fail in volatile markets.
When the model over- or underestimates
- Concentrated liquidity (Uniswap v3/v4, many newer DEXs) puts most liquidity near the current price, so small and medium trades see far less impact than the x·y=k figure — but impact jumps once the trade leaves the active range.
- Stable pools (Curve-style) for USDT/USDC keep impact tiny until the pool becomes unbalanced.
- Aggregators split a large order across several pools and venues, which usually beats a single pool.
- Gas is not included; on Ethereum mainnet it can matter more than impact for small trades.
Frequently asked questions
+What price impact is acceptable?
Under 0.5% is typical for liquid pairs; above 1–2% consider splitting the order, using a deeper pool or an aggregator, or a different route such as an instant swap.
+Where do I find pool reserves?
On the pool's page in the DEX interface or analytics sites, shown as the amount of each token locked in the pool.
+Does slippage tolerance change my price?
No. It only sets the minimum amount you accept; the actual price depends on the pool and on trades that execute before yours.
+Why do I receive less than the spot price even for tiny trades?
The pool fee (0.05%, 0.3% or 1% in common tiers) is deducted from your input, and the exchange rate shown may include a routing or interface fee.
+Is an instant swap service affected by price impact?
Instant swaps quote from their liquidity providers' order books and pools; the quote shown before you send already includes their spread and fees, so compare quotes by the amount received.
Calculations run entirely in your browser; nothing you type is sent to KOT.CASH. Results are estimates for information only and are not financial, tax or legal advice.