DeCrypto Markets

Learn: exchanges

What is an order book in crypto trading?

An order book is the list of resting buy orders (bids) and sell orders (asks) on an exchange, sorted by price. A market buy fills against the lowest asks first, then walks up level by level until it is complete. The deeper the book, the less a given order moves your average price.

How it works

Every order book has two sides. The bids are limit orders from people willing to buy, with the highest bid at the top. The asks are limit orders from people willing to sell, with the lowest ask at the top. The best bid and the best ask together are called the touch, and the gap between them is the spread. The price a chart shows is usually the last trade, which sits somewhere around the touch.

Each price level shows a size: how much of the coin is waiting there. That size is the market's depth. A market order does not choose a price. It takes whatever is resting on the other side, starting at the best price, and keeps going until it has filled the size you asked for. If the first level is too small, the rest of your order fills at the next level, and the next, each a little worse.

That is why the same order can cost very different amounts on different books. On a deep book a large order barely moves past the touch. On a thin book, often a small coin or a quiet hour, the same order can walk many levels and fill far from the price you saw. The cost of that walk is slippage.

The exact rule the games grade by

The rule the games use: a market buy fills the asks from the lowest price up, and a market sell fills the bids from the highest price down; each level fills completely before the next is touched. Average price = total quote paid / total coins filled. Slippage is measured against the touch: for a buy, (average - best ask) / best ask; for a sell, (best bid - average) / best bid, in basis points (1 bp = 0.01%). The largest size under a limit is the biggest order on the size grid whose slippage is at or under the limit, rounded down to the step.

Step by step

  1. Read the touch: the best ask if you are buying, the best bid if you are selling.
  2. Add up the sizes level by level from the touch until the running total reaches your order size.
  3. Multiply each filled amount by its price and add them: that is the total you pay or receive.
  4. Divide the total by the coins filled to get your average price.
  5. Compare the average with the touch to get slippage in basis points, and check it against your limit before you send the order.

What an order book shows and what it hides

  • It shows the limit orders resting right now, grouped by price. Most venues show an aggregated book: one total per price level, not each individual order.
  • It does not show orders that have not been placed yet, orders that will be cancelled before yours arrives, or hidden and iceberg orders that some venues allow.
  • It changes constantly. Automated market makers on the venue can update their quotes many times a second. The depth you read is a snapshot, not a promise.

Limit orders and market orders

A limit order names a price and waits on the book until someone trades against it, or until you cancel it. It adds depth and usually pays the lower maker fee. A market order names only a size and fills at once against whatever is resting, so it removes depth and pays the taker fee. See maker and taker fees for how that changes your cost.

A limit order priced through the spread, for example a buy limit above the best ask, fills at once like a market order, up to its limit price. It is a common way to cap how far an order may walk the book.

Worked example

A market buy walking the order bookAsks from the best price up, with the part a 0.990 BTC market buy fills. It takes 3 levels and fills at an average of 66,044.54 against a best ask of 66,005.0.Price (USDT)Size (BTC)66,268.25.787466,175.10.568666,138.61.862766,099.70.492966,074.70.808566,056.10.442866,005.00.310266,004.90.248165,960.00.499365,864.70.2856filled by the orderBuy 0.990 BTC: 3 levels, average 66,044.54, slippage 5.99 bps (limit 6).One step more, 0.995 BTC, slips 6.01 bps and breaks the limit.
Simulated BTC/USDT book. The orange part of each ask is what a 0.990 BTC market buy fills: 3 levels, average 66,044.54, slippage 5.99 bps against a 6 bps limit.

The book in the diagram is a simulated BTC/USDT book from the same generator the Order Book game uses. The best bid is 66,004.9 and the best ask is 66,005.0, so the spread is 0.1. The question is the game's question: what is the largest market buy whose slippage stays at or under 6 basis points, on a size step of 0.005 BTC?

The first ask level holds only 0.3102 BTC, so any meaningful order walks past it. Working level by level, a buy of 0.990 BTC fills across 3 levels. It pays 65,384.10 USDT in total, an average of 66,044.54, and its worst fill is at 66,074.7. Against the best ask that is a slippage of 5.99 basis points: just inside the limit.

One step more, 0.995 BTC, pushes slippage to 6.01 basis points and breaks the limit. So 0.990 BTC is the answer. Doubling the order to 1.980 BTC would cost 9.08 basis points of slippage, because the extra size has to come from levels further from the touch.

Takeaway: On this book, 0.990 BTC is the most you can buy at market within 6 bps. Size an order against the depth before you send it, not after.

Common mistakes

  • Reading the last price as your price. The chart's last price is where the previous trade happened. A market buy pays the asks, starting at the best ask and walking up. Your average can be well above the price on screen.
  • Ignoring the size at the touch. A tight spread looks cheap, but if the best level holds a fraction of your order, the rest fills deeper. Read the sizes, not just the two best prices.
  • Trusting depth that may vanish. Resting orders can be cancelled in milliseconds, especially just before a big move or news. A book that looks deep a second before your order can be thin when it arrives.
  • Using market orders on thin markets. Small coins and quiet hours often have little depth. A market order there can walk far. A limit order caps the worst price you accept, at the cost of maybe not filling.

What this does not tell you, and what can go wrong

The order book in the game is simulated and static: it does not move while your order fills. Real books change between the moment you look and the moment your order arrives, and other traders can trade ahead of you. The game's numbers show the mechanics, not what any real venue will charge you.

Depth on a book also says nothing about whether the coin is worth anything, whether the venue is solvent, or whether the volume is genuine. Some venues have been accused of showing inflated activity. A deep book is a cost question, not a safety signal. Keeping coins on any exchange carries the risk that the exchange fails; see self-custody and proof of reserves.

Questions people ask

What is the difference between a bid and an ask?

A bid is a resting order to buy at a stated price; an ask (or offer) is a resting order to sell. The highest bid and the lowest ask form the touch. If you sell at market you receive the bids; if you buy at market you pay the asks.

What does order book depth mean?

Depth is how much is resting at each price level, and in total near the touch. A deep book can absorb a large market order with little slippage. A thin book means even a modest order walks several levels and fills at a worse average price.

Why did my market order fill at a worse price than shown?

Because a market order takes whatever is resting, level by level. If the best level was smaller than your order, the remainder filled at worse prices. The book may also have changed between when you looked and when your order arrived. That gap is slippage.

Should I always use limit orders instead of market orders?

Neither is always right. A limit order caps your price and often pays a lower fee, but it may not fill. A market order fills at once but accepts whatever the book offers. This site does not give trading advice; the point is to know the cost of each before you choose.

Practise it

Reading about a rule is not the same as applying it. These games generate a fresh simulation each round, ask you to make the call first, and grade you against the same rule.

Order Book

Set the largest market order that keeps slippage under the limit. Decrypt shows every level filled and the average price.

What it teaches

Market Maker

Quote a bid and an ask, then manage the inventory the flow leaves you with.

What it teaches