p14m

Order book simulator

Place limit and market orders against a live book and step through price-time priority matching one operation at a time.

How it works

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 teaching feature. Turn 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 the space bar 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 Quantity (orders) Cumulative

Trade history

TimePriceQtySide

Order log

IDSideTypePriceQtyFilledLeftStatus

Place an order

Step mode

Scenarios