Back to Learn
guide March 9, 2026

Market microstructure, explained like you'll build something with it

A first-principles tour of order books, queues, price formation, and the execution reality hiding underneath every candlestick.

#microstructure #order-book #execution

Charts hide the machine.

Microstructure is the study of that machine — how orders rest, how liquidity is consumed, how price is actually formed, and why your backtest keeps lying to you at the execution layer. If you want to build trading systems that survive contact with a real exchange, this is the ground floor.

The limit order book, in one paragraph

An exchange maintains two sorted lists: bids (buyers, willing to pay up to a price) and asks (sellers, willing to accept down to a price). The highest bid and lowest ask define the top of book. The gap between them is the spread. When a buyer crosses the spread and pays the ask (or a seller hits the bid), a trade prints. Price, fundamentally, is a consequence of how these two lists move. Everything else is compression.

Passive vs. aggressive

Two kinds of orders show up on every exchange:

  • Limit (passive) orders join the book at a price. They wait.
  • Market (aggressive) orders consume resting liquidity at the best available price. They don’t wait.

Passive orders supply liquidity; aggressive orders demand it. Order flow imbalance — measured in dozens of ways — is ultimately a count of how much more aggression landed on one side than the other over some horizon. Most short-horizon signals are variations on that theme.

The queue

Every price level has a queue. Orders enter at the back, get filled from the front. Your fill probability depends on:

  1. Your place in line (arrived early = filled first).
  2. The rate of aggression hitting that side.
  3. Whether anyone cancels in front of you.

Queue position is an asset. It’s also why a naive backtest that assumes instant fills at the top of book is probably overstating your P&L by a wide margin.

Price formation

Price isn’t a sequence of random numbers. It’s a consequence of:

  • Inventory pressure — dealers and market makers adjusting quotes to manage what they’re holding.
  • Information arrival — someone believes price should be different, and trades accordingly.
  • Flow — mechanical buying or selling (rebalances, hedges, liquidations) that moves price regardless of “fundamental” views.

Models like Kyle’s lambda, VPIN, and PIN all try to isolate the informed fraction of flow. Execution models try to avoid being on the wrong side of it.

Execution reality

A few painful truths that every backtest skips:

  • Queue position matters. Entering passively doesn’t guarantee a fill, and your position in the queue is almost never modeled.
  • Adverse selection is real. If you sit passive and get filled, you often got filled because the market is about to move against you.
  • Latency isn’t flat. Your worst-case matters more than your mean.
  • Fees and rebates change the sign of some strategies. A positive-expected-value strategy before fees is not necessarily one after.
  • Market impact scales worse than linearly. Double the size, more than double the impact.

Treat any model that ignores these as a sketch, not a strategy.

What to study next

If this is new, the immediate upgrades are:

  • The Order Flow Imbalance page — a simple, useful signal grounded in what we just covered.
  • The MBO Research Framework — how we’d approach researching a signal using market-by-order data rather than aggregated top-of-book.
  • The live HUD on the homepage — that dashboard is showing most of these concepts (queue imbalance, MOFI, VPIN, Kyle’s lambda, micro-price) computed live.

Once you can reason about the book, the queue, and the flow independently, the rest of this site will read differently.