Lab: free tools · size first · stock scanner · crypto scanner · journal

Trading

Slippage

Slippage in crypto trading is the difference between the expected price of a trade when the order is submitted and the actual execution price. It comes from market movement during order transmission (in CEX trading) or from the AMM's price impact formula executing a trade against a liquidity pool (in DEX trading). Slippage tolerance is the maximum acceptable percentage difference that a trader sets before a DEX trade reverts.

Slippage is the difference between the price you expect and the price you get. It comes from moving through an order book or AMM curve with a large order, from price moving during execution, or from front-running on DEXs.

Where it comes from

On an order book exchange, a market order fills against resting limit orders, starting with the best price. If your order is larger than the size available there, it keeps filling at worse levels, and the average fill ends up away from the price on screen. Prices can also move between the moment you click and the moment the order arrives, especially in fast markets.

An automated market maker has no book. The pool prices each trade along a curve, and every unit you buy makes the next one more expensive. That built-in price impact grows with trade size relative to the pool's liquidity. Price impact in DeFi walks through the math.

Slippage tolerance on DEXs

DEX interfaces ask for a slippage tolerance, the worst price you will accept before the transaction reverts. Set it too tight and trades fail during volatility, costing gas for nothing. Set it too loose and you announce how much extra you are willing to pay. Bots watching the public mempool can buy just ahead of you and sell right after, taking the difference up to your limit. That is a sandwich attack, and a wide tolerance on a thin pool invites it.

How to reduce it

  • Check order book depth or pool liquidity before sizing the trade.
  • Use limit orders where price control matters more than certainty of a fill.
  • Split large orders over time; a TWAP order automates this.
  • On DEXs, use an aggregator that routes across pools, and consider private transaction routes that keep orders out of the public mempool.
  • Avoid thin markets around news, when spreads widen and depth disappears.

Measuring it

Compare your average fill with the mid-price at the moment you decided to trade. Over many trades, that gap plus fees and the bid-ask spread is your real cost of execution. For strategies with a small edge per trade, slippage is often the difference between a backtest that works and an account that does not.

Slippage is the price of impatience. Sometimes it is worth paying.