How does an order book actually work?
Resting orders, the spread and what happens when an order takes more than one price.
Two sides of the same book
Bids are orders to buy; asks are orders to sell. In our example, the highest bid is $100.00 and the lowest ask is $100.01. The gap between them is the spread. Each price has a finite quantity available.
Follow the available quantity
Suppose 80 units are offered at $100.01 and another 40 at $100.02. A market buy for 100 units takes 80 at the first price and 20 at the second. Its volume-weighted average price is $100.012, before fees.
A limit changes the constraint
A buy limit sets the maximum price you are willing to pay. A market order does not provide that price constraint. Neither the displayed quantity nor a past trade guarantees what will be available when an order arrives.
Sources & scope
The worked example uses a synthetic, single-venue price-time book. No fees, hidden liquidity or competing arrivals. Other venues can use different matching rules.
SEC Investor.gov · Types of ordersArticle history
18 September 2026 — First web reading companion.