Inferensys

Glossary

Limit Order Book (LOB)

An electronic record of all outstanding buy and sell orders for a financial instrument, organized by price level and priority, representing the core market microstructure.
Stylish WeWork-like workspace with hot desks and document wall, professional searching through enterprise knowledge base on a mounted ultrawide display, warm industrial pendants overhead.
MARKET MICROSTRUCTURE

What is a Limit Order Book (LOB)?

A Limit Order Book (LOB) is the electronic record of all outstanding buy and sell orders for a financial instrument, organized by price level and time priority, representing the core market microstructure.

A Limit Order Book (LOB) is an electronic record that continuously updates all outstanding buy (bid) and sell (ask) orders for a specific financial instrument, organized by price level and time priority. It serves as the core matching engine for modern electronic exchanges, replacing traditional floor-based trading with a transparent, deterministic queue of resting liquidity. Each entry specifies a price, quantity, and submission timestamp, forming the fundamental data structure for market microstructure analysis.

The LOB operates on strict price-time priority: orders with the best price are matched first, and at identical prices, the earliest order takes precedence. The gap between the highest bid and lowest ask is the bid-ask spread, a direct measure of market liquidity. Traders interact with the book via market orders, which execute immediately against resting orders, or limit orders, which add new resting liquidity. The dynamic evolution of the LOB—driven by order submissions, cancellations, and executions—is the primary input for high-frequency trading algorithms and adversarial market simulation models.

MARKET MICROSTRUCTURE

Key Features of a Limit Order Book

The Limit Order Book (LOB) is the core data structure of modern electronic exchanges, representing the granular state of supply and demand. It records all outstanding limit orders, organized by price-time priority, and serves as the fundamental input for market simulation and algorithmic trading.

01

Price-Time Priority

The primary matching algorithm governing the queue. Orders are first ranked by price (best bid/highest offer wins) and then by time of arrival within the same price level.

  • Price Priority: Buy orders with higher limits and sell orders with lower limits execute first.
  • Time Priority: At identical prices, the earliest timestamp gets filled first.
  • This mechanism incentivizes liquidity provision and penalizes latency.
02

Bid-Ask Spread

The difference between the best bid (highest buy price) and the best ask (lowest sell price). It represents the implicit cost of immediate execution.

  • Tight Spreads: Indicate high liquidity and low transaction costs.
  • Wide Spreads: Signal illiquidity, high volatility, or information asymmetry.
  • The spread is a key input for transaction cost analysis and market impact models.
03

Market Depth

The cumulative volume of limit orders resting at each price level beyond the best bid and ask. Depth visualizes the market's capacity to absorb large orders without significant price movement.

  • Shallow Depth: Large market orders will cause substantial slippage.
  • Deep Books: Allow for high-volume execution with minimal impact.
  • Synthetic LOBs must accurately replicate depth shapes to avoid sim-to-real gap.
04

Order Types and Lifecycle

A LOB processes various order types, each with distinct rules for execution and cancellation.

  • Limit Order: A commitment to buy/sell at a specified price or better; adds liquidity.
  • Market Order: An instruction to execute immediately at the best available price; removes liquidity.
  • Iceberg Order: A large limit order where only a small visible portion is displayed, hiding true intent.
  • Fill-or-Kill (FOK): Must execute entirely and immediately or be cancelled.
05

Order Book Events

The LOB is a dynamic object updated by a stream of discrete events. Simulators must model these to generate realistic synthetic order books.

  • Add: A new limit order is placed at a price level.
  • Cancel: An existing limit order is removed.
  • Modify: The price or volume of an existing order is changed.
  • Execution: A trade occurs, removing volume from a resting limit order.
  • Hawkes Processes are often used to model the self-exciting nature of these event arrivals.
06

LOB as a State Representation

In deep reinforcement learning for trading, the LOB is flattened into a numerical tensor representing the market state. Features include:

  • Price levels: Normalized distances from the mid-price.
  • Volume imbalances: Ratio of bid-side to ask-side depth.
  • Order flow: Net aggression of market orders.
  • This representation allows neural networks to learn optimal execution policies directly from microstructure data.
MARKET MICROSTRUCTURE

Frequently Asked Questions

Essential questions about the Limit Order Book (LOB), the core data structure driving modern electronic exchanges and algorithmic trading strategies.

A Limit Order Book (LOB) is an electronic, real-time record of all outstanding buy (bid) and sell (ask) orders for a specific financial instrument, organized strictly by price level and time priority. It operates on a price-time priority matching engine logic: orders are first ranked by price (highest bid and lowest ask get priority), and if multiple orders exist at the same price, the one submitted earliest is executed first. The LOB does not just store orders; it continuously updates to reflect new submissions, cancellations, and executions. The difference between the highest bid and the lowest ask is the bid-ask spread, a direct measure of immediate liquidity. When an aggressive market order arrives, it consumes the resting limit orders on the opposite side, removing liquidity and shifting the best price levels.

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.