Slippage

Slippage is the difference between the price quoted when you submit a trade and the average price you actually pay. On a DEX most of it is price impact, the amount your own order moves the pool's price, which grows with order size relative to liquidity.

Slippage calculator

Price impact
–
Total cost incl. fee
–
Cost in dollars
–

Buying from a 50/50 constant-product pool. Order-book venues and concentrated-liquidity pools behave differently, but the shape is the same: impact grows faster than order size.

How it works

The quoted price of an asset is the price of the next small unit. A larger order does not pay one price. It pays an average across every price it moves through, and the difference between that average and the quote is slippage.

On an order book exchange, a market order fills against the best ask first, then the next level, and so on until it is filled. Slippage depends on how much size rests near the top of the book. If the best ask holds 2 ETH and you buy 10, the other 8 fill at the next levels up, and the confirmation shows the weighted average of all of them. The visible price was only ever the price of the first 2.

On a constant-product DEX pool there are no levels. The pool holds a dollar side x and a token side y and keeps x × y constant, so every dollar you add makes the next token more expensive.

For a buy of size S from a pool whose dollar side is x, the average price you pay is higher than the pre-trade price by:

Price impact = S ÷ x

The calculator above takes total pool liquidity (both sides) and halves it to get x, so a $1,000,000 pool has a $500,000 dollar side. It then adds the pool fee, which is taken from your input before the swap.

Two other things widen the gap between quote and fill. Price can move between submitting and confirming, which is why DEXs ask for a slippage tolerance: the maximum gap you accept before the transaction reverts. And on a public blockchain someone can deliberately use that tolerance against you, which is the MEV sandwich attack.

A worked example

You buy $10,000 of a token from a pool holding $1,000,000 in total, with a 0.3% fee. These are the calculator's default inputs.

  • Dollar side of the pool: x = $1,000,000 ÷ 2 = $500,000
  • Price impact: $10,000 ÷ $500,000 = 2.00%
  • After the 0.3% fee, $9,970 goes into the swap. You receive tokens worth $500,000 × $9,970 ÷ $509,970 = $9,775.08 at the pre-trade price.
  • Total cost: $10,000 − $9,775.08 = $224.92, which means you paid 2.30% more per token than the quote.

The pool's price after your trade is about 4% higher than before, roughly twice the average premium you paid, because your last dollar bought at a much worse price than your first.

Size changes the result faster than intuition suggests:

Order size (same $1M pool, 0.3% fee) Price impact Total cost Cost in $
$1,000 0.20% 0.50% $4.98
$10,000 2.00% 2.30% $224.92
$50,000 10.00% 10.30% $4,669.46
$100,000 20.00% 20.30% $16,875.10

The same $10,000 order costs 20.30% in a $100,000 pool and 0.15% in a $20,000,000 pool with a 0.05% fee. Pool depth is the first number to check.

What it means in practice

Price impact is linear in size relative to liquidity: double the order, double the impact percentage, and roughly four times the dollar cost. Splitting a large order into pieces over time, or routing it across several pools, reduces impact because each piece meets a pool that arbitrageurs have refilled.

Slippage is paid on every entry and exit. A trader who loses 0.2% on each side of a round trip pays 0.4% per trade on top of exchange fees (maker and taker fees are a separate line). A hundred round trips at that rate cost about 40% of the position size in total.

Slippage tolerance is a ceiling, not a cost. Setting 1% does not mean you pay 1%. It means the transaction goes through at anything up to 1% worse than the quote. On a public mempool, the gap between your real price impact and that ceiling is what a sandwich bot can take.

When it matters most

Slippage is worst when liquidity disappears, which tends to happen when traders most want to trade. During a liquidation cascade, market makers widen spreads or pull quotes, and forced sellers walk deep into thin books. The same market order can cost several times more than it would in a quiet hour.

On DEXs it matters most in small pools: long-tail tokens, new launches and pairs where incentives have ended and liquidity has left. A pool that showed $5 million of liquidity last month may hold a fraction of that today, and the price impact scales with what is there now.

Common misconceptions

"Slippage is caused by a slow exchange." Speed adds a little, but most slippage comes from size against depth. An instant fill of a large order still pays the average of every price it consumes.

"My slippage tolerance is what I pay." Tolerance is the maximum allowed deviation. The actual cost is the price impact plus fee plus any price movement before confirmation, unless someone exploits the gap.

"High volume means low slippage." Volume measures how much traded, not how much is resting at the current price. A token can show heavy volume and still have a shallow pool or a thin book.

"Every order pays slippage." A limit order fills at your price or better, or not at all. Its cost is the risk of not being filled, not slippage.