Bid-ask spread, order book depth, imbalance signals, and price formation
The limit order book (LOB) is the central data structure of modern electronic markets. It is a real-time, priority-ordered list of all resting buy and sell orders for a given instrument. Every equity, future, and listed option trades through a limit order book (or a close variant).
Understanding the LOB is non-negotiable for stat-arb and execution roles. It is where price formation happens, where your orders compete, and where the data you analyze originates.
Two fundamental order types interact with the book:
Limit order: An instruction to buy (or sell) up to a specified quantity at a specified price or better. A limit buy at $100.00 will only execute at $100.00 or below. If no matching sell order exists, the limit order rests in the book, providing liquidity.
Market order: An instruction to buy (or sell) immediately at the best available price. Market orders consume liquidity by matching against resting limit orders. They guarantee execution but not price.
The distinction matters: limit orders make the market; market orders take from it. This asymmetry drives the maker-taker fee model used by most exchanges.
A snapshot of the LOB for a stock might look like:
| Side | Price | Size | |------|-------|------| | Ask | 100.05 | 300 | | Ask | 100.04 | 500 | | Ask | 100.03 | 200 | | --- | --- | --- | | Bid | 100.02 | 400 | | Bid | 100.01 | 600 | | Bid | 100.00 | 800 |
Key quantities:
The mid price is the naive estimate of fair value:
But the mid ignores the size at each level. If the best bid has 1000 shares and the best ask has only 100 shares, the true price is likely closer to the ask (the large bid signals buying pressure that will push the price up). The weighted mid (or micro-price) adjusts:
where and are the sizes at the best bid and ask respectively. When , the weighted mid shifts toward the ask. This formula is a staple of high-frequency alpha signals.
The order book imbalance quantifies the balance of supply and demand across multiple levels:
where and are the bid and ask sizes at level , summed over the top levels. OBI ranges from (all ask-side weight, bearish) to (all bid-side weight, bullish).
Empirical fact: OBI measured over the top 5--10 levels has statistically significant predictive power for short-horizon price moves (seconds to minutes). This is one of the most well-known microstructure alpha signals, and virtually every HFT firm uses some variant.
When your limit order rests in the book, your queue position determines how likely you are to get filled. Orders at the same price level are filled in price-time priority: first in, first out (FIFO).
Being early in the queue at the best bid or ask is extremely valuable. Suppose 1000 shares rest at the best bid and you are position 100 (i.e., 100 shares ahead of you). A market sell order of 200 shares fills the first 200 in the queue — you get filled. But if you are position 500, that same market order does not reach you.
The value of queue position is proportional to:
This is why latency matters in HFT: faster systems place orders earlier and secure better queue positions.
Prices move because of order flow imbalance. When buy market orders arrive faster than sell market orders, the best ask is consumed, the ask price moves up, and the mid price rises. This is the fundamental mechanism of price formation.
The Kyle (1985) model formalizes this: the market maker observes total order flow (informed + noise) and adjusts the price proportionally. The price impact coefficient in Kyle's model is the rate at which order flow moves prices.
In practice, the sequence of events is:
The best bid is $50.00 with size 200, and the best ask is $50.04 with size 800. What are the mid price, weighted mid, and the implied direction?
Mid price: .
Weighted mid: .
The weighted mid is below the standard mid, closer to the bid. This makes sense: the large ask size (800) signals selling pressure, so the true value is more likely near the bid. The imbalance at level 1 is , strongly negative (ask-heavy).
Interview tip: When asked about order book signals, always mention three things: (1) the weighted mid as a better fair value estimate than the mid, (2) order book imbalance as a predictive signal, and (3) the fact that the book is a noisy signal because of spoofing, iceberg orders, and cancellations. Sophisticated firms filter for "real" liquidity.