Slippage

Also written slippage tolerance, price slippage, slippage model

The gap between the price an order was expected to get and the price it actually got, usually quoted as a percentage. In crypto the word names three different numbers: a cost a backtest assumes, a limit a DEX swap or bot order refuses to exceed, and a measurement a data vendor computes from a snapshot of the order book. A figure without saying which is not comparable.

"Zero slippage" in a backtester, "1% slippage" in a swap interface and "0.3% slippage for $1M" in a data feed look like three readings of one quantity. They are an assumption, a ceiling and a measurement, and none of them can be substituted for another.

How it works

Slippage as a cost a simulation assumes. A backtest never sends an order, so it has nothing to measure and must invent a fill price. Most engines here take a parameter and apply it to every fill; some take nothing at all. VectorBT ships slippage=0.0 in its settings. Passivbot applies market_order_slippage_pct to simulated market orders, defaulting to five basis points. NautilusTrader's default fill model applies no one-tick slippage, and ten alternative fill models ship with it, from one-tick slippage to tiered synthetic books. Jesse, Freqtrade and OctoBot have no slippage model in the simulator at all.

Slippage as a limit an order carries. On a DEX, the number a user types is a tolerance. Uniswap Labs describes it as "the maximum percentage you'll allow the quoted price to move", and says that beyond it "the swap won't go through" — with the network cost still paid. Its web app sets one automatically, "usually between 0.1% and 5%", from gas and trade size. At contract level the tolerance becomes a minimum output. Uniswap's own swap guide sets amountOutMinimum to zero for the example and calls that "a significant risk in production", because it leaves the swap open to "a front running sandwich or another type of price manipulation". OctoBot's slippage_limit is the same idea on a centralised venue: a cap on what your own order will accept, not a model of what it will get.

Slippage as a measurement of the book. Kaiko computes "the potential slippage for a market buy order if it were placed at the time the Order Book Snapshot was taken". You choose the order size in the quote asset, and the reference price is a parameter: mid_price by default, or best for the best bid or ask. The same book and the same size give two different slippage figures depending on that choice — the mid-price version includes half the spread, the other does not. When the book cannot fill the size, the field comes back null.

Why it matters here

The default is a decision somebody made for you. An engine that ships zero slippage and fills at the candle price produces a backtest in which size costs nothing. For a strategy that trades rarely and small, that error is small. For one that turns over daily, trades thin pairs or crosses the spread on every fill, it can be larger than the return being measured. What a crypto backtest silently assumes goes through the defaults engine by engine; the short version is to open the settings file before the README.

A constant is not a model. Five basis points on every market order, as Passivbot applies, is better than nothing and still identical for a $100 order and a $1M one, at 03:00 UTC on a Sunday and in the minute after a liquidation cascade. Real slippage depends on the order size against the book at that instant, which is why the fill models that try to capture it — NautilusTrader's synthetic books, for instance — need order-book data rather than candles to mean anything.

A tolerance is not a forecast. Setting 1% on a swap does not mean the swap will cost 1%, and setting 5% does not make a trade with 5% of price impact any cheaper — it only lets a worse execution through. The wider the tolerance, the more room anyone ordering transactions around yours has to take the difference. A bot parameter called slippage may be either kind: read whether it changes the simulated fill or caps the live order.

Vendor slippage figures are sized and referenced. A number from Kaiko, or the slippage metric on terminals such as Hyblock Capital, is for one order size, one side, one venue and one reference price. Comparing "BTC slippage" across two venues is only meaningful when all four match. Kaiko's REST API keeps these derived metrics for a one-month rolling window, so a long history means rebuilding them from raw snapshots.

It is not the fee. Slippage and the taker fee are both paid when an order crosses the spread, and a report that folds them into one "cost" figure hides which one changed.

Where you will meet this

The cards where this changes a decision, then the rest that use the word.

Sources

  1. Price slippage (snapshot) — Kaiko, read
  2. What is slippage? — Uniswap Labs,
  3. Single-hop swapping — amountOutMinimum and sqrtPriceLimitX96 — Uniswap Labs, read

Updated