PnL ProfitEncyclopedia
🌐 English

Order Book and Market Depth

7 min read · Updated Nov 23, 2026
More in Trading Basics

An order book is the live list of all resting buy and sell limit orders for an instrument, organized by price. Most exchanges for stocks, futures and crypto use one, and a matching engine pairs incoming orders against it according to fixed rules. Market depth describes how much quantity sits at each price near the current market. Reading the book helps traders understand liquidity and likely execution costs, although what is displayed is only part of the story.

Key takeaways

  • The order book lists bids (buy orders) and asks (sell orders); the best bid and best ask define the spread.
  • Most exchanges match orders by price-time priority: better prices fill first, and at the same price, earlier orders fill first.
  • Level 1 data shows only the best bid and ask, while Level 2 shows the quantity resting at several price levels.
  • Displayed depth can change in an instant, and fake orders placed to mislead others, called spoofing, are illegal in major markets.
  • Many markets do not use a central order book at all; forex is largely dealer-based, and many crypto exchanges use automated market makers.
On this page
  1. How a limit order book works
  2. The matching engine and price-time priority
  3. Level 1 vs Level 2 (and Level 3)
  4. Reading the book
  5. Exchanges vs OTC and dealer markets
  6. AMMs as a contrast
  7. Common mistakes

How a limit order book works

Every resting order in the book is a limit order: an offer to buy at or below a price, or to sell at or above a price. Buy orders form the bid side and sell orders form the ask (or offer) side.

  • The best bid is the highest price any buyer is currently willing to pay.
  • The best ask is the lowest price any seller is currently willing to accept.
  • The gap between them is the spread, and the midpoint is the mid price. See bid-ask spread and liquidity.

A trade happens only when a buyer and seller agree on a price. Resting limit orders provide liquidity; orders that trade against them immediately, such as market orders, take liquidity.

The matching engine and price-time priority

The matching engine is the exchange software that receives orders, checks them against the book and records trades. Most stock, crypto and many futures exchanges use price-time priority:

  1. Price first. A higher bid has priority over a lower bid; a lower ask has priority over a higher ask.
  2. Time second. Among orders at the same price, the one that arrived first fills first.

This is why traders talk about their "place in the queue". Canceling and re-entering an order sends it to the back of the line at that price. Some futures markets use a pro-rata method instead, where orders at the best price share each incoming fill in proportion to their size.

Worked example: matching an incoming order

The book for a stock looks like this:

Bid size Bid price Ask price Ask size
300 $20.00 $20.02 200
500 $19.99 $20.03 400
800 $19.98 $20.05 1,000

The best bid is $20.00 and the best ask is $20.02, so the spread is 2 cents and the mid price is $20.01.

Now a trader sends a limit buy for 500 shares at $20.03. The engine matches it against the cheapest asks first:

  • 200 shares at $20.02 (the full first level)
  • 300 shares at $20.03 (part of the second level, leaving 100 shares there)

The order is fully filled at an average of (200 x $20.02 + 300 x $20.03) / 500 = ($4,004 + $6,009) / 500 = $10,013 / 500 = $20.026.

The new best ask is $20.03 with 100 shares, and the spread widens to 3 cents until someone posts a new offer. If the same trader had sent a limit buy for 500 at $20.01 instead, it would not match anything. It would rest in the book as the new best bid, ahead of the $20.00 orders.

Level 1 vs Level 2 (and Level 3)

Data level What it shows Who typically uses it
Level 1 Best bid, best ask, their sizes, last trade price and volume Most retail traders; included free by most brokers
Level 2 (market depth) Quantity at several price levels on each side, sometimes by venue or market maker Active day traders and scalpers
Level 3 Individual orders, and for members, the ability to enter and manage quotes Exchange members and market makers

On many crypto exchanges, full depth data is available free. In stocks and futures, Level 2 data often carries an exchange fee. In the US, a stock trades on many venues at once, so a consolidated Level 2 view combines several books.

Reading the book

