Slippage calculator: walk the order book
Walk a market order through the order book to see the average price you would get, and how much of the cost is slippage rather than fee.
Calculations run in your browser. Nothing you type is sent or stored. Results are estimates for information only, not investment advice.
How it works
A market order does not fill at one price. It takes the best offer first, then the next one, and so on until the whole size is filled. The average price is the total money divided by the total quantity, and slippage is how far that average is from the price you expected:
Average price = Σ(price × quantity) ÷ Σ(quantity)
Slippage = (average − reference) ÷ reference for a buy, (reference − average) ÷ reference for a sell
The fee is charged on the money traded, so it is added to the cost of a buy and taken from the proceeds of a sell. The order book you paste is a snapshot. Other orders arrive and leave while you are deciding, and hidden or iceberg orders are not visible in it.
Worked example
The page opens with a market buy of 5 units into a book with 2 units offered at 100.0, 2 at 100.5 and 1 at 101.0. The order takes 2 × 100.0 + 2 × 100.5 + 1 × 101.0 = 502, so the average price is 502 ÷ 5 = 100.40, which is 0.40% above the 100.0 you saw. With a 0.1% taker fee, the fee is 0.502 and the total cost is 502.502.
How size changes the price
| Units bought | Average price | Slippage |
|---|---|---|
| 1 | 100.00 | 0.00% |
| 2 | 100.00 | 0.00% |
| 3 | 100.17 | 0.17% |
| 4 | 100.25 | 0.25% |
| 5 | 100.40 | 0.40% |
The first two units cost nothing extra because the best level holds them. Every further unit reaches deeper into the book. This is why the cost of a trade is not a fixed percentage: it grows with size relative to what is on offer. For the wider picture of what a market order costs, see what a market order really costs. On Upbit the price step itself adds a cost, shown in the tick size calculator.
Questions
Which side of the book do I enter?
For a market buy, enter the asks, the sell offers, from the lowest price up. For a market sell, enter the bids, the buy orders, from the highest price down. The calculator sorts the levels for you.
Is the result what I will actually get?
It is what the book you entered would give. Real books change quickly, and a fast market can move before your order arrives. Treat the result as an estimate.
Can I avoid slippage?
A limit order sets the worst price you accept, but it may not fill, or may fill only in part. Splitting a large order into smaller ones reduces the depth you consume at once but takes time, during which the price can move.
What is the difference between slippage and spread?
The spread is the gap between the best bid and the best ask, which you pay on a round trip even for a tiny order. Slippage is the additional cost from taking more size than the best level holds.