Inferensys

Glossary

Limit Order Book (LOB)

An electronic record of all outstanding buy and sell orders for a specific financial asset, organized by price level and continuously updated in real-time.
SRE continuously monitoring AI systems on multiple screens, real-time dashboards visible, dark mode NOC setup.
MARKET MICROSTRUCTURE

What is a Limit Order Book (LOB)?

A foundational mechanism of modern electronic exchanges, the LOB organizes latent supply and demand to facilitate price discovery and automated trade execution.

A Limit Order Book (LOB) is an electronic, real-time record of all outstanding, unexecuted limit orders for a specific financial asset, organized strictly by price level and time priority. It serves as the central matching engine for an exchange, displaying the aggregated quantity of shares or contracts available to buy at the bid and sell at the ask, thereby defining the instantaneous supply and demand curve.

The LOB is a dynamic, event-driven data structure updated by messages for order additions, cancellations, and executions. The highest bid and lowest ask form the inside market, and the gap between them is the bid-ask spread. Analyzing the depth and shape of the book beyond the best prices—known as order book imbalance—is a critical input for high-frequency forecasting models predicting short-term price movements.

MARKET MICROSTRUCTURE

Core Characteristics of a Limit Order Book

A Limit Order Book (LOB) is the fundamental data structure of modern electronic exchanges. It is a real-time, tick-by-tick record of unexecuted limit orders, organized by price level, that reveals the latent supply and demand for an asset.

01

Price-Time Priority

The primary matching algorithm governing most electronic LOBs. Orders are first ranked by price (best price gets priority) and then by time (earliest order at that price gets priority).

  • Bid side: Higher prices have priority
  • Ask side: Lower prices have priority
  • A buy order at $100.05 placed at 10:00:00.000 executes before a buy order at $100.05 placed at 10:00:00.001
  • This deterministic rule ensures fairness and discourages latency arbitrage at the queue level
02

Market Depth (Level 2 Data)

Market depth refers to the cumulative volume of limit orders resting at each price level beyond the best bid and offer. It visualizes the liquidity profile of the book.

  • Level 1 data: Best bid, best ask, last traded price
  • Level 2 data: Full order book depth, typically 5-10 price levels on each side
  • Depth chart: A visual representation where the x-axis is price and the y-axis is cumulative volume
  • A deep book with large resting orders at multiple levels signals high resiliency—the ability to absorb large market orders without significant price impact
03

Order Types and Lifecycle

A LOB manages the full lifecycle of diverse order types, each with distinct execution rules and cancellation policies.

  • Limit Order: A commitment to buy/sell at a specified price or better. Rests in the book until filled or cancelled
  • Market Order: An instruction to execute immediately at the best available price. Consumes liquidity; never rests in the book
  • Iceberg Order: Displays only a small visible portion of the total quantity, replenishing automatically to conceal large trading intentions
  • Fill-or-Kill (FOK): Must execute in full immediately or be cancelled entirely
  • Immediate-or-Cancel (IOC): Executes any portion possible immediately and cancels the remainder
04

Liquidity Provision vs. Consumption

The LOB is a two-sided marketplace where makers provide liquidity and takers consume it, with fee structures incentivizing the former.

  • Maker: Places a limit order that rests in the book, adding liquidity. Typically receives a rebate or pays a lower fee
  • Taker: Submits a market or marketable limit order that matches against a resting order, removing liquidity. Pays a higher fee
  • Maker-taker fee model: Common on exchanges like Coinbase and Binance, where makers pay 0.00%–0.02% and takers pay 0.04%–0.10%
  • This economic incentive ensures tight spreads by rewarding those who quote competitively
05

Order Book Events and Updates

A LOB is not a static snapshot but a high-frequency event stream. Each change is broadcast as a discrete event, critical for algorithmic trading systems.

  • Add: A new limit order is placed at a price level
  • Modify: An existing order's quantity is changed (partial fill or manual adjustment)
  • Cancel: An order is removed from the book before execution
  • Execution/Trade: A match occurs between a taker and one or more makers, reducing resting quantity
  • Exchanges like NASDAQ emit these events via ITCH and OUCH protocols at microsecond granularity, requiring event-driven architectures to process
06

LOB Imbalance and Predictive Signals

The shape and dynamics of the LOB encode predictive signals about short-term price movements. Quantitative researchers extract features from the book's state.

  • Order Flow Imbalance (OFI): The net difference between aggressive buy and sell volume at the best bid/ask over a time window. High positive OFI predicts upward price pressure
  • Bid-Ask Spread: A wide spread signals low liquidity and high adverse selection risk; a narrow spread signals a competitive, liquid market
  • Queue position: The ordinal position of an order within a price level. Orders near the front of the queue have a higher fill probability
  • Volume-synchronized probability of informed trading (VPIN): Uses LOB volume imbalances to estimate the presence of informed traders
LIMIT ORDER BOOK ESSENTIALS

Frequently Asked Questions

Clear, technical answers to the most common questions about the mechanics, data structures, and analytical use of limit order books in modern electronic markets.

A Limit Order Book (LOB) is an electronic, real-time record of all outstanding, unexecuted buy and sell orders for a specific financial asset, organized by price level and priority. It operates on a strict price-time priority matching algorithm. Bid orders (buy limit orders) are ranked from the highest price to the lowest, while ask orders (sell limit orders) are ranked from the lowest price to the highest. When a new aggressive market order arrives, it is immediately matched against the best available resting limit order on the opposite side. If a new limit order is not immediately executable, it is stored in the queue at its specified price level, with its position in the queue determined by the time of its arrival. The LOB is the core state machine of modern electronic exchanges like NASDAQ and the CME, replacing the human-mediated open outcry pit with a deterministic, auditable matching engine.

Prasad Kumkar

About the author

Prasad Kumkar

CEO & MD, Inference Systems

Prasad Kumkar is the CEO & MD of Inference Systems and writes about AI systems architecture, LLM infrastructure, model serving, evaluation, and production deployment. Over 5+ years, he has worked across computer vision models, L5 autonomous vehicle systems, and LLM research, with a focus on taking complex AI ideas into real-world engineering systems.

His work and writing cover AI systems, large language models, AI agents, multimodal systems, autonomous systems, inference optimization, RAG, evaluation, and production AI engineering.