Foundations · Lesson 1 of 8 · 17 min read
How an order book works
Bids, asks, the spread and depth — the data structure every price on this site comes out of, worked through one book you can check the arithmetic on.
- Assumes
- nothing — this is where the syllabus starts.
- After this you can
- Read a live ladder from the middle outward and say what a given size would cost before you send it.
The short version
- A book is two sorted lists: bids high to low, asks low to high. The best bid is always below the best ask, because anything else would already have traded.
- The spread is what a round trip costs when the market does not move. Depth is how far a given size reaches before the price does move.
- A price level is not one order. It is a queue, and on a real venue your place in it decides whether "price touched my level" means anything.
- The book shows intention, not commitment. Resting orders can be withdrawn without a trace; only the tape records what actually happened.
Every price on this site comes out of one data structure. The big number on a terminal, the last price ticking in the markets table, the close of every candle — all of it is the visible residue of an order book. The structure itself is almost embarrassingly simple: two sorted lists of orders nobody has traded with yet. Almost everything markets do falls out of the shape of those two lists.
This lesson uses one illustrative book throughout, and the two lessons after it send orders into the same one — so the arithmetic you check here is the arithmetic you spend there. The live version is a click away, and where a number below is ours rather than the venue’s, it says so.
Two lists, facing each other
A bid is a resting offer to buy — a price and a quantity someone is willing to pay. An ask (or offer) is a resting offer to sell. The book keeps bids sorted from the highest price down and asks from the lowest price up, so the two numbers that matter most end up facing each other in the middle: the best bid, the most anyone will pay right now, and the best ask, the least anyone will accept.
The best bid is always below the best ask. It has to be. If a buyer were ever willing to pay what a seller was asking, the venue would match them on the spot and both orders would leave the book as a trade. What remains is, by definition, only the orders that have not yet found a counterparty.
Read the ladder from the middle outward, not from the top down. The row against the spread on each side is the one that trades next; everything further out is a queue of prices waiting for the market to come to them. The Amount column is what sits at that single price. The Total column is everything between that price and the spread added up — which is the column that answers most real questions, and the one this lesson comes back to twice.
The bar behind each row tracks Total rather than Amount, and that is a deliberate choice in our terminal as well as in this drawing. What a trader is reading a book for is “how much is between me and this price”; a bar showing each level’s own size answers a question nobody asked.
The spread is a price you pay
The gap between best bid and best ask is the spread. In the book above it is 64,301.2 − 64,295.1 = 6.10 USDT, which on a price near 64,300 is about 0.009%.
It is the price of impatience. To buy this instant you pay the ask; to sell this instant you accept the bid. Do both in the same breath and you are down the spread before the market has moved a tick — you bought at 64,301.2 and can immediately sell only at 64,295.1. Nothing went wrong. You paid for immediacy twice.
The spread is not a fee, and nobody charges it to you. It is the standing disagreement between the most optimistic buyer and the most reluctant seller, and crossing it is how you buy their agreement.
That is why a tight spread is the first thing traders mean by liquid. A wide spread says the opposite: trading right now is expensive, and often that very few people are quoting. Our terminal keeps the spread pinned between the two sides of the book in both absolute and percentage terms, and it renders it only when both sides exist — a spread computed against a missing side is a zero that looks like a number.
One detail worth knowing before you compare venues: the percentage is the spread divided by the ask, not by the mid. It is the convention exchanges use and it is what our strip shows to three decimal places. Dividing by the mid gives a very slightly smaller number, which is exactly why some places prefer it.
Depth: how far does an order reach
Each price in the book is a level. The quantity resting at each level, added up as you move away from the middle, is depth. Depth answers the question the spread cannot: not “what does the next unit cost?” but “how much can be bought before the price is somewhere else?”
The same reading works in reverse and is worth doing once. To sell 2.00 BTC you walk the bid side downward: 0.58 at 64,295.1, then 1.10 at 64,290.0, then 0.32 of the 1.35 at 64,281.7. The average comes out at 64,290.15 — about 4.95 USDT per BTC below the best bid, against the 12.04 the same size cost on the way in. The two sides are not symmetric, because the two lists are not symmetric, and any book you look at will favour one direction over the other at any given moment.
One warning about reading depth. Depth is a snapshot of the orders that exist at the instant the frame was sent, and a large order is a promise nobody has made. Which brings us to the two things about books that are genuinely counter-intuitive.
Inside one level: the queue
The ladder draws the best bid as a single number — 0.58 BTC at 64,295.1 — and that aggregation hides something important. A level is not one order. It is many orders from many people, and on almost every venue they are ranked by price-time priority: better prices first, and among orders sharing a price, whoever arrived earliest.
This is why “the market traded at my price and I did not get filled” is a normal experience rather than a bug. Your order was behind 0.53 BTC of other people’s orders, and the seller only had 0.40 to give. Join a level late and you inherit its whole queue; join it early and you are the one who fills first when a seller finally arrives.
It is also why the book cannot tell you how long you will wait. It aggregates by price and throws the order count away, so 0.58 BTC at a level could be one order or fifty, and the two cases behave completely differently. Nothing on any exchange’s public book distinguishes them.
Twenty levels, however you slice them
Real books are quoted at the venue’s tick size, which on BTC/USDT is 0.01 USDT. Twenty levels at a one-cent tick can span less than a dollar, which tells you almost nothing about where real size is sitting. Every terminal therefore offers price grouping: bucket the levels into coarser prices — 0.1, 1, 10 — and add up what falls in each bucket.
Two things about grouping are worth getting right, because both are commonly misunderstood.
- Grouping never fetches more book. It aggregates the twenty levels the feed already carries into fewer rows. A coarser step means fewer, fatter rows over exactly the same liquidity — which is why our book header pins Top 20 levels next to the control and leaves it there while the row count falls.
- Bucket labels round the conservative way, per side. A bid bucket rounds its price down and an ask bucket rounds up. That way the label is always a price at which the whole bucket’s size is genuinely available at that price or better. Rounding to nearest would produce a row claiming size at a price where some of it does not exist.
The same control also has an honest limit. Group coarsely enough and the whole visible book collapses into two rows, at which point you are no longer reading a book — you are reading a two-number summary of twenty levels. The useful setting is the one where the rows are wide enough to show where size clusters and narrow enough that there is more than a handful of them.
Beside grouping, our terminal offers a unit toggle that re-denominates the Amount and Total columns from base size into quote value. That is usually the easier unit for judging whether a level is big: 1.20 BTC requires arithmetic, 77.2K USDT does not. The depth bars follow the active unit, so the fills and the numbers they sit behind always agree.
What the book does not show you
A book is a live list of standing intentions, and every one of those intentions can be withdrawn at no cost. That single property is responsible for most of the ways a book misleads people.
- Cancels leave no trace. A trade prints to the tape; a cancelled order simply stops being in the next frame. A wall you were watching can be gone with no record that it ever existed, which is what the figure above is showing.
- Some orders are only partly visible. An iceberg shows a small slice and refills it as the slice is eaten, so a level that keeps absorbing far more than it displays is a level with something behind it. This is the opposite failure: real liquidity that the book understates.
- Some orders are not meant to trade at all. Placing size you intend to pull before it is touched is called spoofing. It is market abuse and it is prosecuted, and it still means a large resting order is evidence, not proof.
- You are only seeing part of the book. Our feed carries the top twenty levels a side and nothing on this site can deepen it. Real books extend far past that, and the levels you cannot see are the ones that decide what a genuinely large order costs.
None of this makes the book useless. It makes it a picture of what people are currently willing to do, which is a different and weaker claim than a picture of what will happen. The book is the best available evidence about the next few seconds and almost no evidence about the next few hours.
The book is intention, the tape is history
Beside the book on the terminal is the trade tape: every execution as it happens, newest first. Book and tape are two views of one machine. The book is everything that might trade; the tape is everything that did. When a match happens, quantity leaves the book and a print appears on the tape.
Tape rows are coloured by which side was the aggressor — the incoming order that crossed the spread, not the one that was resting. That is the distinction the whole fee schedule of a real venue is built on: the resting order makes liquidity, the incoming one takes it. We charge one taker rate on every spot fill and say so on the fees page, because with no local book there is no maker side to reward.
When the two disagree, believe the tape. A level absorbing print after print without moving is doing real work; a level that vanishes as soon as price approaches never was. That is the single most useful habit this lesson can leave you with, and it costs nothing to practise: watch a big level, and see whether it trades or evaporates.
Five ways to misread a book
Mistaken belief: “There is a huge wall at 64,400, so price cannot get above it.”
What actually happens: It can, and often the wall disappears first. Resting size is cancellable at zero cost, so a wall is a statement of intent with no commitment behind it. A wall that keeps trading and does not shrink is meaningful; a wall that evaporates as price approaches was never a barrier.
Mistaken belief: “The spread is the exchange’s fee.”
What actually happens: Two different costs. The spread is a property of the market — it exists because buyers and sellers disagree — and you pay it to whoever was resting. The fee is charged by the venue on top; ours is published on the fees page and is imported from the engine so it cannot drift from what a fill is actually charged.
Mistaken belief: “The depth bar says 68% bids, so price is about to go up.”
What actually happens: That bar sums the value displayed across twenty levels on each side. Those twenty levels are the most easily cancelled data on the screen, and the imbalanced part of them is the most cancellable part of that. It is weak, short-horizon evidence at best, and it flips on a single cancel. Confirm it against the tape or do not use it.
Mistaken belief: “Grouping to 10 USDT shows me more of the book.”
What actually happens: It shows you the same twenty levels in fewer rows. Nothing about the feed changes when you group — the header keeps saying Top 20 levels for exactly that reason. Coarser grouping is a way to see where size clusters, not a way to see further out.
Mistaken belief: “My limit order sits at the best bid, so it fills when price touches it.”
What actually happens: On a real venue, only if the sellers who arrive are large enough to reach past everyone queued ahead of you at that price. On this site your resting order has no queue in front of it and fills when the venue’s book crosses your price — which is the optimistic case, and worth remembering when you trade somewhere with a real queue.
Where our numbers come from
Every figure on the terminal arrives from the venue, so it is worth being precise about what arrives and how fast.
Swipe horizontally to compare all columns.
| What you see | Where it comes from | How fresh |
|---|---|---|
| The order book | Binance’s partial-depth stream, twenty levels a side | A new frame every 100ms — about ten a second |
| The trade tape | Binance’s trade stream, coloured by aggressor side | As each trade prints |
| A book on first paint | The worker’s cached snapshot, or the venue’s REST API | A cached book older than five seconds is discarded, not served |
| Your fills | That same live book, walked level by level | At placement; resting orders are swept every five seconds |
If the worker holding the venue sockets stops, every read falls back to the venue’s REST API: the site polls instead of streams, and pages get slower rather than blank. The status page says which mode each feed is in, because a frozen number looks exactly like a stable one.
Check yourself
Five questions against the book in the first figure. Answer before you open each one.
You want to sell 0.20 BTC this second. What price do you get?
The Total column beside the 64,320.0 ask reads 2.20. What is it telling you?
Why can the best bid never be higher than the best ask?
A level shows 0.58 BTC. How many orders is that?
You group the ask side to 10 USDT and the four rows become two. How much liquidity did you gain?
Next: the two instructions that touch this book. One of them guarantees a price and the other guarantees a fill, and the 2.00 BTC order you just costed is the example that runs all the way through it.