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.
Real exchanges support many variants. Memorize at least these:
Several order-type abuses are explicitly illegal under US (and most other) regulations:
These matter because microstructure signals (OBI, microprice) can be polluted by spoofed liquidity. Production systems filter for "real" liquidity using order-age and submit-cancel-rate heuristics.
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. The microprice (Stoikov, 2017) is a better estimate of where the next mid is likely to be, weighting each side's price by the size on the opposite side:
where and are the sizes at the best bid and ask. The mechanism: when the bid queue is small relative to the ask, a single market sell can exhaust it and push the bid down by a tick — so the mid is more likely to fall than rise, and the microprice (below the current mid) is the conditional expectation of where the next mid lands. Symmetrically, a thick bid and thin ask put the microprice above the mid.
This formula is a staple of high-frequency alpha signals.
Three spread definitions appear constantly in transaction cost analysis:
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, microprice, and the implied direction?
Mid price: .
Microprice: .
The microprice is below the mid, closer to the bid. The mechanism: the bid side is thin (only 200 shares) while the ask is thick (800). A single 200-share market sell will exhaust the entire best bid, dropping the bid price by at least one tick and pulling the mid down with it. The thick ask, by contrast, can absorb several hundred shares of buying without the ask moving. So the next mid is more likely to be lower than the current mid -- and the microprice is the conditional expectation of that next mid. The level-1 imbalance is , strongly negative.
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.