Order Book Simulator

Interactive limit order book with step-by-step matching visualization — instrument: ALPHA

How to use

This order book simulator lets you place limit and market orders against a live book and watch how a matching engine fills them in real time. Use step mode to walk through price-time priority (FIFO) matching one operation at a time, or load preset scenarios to see how sweeps, iceberg orders, and spread collapses actually work.

The book shows all resting buy orders (bids, green) and sell orders (asks, red) for a fictional instrument. Asks are on top, bids on bottom, with the spread in the middle. Each row shows the price, total quantity and number of orders at that level, cumulative depth, and a depth bar.

Place orders using the entry panel. Choose Buy/Sell, Limit/Market, set a price (for limit orders) and quantity, then submit. Click any price level in the book to auto-fill the price input.

Limit orders rest in the book if they don't cross the spread. If they do cross (buy price ≥ best ask, or sell price ≤ best bid), they match against resting orders at each level using FIFO (first in, first out) priority.

Market orders fill immediately at the best available price(s), walking through levels if needed. If there's no liquidity on the other side, the order is rejected.

Step Mode is the key educational feature. Toggle it on, then submit an order or load a scenario. Each step of the matching algorithm is shown one at a time — press "Next Step" or spacebar to advance. Watch how the engine checks prices, fills quantities, and handles partial fills.

Scenarios preset the book and queue specific orders to demonstrate interesting behaviors. Each auto-enables step mode so you can walk through what happens.

Reset generates a fresh random book. The shape, depth, spread width, and order distribution will be different each time.

Best Bid
--
Spread
--
Best Ask
--
Mid Price
--
Spread (bps)
--
Price Qty (orders) Cumulative
Place Order
Step Mode
Scenarios
Trade History
TimePriceQtySide
Order Log
IDSideTypePriceQtyFilledRemStatus