‹ Understanding DeFi Lesson 6 of 16
Contents Lesson 6 of 16

5 min read · practitioner

Why does a bigger trade get a worse price in the same pool?

Two words get used interchangeably and mean different things: price impact and slippage. One is a certainty you can compute before you trade; the other is an uncertainty about what happens between deciding and settling. Confusing them is how people misprice execution.

Price impact: deterministic, and knowable in advance

Price impact is the movement your own trade causes along the curve. From the previous lesson, for a constant-product pool:

  • Buying Δx out of reserve x: impact = Δx / (x − Δx)
  • Selling Δx into reserve x: impact = Δx / (x + Δx)

Note the asymmetry. Selling into a pool is bounded — you can never push the output below zero — while buying out of a pool is unbounded, because Δx → x sends the denominator to zero and the price to infinity. You cannot drain an AMM. You can only pay progressively more absurd prices as you try.

Worked, on a 10 ETH / 20,000 USDC pool (spot 2,000):

Buy Impact = Δx/(x−Δx) Average price
0.1 ETH 0.1/9.9 = 1.01% 2,020.20
1 ETH 1/9 = 11.11% 2,222.22
3 ETH 3/7 = 42.86% 2,857.14
5 ETH 5/5 = 100.00% 4,000.00

Taking half the reserve doubles your average cost. There is no "market order at the touch" in an AMM; there is only a curve, and you walk up it.

Slippage: the difference between quoted and executed

Slippage is what happens because a blockchain is not instantaneous. You compute a price against reserves as they are now; your transaction sits in the mempool; other transactions land first and move the reserves; yours executes against a different pool than the one you priced.

This is why interfaces ask for a slippage tolerance — a minimum-output parameter enforced by the contract. Set it to 0.5% and the swap reverts (you pay gas, you keep your tokens) if execution would be worse than that. The parameter is a genuine trade-off:

  • Too tight → frequent reverts, gas burned for nothing, especially in volatile conditions.
  • Too loose → you have pre-authorised a bad execution, and pending transactions are public. A high tolerance on a large order is a visible invitation.

Sandwiching, stated mechanically

Because pending transactions are visible before they settle, an observer who sees a large buy with a 5% tolerance can order transactions around it: buy first (pushing the price up along the curve), let the victim's trade execute at the worse price its tolerance permits, then sell into the elevated price. The victim receives an output that is legal, within tolerance, and worse than it needed to be.

This is one member of a broader family usually labelled MEV — value extractable purely by choosing which transactions are included and in what order. It is not an exploit of a bug; it is a consequence of a public mempool plus a deterministic pricing curve. Mitigations exist (private transaction relays, batch auctions, tighter tolerances), and none of them are complete. It is described here so you can read the mechanism, not as guidance about how to transact.

The three costs, kept separate

When someone says a swap "cost" them something, insist on the decomposition:

  1. Price impact — the curve. Computable in advance from the reserves.
  2. Fee — the pool's tier, e.g. 0.30% of input, paid to liquidity providers.
  3. Gas — fixed in the chain's native token, independent of trade size.

Only the first depends on your size, only the third is size-independent, and the balance between them explains why small trades are dominated by gas and large trades are dominated by depth.

Try it now

  1. Rebuild the table above for a pool ten times deeper (100 ETH / 200,000 USDC) at the same spot price. At what trade size does impact reach 1%?
  2. On a public analytics site, find a pool's reserves, then compute the largest trade that could be executed with less than 0.5% price impact. That number, not the protocol name, is the pool's real capacity.
  3. Take a $10,000 swap: compute the fee at 0.30%, the price impact in a pool where your trade is 2% of the reserve, and a $9 gas cost. Which of the three dominates — and how does the answer change at $200?