How to estimate slippage from order book depth before you trade
Slippage is the difference between the price you expected and the average price you actually got. You can estimate most of it before placing an order, because the order book shows how much is available at each price. Add up the levels on the side you will consume until they cover your size, calculate the average price, and compare it with the mid price. The estimate is only as good as the snapshot it came from, and books thin out at the moments you are most likely to need them.
Slippage estimate = (average fill price from walking the book − mid price) ÷ mid price. Walk the asks to buy and the bids to sell. If visible depth cannot cover your order, you do not have an estimate, and you should not treat a partial average as one.
What an order book is showing you
An order book lists resting limit orders. The asks are sellers waiting above the current price, and the bids are buyers waiting below. Each row gives a price and the quantity available there, and most screens add a running total. The best ask minus the best bid is the spread, and the mid price is halfway between them.
A market order does not get a single price. It takes the best available level, then the next, and so on until it is full. Depth is what determines how far it has to travel. A deep book has large quantities near the mid, so a big order moves only a little. A thin book has little at each level, so the same order travels further and pays more.

Walk the book step by step
Here is the whole method, using a sell order so that you can see it working in the other direction. Suppose the mid is 2,000.00 USDT and you want to sell 30 units. The bids are:
- 8 units at 1,999.50
- 10 units at 1,999.00
- 15 units at 1,998.20
Your order fills 8 + 10 = 18 units on the first two levels and the remaining 12 at the third.
- 8 × 1,999.50 = 15,996.00 USDT
- 10 × 1,999.00 = 19,990.00 USDT
- 12 × 1,998.20 = 23,978.40 USDT
You receive 59,964.40 USDT for 30 units, so the average is 1,998.81. That is 1.19 below the mid, or about 6 basis points. On a notional of 60,000 USDT, slippage costs about 35.60 USDT, before the trading fee. These numbers are illustrative; substitute the live book for your contract.
Why the size of your order changes everything
Slippage does not grow in a straight line. Doubling an order usually more than doubles the cost in basis points, because the extra units fill at worse levels than the first ones did. Using the example above, selling only 8 units has about 2.5 basis points of slippage, and selling 30 has about 6. A larger order that reaches thinner levels further down will climb faster still.
This is why a single "liquidity" number can mislead, and why we measure at four separate order sizes. Across the contracts we measure at the 1,000,000 USDT size, MEXC could fill the entire order from visible depth in about 100% of cases, while KuCoin managed about 8%. The gap at that size is far wider than at small sizes, where most large exchanges look alike.
What depth can and cannot tell you
The book is a statement of intent that can change instantly. A few things limit how far you can rely on it.
- Orders can be withdrawn. Market makers adjust quotes constantly. Depth you see now may be gone by the time your order reaches the matching engine, and that is more likely when the price is moving.
- The public feed may show limited levels. Many APIs and screens show only part of the book. Bybit and Binance both offer different depth levels on their APIs, so a shallow feed can understate what is really there.
- Hidden and iceberg orders exist on some venues. They can make the real depth larger than the displayed depth, though you cannot plan on that.
- Fake depth is a known problem. Large orders placed with no intention of trading can make a book look stronger than it is. They tend to vanish as the price approaches them.
For all these reasons, treat an estimate as a lower bound on your cost in a fast market. Our guide to stale quotes looks at how old a book may already be when you see it.
When depth disappears
Depth is at its weakest exactly when many people want to trade at once. Market makers widen their quotes or step back during sharp moves, because the risk of being on the wrong side has risen. That means an estimate taken in a calm hour can substantially understate the cost of an emergency exit.
If your plan includes a stop-market order, think about what the book might look like when that stop fires, not what it looks like now. Stops tend to fire during exactly the moves that thin the book, and several stops can fire together, each taking more depth from the next. This is also a reason to check how exchanges hold up during busy periods: an API that struggles at those times makes a thin book worse, since you may not be able to see or cancel what you need to.
Reducing slippage
There is no way to remove it completely on a large order, but several habits help.
- Use a limit, not a market order, for size. A marketable limit caps the worst price you will accept. Anything left unfilled stays in the book, or you can cancel it and reassess.
- Split the order. Smaller slices spread over time allow the book to refill. The risk is that the price moves while you wait, and you pay more in total fees if each slice has a minimum.
- Trade the more liquid contract. The same asset often has one much deeper contract on the same exchange, such as USDT against USD or USDC settlement. Check that the contract specification suits you first.
- Choose your timing. Liquidity varies through the day and around scheduled events. A thin weekend or a minute after a major release is a costly time for a large market order.
- Check several exchanges. Depth differs, and the difference grows with size. Comparison pages such as Binance vs OKX are a starting point, but always look at the live book for your contract.
Estimating slippage through the API
If you trade with code, the same logic applies. Request the depth endpoint with enough levels to cover your size, walk the side you will consume, and calculate the average. Three practical points:
- Check the depth limit parameter, since the default may return only a few levels, which is not enough for a large order.
- Depth endpoints have higher rate-limit weights on some exchanges, because they are expensive to serve. Polling them too often can trigger a block. See our guide to rate limits.
- Check the timestamp if the response includes one, and compare it with your clock. A book that is several seconds old is not a basis for a fast decision.
Also treat contract size correctly. Some exchanges quote depth in contracts, others in the base asset or in USD. An order book reading "1,000" could mean 1,000 contracts of 0.01 BTC or 1,000 BTC, and misreading it will put your estimate off by a very large factor. Our market order guide shows how to add the fee to this estimate.
Slippage and other costs compared
For small orders on liquid contracts, slippage is often negligible, and the trading fee is the main cost. As size rises, slippage takes over. For position traders holding for weeks, funding can exceed both. A sensible estimate of the cost of a trade therefore adds all three: slippage on entry and exit, trading fees on entry and exit, and funding for the time you expect to hold. Looking at one number in isolation is how people choose an exchange that turns out to be expensive for what they actually do.
Common questions about slippage
Is slippage the same as the spread?
Not quite. The spread is the gap between the best bid and best ask at one moment. Slippage in the sense used here is the total gap between your average fill and the mid, which includes half the spread plus any further distance your order travels through the book. A small order on a deep contract pays about half the spread and no more.
Can slippage be positive?
Yes. If the book improves between your decision and your fill, you can get a better price than you expected. It is less common for market orders in moving markets, because moves that benefit you tend to fill at the first available level, whereas moves against you leave you chasing.
What is a slippage tolerance setting?
Mostly a feature of decentralised exchanges and some swap interfaces: the worst deviation you will accept before the transaction is rejected. On a centralised exchange, a limit order or a price-protection setting does a similar job. Check what your exchange offers, because defaults differ.
Estimate before you click
- Open the order book for your exact contract and note the mid.
- Choose the side your order will consume.
- Add levels until the running total covers your size.
- Compute the average price and its distance from the mid.
- Add the taker fee.
- Ask how the estimate changes if half the depth disappears.
Related reading: How much a market order really costs · Maker and taker fees · Mark price vs last price
Sources
Other guides
What is a funding rate in crypto perpetual futures? A plain explanation
A funding rate is a regular payment between traders holding opposite sides of a perpetual futures contract. It exists because a perpetual contract never expires, so something else has to keep its price close to the underlying asset. When the rate is positive, longs pay shorts; when it is negative, shorts pay longs. The exchange sets the formula but, on the major exchanges, the money moves between traders.
How to compare funding rates across crypto exchanges: 8h vs 4h settlement
You cannot compare two funding rates by looking at the percentages alone. A rate only means something once you know how often it is charged, whether you are long or short, and whether the two readings describe the same contract at the same moment. The same +0.01% costs twice as much per day on a four-hour schedule as on an eight-hour one, and it earns a short exactly what it costs a long.
What does a negative funding rate mean? Who pays, and what it does not tell you
A negative funding rate means traders holding short positions pay traders holding long positions at the next settlement. It usually happens when a perpetual contract trades below its index price, which often reflects heavy shorting or hedging. It does not mean the price is about to fall or about to rise, and it is not free income for longs, because the price can move against them by far more than the payment.
How to convert a funding rate to APR, and why the number can mislead you
To annualise a funding rate, multiply the rate per settlement by the number of settlements in a day, then by 365. A rate of 0.01% every eight hours becomes 0.01% × 3 × 365 = 10.95% a year. This puts contracts on different schedules onto one scale, which makes them comparable. It does not tell you what you will earn or pay over a year, because it assumes today's rate never changes.
Funding rate arbitrage explained: how it works and what eats the profit
Funding rate arbitrage means holding two offsetting positions in the same asset so that price moves roughly cancel, and collecting funding payments on one side. The classic version buys spot and shorts the perpetual. A second version shorts the perpetual on the exchange with the higher rate and goes long on the exchange with the lower rate. It is often described as risk free. It is not. The risks are simply different from the risk of an ordinary directional trade.
Mark price vs last price vs index price: which one liquidates you?
Perpetual futures show three prices that are easy to mix up. The last price is where the most recent trade happened. The index price is an average of spot prices across several exchanges. The mark price is an exchange's estimate of what the contract is fairly worth, and on the major exchanges it is what decides your unrealised profit and whether you are liquidated. Knowing which price does what explains why a position can be liquidated even though the chart never touched your liquidation level.
How much does a market order really cost? Fees, spread and slippage
The fee on an exchange's fee page is only part of what a market order costs. The rest comes from the price you actually receive, which depends on the direction of your trade, your order size and the depth of the order book at that moment. To compare exchanges fairly, measure the average fill price against one reference price, then add your trading fee on top, and be careful not to count the spread twice.
Maker and taker fees explained: how to compare crypto exchange trading fees
A maker adds an order to the book that waits to be filled. A taker fills against an order already there. Most exchanges charge takers more than makers, because makers supply the liquidity others trade against. Comparing exchanges by the headline fee alone is misleading: you need to know which side you usually trade on, what tier your volume actually puts you in, and how the fee compares with slippage and funding on the same trade.
How to check if a crypto exchange is down: a step-by-step guide
When an exchange stops working for you, the first question is whether it is down for everyone or only for you. You can usually answer that in a couple of minutes: check the exchange's own status page, check an independent measurement, try a different network, and test the public API directly. Each source sees something different, so one green page does not prove everything is fine, and one failed request does not prove the exchange is down.
Is an exchange really down? How to read API uptime and outage records
Uptime describes the share of successful requests to particular services, over a particular period, from a particular network route. It does not establish whether you can place an order, withdraw funds or trust an exchange with your assets. A figure like 99.9% is useful only if you know what was tested, from where and for how long, so this guide explains how to read those details on our pages and on anyone else's.
What to do when a crypto exchange goes down while you have an open position
If an exchange stops responding while you hold a position, your first job is to find out what is actually broken, the second is to stop making it worse, and the third is to reduce your risk by whatever route still works. Do not keep resending the same order, because earlier attempts may have gone through. Check the mobile app and the API as alternative routes, consider hedging elsewhere if your exposure is large, and record what happened in case you need to raise it later.
Why exchange APIs reject timestamps: clock offset and stale quotes explained
A fast response can contain an old quote. Round-trip latency, clock offset and quote age describe different parts of a request, and mixing them up can make a clock mismatch look like a delayed market feed. This guide explains each one with a worked example, shows how we estimate them, and covers what to do when an exchange API rejects your request because of the time.
Binance error -1021 timestamp: causes and how to fix it
Binance API error -1021 INVALID_TIMESTAMP means the timestamp on your signed request falls outside the window Binance will accept. The message usually reads "Timestamp for this request is outside of the recvWindow" or "was 1000ms ahead of the server's time". In most cases your own clock is the cause, so the fix is to synchronise it, measure the offset against Binance's server time, and handle any remaining network delay properly. A larger recvWindow can hide the problem, but it should not be your first move.
Crypto exchange API rate limits: what error 429 means and how to stay under it
HTTP 429 means you have sent too many requests in a given time, and the server is asking you to slow down. It is not an outage. Each exchange counts requests differently: Binance uses a weight for each endpoint and bans IP addresses that keep going after a 429, Bybit blocks an IP that passes 600 requests in five seconds, and OKX sets limits per endpoint and returns error code 50011. Staying under the limit means reading the response headers, backing off properly and using WebSockets where you can.
Why an exchange API returns 403 or 451: blocks and regions
A 403 means the server understood your request and refuses to carry it out. A 451 means access is refused for legal reasons. On crypto exchange APIs, a 403 can be a web firewall, a request limit, an unauthorised key or a regional block, so the code alone does not tell you which. The response body, the exchange's documentation and a comparison from another network usually do. A real restriction applies to you for a reason, so the right response is to find out whether the service is available where you are.
Before you open a crypto exchange account: a checklist by country
Before you open an account on a crypto exchange, check four things: whether the exchange is allowed to serve people where you live, whether your country's regulator lists it, whether the site in front of you is the real one, and how the exchange has been running lately. The sign-up form takes ten minutes. Recovering from the wrong choice can take months, and sometimes it is not possible at all. This guide works through each check, using Binance and OKX as worked examples because they are the two exchanges readers ask us about most.
How to open and verify a Binance account: a step-by-step guide
Opening a Binance account takes four steps: register with an email address, a phone number or a Google, Apple or Telegram account; complete identity verification; secure the account; and make a first deposit. Registration takes a few minutes. Binance says verification is usually reviewed within 48 hours. This guide follows each step as Binance's own help pages describe it on 8 November 2026, with screenshots of those pages, and points out the details that most often cause trouble later.
How to open and verify an OKX account: a step-by-step guide
Opening an OKX account takes four steps: register with your country of residence, an email address and a phone number; complete identity verification; secure the account; and make a first deposit. OKX says it reviews verification applications within 24 hours. Which OKX company you end up with depends on where you live, and that decides the address you log in at, the fees you pay and the products you see. This guide follows OKX's own help pages as they stood on 8 November 2026, with screenshots, and flags the choices that are hard to undo. OKX shows some help pages differently by region; we read the versions served at okx.com/en-us, and the rules shown in your own account after you log in are the ones that apply to you.