Depth tells you roughly how much you can trade before moving the price. A few common observations:

  • Thin books mean higher costs. If only small sizes rest near the best price, a moderate order will slip through several levels.
  • Large resting orders can act as temporary barriers. A big bid may slow a decline while it lasts, but it can be canceled at any time.
  • Imbalance is weak evidence. More size on the bid than the ask can hint at short-term buying pressure, but it is unreliable on its own because much of the displayed size is fleeting.
  • The book is not the whole market. Iceberg orders hide most of their size, and many institutions trade through algorithms, dark pools or dealers that never show in the visible book.

Traders who study the book and the stream of executed trades in detail practice order flow trading.

The spoofing caveat

Spoofing is placing orders with no intention of letting them fill, to create a false impression of supply or demand, then canceling them. It is illegal in the US, the UK, the EU and many other jurisdictions, and regulators have brought cases against both firms and individuals. For a trader reading the book, the practical lesson is that large displayed orders may not be real. Treat depth as information about what might happen, not a promise.

Exchanges vs OTC and dealer markets

Not all markets use a central limit order book.

  • Exchange markets (most stocks, futures and listed options, centralized crypto exchanges) gather orders in one or more public books.
  • Over-the-counter (OTC) or dealer markets work differently. In forex and most bond markets, dealers such as banks quote prices directly to clients, and each dealer sets its own bid and ask. There is no single book showing everyone's orders. A retail forex broker's price feed is its own quote, not a public order book. See brokers and exchanges.

Dealer markets can be deep for large clients but are less transparent, and prices can differ between dealers.

AMMs as a contrast

Many decentralized crypto exchanges replace the order book with an automated market maker (AMM). Instead of matching buyers and sellers, an AMM holds a pool of two tokens and sets the price with a formula. The most common, the constant product formula, keeps the product of the two token balances fixed (x times y equals k).

Worked example: buying from an AMM pool

A pool holds 100 ETH and 300,000 USDC, so the implied price is 3,000 USDC per ETH and k = 100 x 300,000 = 30,000,000.

A trader buys 1 ETH. After the trade the pool must hold 99 ETH, so it must hold 30,000,000 / 99 = 303,030.30 USDC. The trader pays 303,030.30 - 300,000 = 3,030.30 USDC, before fees.

The average price paid is about 1% above the starting price. That is price impact, the AMM's equivalent of walking up an order book, and it grows quickly as the trade becomes large relative to the pool. AMMs always quote a price, but they cannot offer the precise control of a limit order. They also expose traders to front-running by bots, covered in MEV and sandwich attacks. For more on the differences, see CEX vs DEX.

Common mistakes

  • Trusting large displayed orders. They can disappear the moment price approaches them.
  • Ignoring depth before sizing a trade. A position that is easy to enter in a busy hour may be hard to exit in a quiet one.
  • Reading Level 2 for one venue as the whole market. Fragmented markets spread liquidity across many venues.
  • Assuming forex quotes are an exchange price. Retail forex prices come from the broker or its liquidity providers.

FAQ

What is an order book in trading?

An order book is the real-time list of all resting buy and sell limit orders for an instrument, sorted by price. It shows where buyers and sellers are waiting and how much they want to trade.

What is the difference between Level 1 and Level 2 data?

Level 1 shows only the best bid and ask with their sizes and the last trade. Level 2 shows the orders waiting at several price levels on each side, which reveals market depth.

How does price-time priority work?

Orders at better prices are filled first. Among orders at the same price, the one that was placed earliest is filled first, so canceling and replacing an order loses your place in line.

Is spoofing illegal?

Yes. Placing orders you intend to cancel in order to mislead other traders is illegal in the US, the UK, the EU and many other jurisdictions, and regulators have prosecuted it.

Educational content only. Nothing here is financial, investment, legal or tax advice. Trading carries a high risk of loss, and leveraged products can lose more than you deposit. Rules, fees and platform details change: check current terms with your broker, exchange or regulator before you trade.