Skip to main content
An order book is the list of buy and sell orders for an asset that are waiting to be filled on an exchange, ranked by price. A new order sent to the exchange either trades at once against a resting order on the opposite side or goes into the book and waits. The exchange picks the resting order to trade against by two priority rules: the better price trades first, and at the same price the earlier order trades first. The trade price is the price of the resting order.

What does an order book hold?

The diagram below draws an order book with made-up numbers, after the illustration of Gould et al.. Each box is a resting order and the number in it is its size. Buy orders rest below the price axis and sell orders above it, and at each price level the box next to the axis is the order that arrived first. The diagram labels five terms to know:
  • Best bid is the highest price at which someone is waiting to buy, here 100.
  • Best ask is the lowest price at which someone is waiting to sell, here 102.
  • Spread is the gap between the two prices: 102 − 100 = 2.
  • Mid price is the average of the two: (100 + 102) / 2 = 101.
  • Tick size is the smallest price change the exchange allows, here 1.
The book holds only unfilled orders: an order that has traded or been cancelled leaves it. Stocks, futures and crypto on a centralized exchange have order books, while forex and CFDs trade at prices that a dealer or broker quotes, as the article Exchanges and OTC markets explains.

When a new order arrives, does it wait or trade, and at what price?

There are two basic kinds of order. A market order names no price: it buys or sells at once at the best price available. A limit order buys at no more than the price you set, or sells at no less. The exchange handles the two along two branches: The best resting order is the one with the best price on the opposite side and, at the same price, the one that arrived first. A limit order is marketable when it can trade at once: a buy limit order when its limit is not below the best ask, a sell limit order when its limit is not above the best bid. Send three buy orders into the book of the first diagram, each starting from the original book, and you get three results: The rule for picking the resting order to trade against is called price-time priority, and most exchanges match orders continuously this way. In an exchange’s fee schedule, an aggressive order is a taker and a passive order is a maker, and each role pays its own fee.

Why does the price move?

The word “price” on a screen covers three different numbers: the best bid, the best ask and the last price, the price of the trade that just happened. The simulation below sends orders at random into an order book. On the left are the best bid and best ask over time, drawn over the size resting at each price. On the right is the order book at the current moment, with a Total column that accumulates size from the best price outward. Take the book of the first diagram again, with a best bid of 100 and a best ask of 102. These two prices change in only three ways:
  1. An aggressive order takes the whole best level. A market order to buy 5 takes the 4 units resting at 102 and 1 unit at 103, so the best ask rises to 103.
  2. A passive order is placed inside the spread. A limit order to buy 2 at 101 trades with no one, but it bids higher than every resting buy order, so the best bid rises to 101.
  3. The orders at the best level are cancelled. If both buy orders at 100 are cancelled, the best bid falls to 99.
The last two need no trade at all. The last price moves in its own way: an aggressive sell trades at the best bid and an aggressive buy at the best ask, so the last price can jump back and forth between 100 and 102 while the book stands still. So why does the price move? Aggressive orders create trades and use up price levels, but passive orders also move the price whenever one is newly placed or cancelled.

References

Exchanges and OTC markets

Which markets match orders through an exchange’s order book and which trade through dealers.

Market participants

Who stands behind the resting orders in the book, market by market.
Last modified on October 16, 2026