Live Order Book: Real-Time Market Visualization
What is an Order Book?
In a marketplace, some market participants want to buy, and others want to sell. An order book is the data structure that records those intentions: all active buy and sell orders, grouped by price.
Below is a live view of Binance order-book depth near the current market price. React and TypeScript handle rendering, while a direct WebSocket connection streams the top 20 bid and ask levels in real time.
How Trades Execute
A trade occurs when a buy order and a sell order cross.
Two basic order types:
-
Market order
- “Buy now, whatever the best available price is.”
- Matches immediately against the best prices on the opposite side.
- Consumes liquidity.
-
Limit order
- “Buy at 93,000 or better (lower).”
- Sits in the book until matched or cancelled.
- Provides liquidity.
When a market buy arrives, it lifts the lowest ask.
When a market sell arrives, it hits the highest bid.
Each match removes volume from those levels and the book updates.