GaiaEx AcademyGaiaEx Academy
What is an Order Book? How Trades Get Matched
BeginnerTradingacademy.article.readingTime

What is an Order Book? How Trades Get Matched

The engine behind every trade — bids, asks, and price-time priority

Share Posts

What Is an Order Book?

Before any trade happens — on any exchange, anywhere — someone has to go first. A buyer posts a price they're willing to pay. A seller names their number. These declarations pile up, thousands per second, into a data structure called an order book.

That's really all it is. A queue.

Each entry carries three pieces of information: direction (buy or sell), price, and size. "Buy 0.40 BTC at $67,450." "Sell 1.10 BTC at $67,520." Stack a few thousand of these together and you get a living, twitching map of where buyers think fair value is and where sellers disagree. The gap between the most aggressive buyer and the cheapest seller? That's the market, distilled to a single number.

When a buyer's price meets or exceeds a seller's, the matching engine fires. Both entries vanish from the book. The chart updates. No negotiation, no phone call, no waiting. Specialist brokers on the NYSE floor used to maintain handwritten versions of this ledger in the 1800s — the digital incarnation just made it faster by six or seven orders of magnitude.

Pull up any market on GaiaEx — BTC/USDT, tokenized gold, a perpetual contract on ETH — and the order book is right there, updating tick-by-tick over WebSocket. It shows what hasn't traded yet: the bids nobody has sold into, the asks nobody has bought. Not the past. The future.

Bids, Asks, and the Spread

The book has two sides. Bids on the left — buyers, sorted highest price first. Asks on the right — sellers, sorted lowest price first. The most aggressive participants on each side sit at the top, eyeing each other across a gap called the spread.

Consider a real snapshot from GaiaEx's BTC/USDT book, captured during a London-session afternoon when volume was running about $380M over the prior 24 hours:

Bid PriceBid QtyAsk PriceAsk Qty
$67,4800.85 BTC$67,5100.42 BTC
$67,4702.30 BTC$67,5201.10 BTC
$67,4601.75 BTC$67,5403.85 BTC
$67,4504.20 BTC$67,5500.90 BTC
$67,4306.00 BTC$67,5805.20 BTC

Spread: $30. That's the distance between the best bid ($67,480) and best ask ($67,510), or roughly 0.04%. For a major pair like BTC/USDT, this is normal — tight enough that a round-trip (buy then sell) only costs you about $30 per coin in spread alone. Compare that to a thin altcoin with maybe $1.5M in daily volume: spreads of 0.5–1.0% are common, and they eat into your edge fast.

Cumulative depth tells a different story than individual levels. In the snapshot above, the bid side stacks to 15.10 BTC within $50 of the best bid — roughly $1.02M of buy support. The ask side totals 11.47 BTC across a wider $70 range, about $775K. More bids than asks, packed tighter. Mild buying pressure, if you believe the book at face value. (More on why you shouldn't always trust it later.)

One thing trips up beginners constantly: the "price" blinking on your chart is the last-traded price, not a live quote from the book. The book shows intent. The chart shows history. They're related, but they're not the same thing.

BTC / USDT — Order Book Snapshot GaiaEx · 14:32 UTC · 24h vol $382M QTY BID PRICE ASK PRICE QTY 0.85 $67,480 2.30 $67,470 1.75 $67,460 4.20 $67,450 6.00 $67,430 SPREAD $30 · 0.04% $67,510 0.42 $67,520 1.10 $67,540 3.85 $67,550 0.90 $67,580 5.20 Cumulative Depth Bids within $50 → 15.10 BTC (~$1.02M) Asks within $70 → 11.47 BTC (~$775K) Best bid $67,480 × 0.85 → highest standing offer to buy Best ask $67,510 × 0.42 → cheapest available sell Bid depth outweighs asks → mild buying pressure Green bars = bid depth · Red bars = ask depth · Bar width proportional to quantity Buyers (bids) Sellers (asks) Spread zone Snapshot is illustrative. Live book at gaiaex.com updates via WebSocket.
A BTC/USDT order book snapshot. Bids (green) stack on the left by descending price; asks (red) on the right by ascending price. The spread sits in the center.

Market Orders vs. Limit Orders

Every interaction with the order book boils down to one choice: do you want certainty of execution, or certainty of price? You can't have both.

A market order is impatient. "Buy 1.5 BTC, right now, whatever the ask side is showing." The matching engine obliges immediately. It grabs the cheapest ask first — 0.42 BTC at $67,510 — then moves up to the next level: 1.08 BTC at $67,520. Done. You're filled. Your average entry price lands around $67,517, a touch higher than the quoted best ask because you ate through two price levels to get your full size. That gap between what you expected and what you got is slippage.

How bad can slippage get? On a deep book like BTC/USDT during London hours, a 1.5 BTC market order barely moves the needle — maybe $7 of slippage on a $101K position. Try the same stunt with 50 BTC on a Sunday night when market makers have pulled their quotes. You could sweep through ten levels and end up with an average price $200 above the initial best ask. Size relative to depth is everything.

A limit order flips the tradeoff. "Buy 2.0 BTC, but only at $67,400 or less." Your order enters the bid side of the book and sits there, visible to everyone, waiting for a seller to come down to your price. Maybe it fills in minutes. Maybe it takes days. Maybe the market rallies and your order never executes at all — you saved money on the price but missed the trade entirely.

The fee structure reflects this dynamic. Market orders take liquidity — they remove resting orders and make the book thinner. Limit orders that don't fill immediately make liquidity — they add depth that benefits everyone else. GaiaEx charges a lower maker fee than taker fee (the exact numbers are on the fees page). This isn't altruism. Deep books attract more volume. More volume means tighter spreads. Tighter spreads attract more traders. Positive feedback loop.

So which should you use? Wrong question — you'll use both, depending on the moment. BTC just broke a key resistance level and you need in? Market order, accept the spread, move on. You think ETH is going to retest $3,200 support and you want to accumulate? Limit buy at $3,210, walk away, check back later. The order book doesn't judge.

Market Order vs. Limit Order How each order type interacts with the book MARKET BUY "Fill me now — any price" Buy 1.5 BTC at market Ask side (before): $67,510 × 0.42 BTC FILLED ✓ $67,520 × 1.10 BTC 1.08 FILLED ✓ $67,540 × 3.85 BTC untouched Execution breakdown 0.42 BTC @ $67,510 = $28,354.20 1.08 BTC @ $67,520 = $72,921.60 Avg fill: $67,517.20 · Slippage ≈ $7 ✓ Instant fill ✓ Guaranteed size ✗ Pays spread ✗ Taker fee Best for: breakouts · stop-losses · urgent exits LIMIT BUY "Fill me at my price or better" Buy 2.0 BTC @ $67,400 Bid side (current): $67,480 × 0.85 BTC best bid $67,470 × 2.30 BTC $67,460 × 1.75 BTC $67,400 × 2.00 BTC YOUR ORDER Status: OPEN — resting in the book Fills only when price drops to $67,400 ✓ You set price ✓ Maker fee ✗ May not fill ✗ Can miss moves Best for: swing entries · DCA · patient accumulation Market orders consume resting liquidity · Limit orders add resting liquidity
A market buy sweeps through ask levels (left) while a limit buy sits on the bid side waiting for a seller to match (right).

Price-Time Priority

The matching engine runs one rule: price-time priority. Better price wins. Same price? Whoever posted first wins.

Three sellers resting at $67,510, $67,540, $67,580. An incoming market buy hits the $67,510 order. Always. No negotiation, no randomization, no favoritism. The best-priced order on the opposite side goes first, full stop.

Ties happen constantly. Two sellers both at $67,510, one with 0.42 BTC posted at 14:32:01.003 UTC and another with 0.80 BTC posted at 14:32:01.017 UTC. The first one — 14 milliseconds earlier — gets filled before the second. This is why high-frequency firms spend millions co-locating their servers next to exchange matching engines: when price is identical, time is the only tiebreaker that matters.

What does this mean for you, concretely? If you place a limit sell at $67,510 and 0.42 BTC is already sitting there from another trader, incoming buy orders eat through their quantity before touching yours. You're in line. To jump the queue, improve your price — sell at $67,509 — or get there before everyone else. That's the entire game.

GaiaEx's engine processes orders in sub-millisecond time. During the March 2024 rally when BTC pushed through $73,000 and message flow spiked to tens of thousands of orders per second, the matching engine didn't skip a beat. It matters most when markets are moving fastest — exactly when lagging systems tend to fail you.

Reading Depth: Walls, Thin Books, and Traps

Individual price levels are useful. Cumulative depth — how much total volume sits within a given range of the best price — is more useful. A depth chart plots this: bids stack leftward, asks rightward, and the two curves nearly kiss at the current price.

Steep curves mean volume is concentrated near the top of the book. Flat, gradual slopes mean it's spread thin. The shape tells you how much a market order of a given size will actually move the price.

Some patterns are worth watching for.

Buy walls appear when someone parks a massive bid at a single level — 120 BTC at $66,000 when the surrounding levels hold 2–3 BTC each. That's over $8M of buy support at one price. Sellers have to chew through all of it before price can go lower. These walls cluster at round numbers and known technical support levels, and they function like a floor — until they get pulled.

Sell walls work the other way. Eighty BTC stacked at $70,000 on a book that typically shows 1–2 BTC per level. Buyers need serious conviction (and capital) to absorb that supply. When a sell wall finally breaks, the move afterward is often violent — there's nothing behind it. Thin air.

Thin books are a different hazard. During off-hours — try Sunday 3 AM UTC — or right before a major macro release, market makers pull their quotes. Depth evaporates. A 5 BTC market order that would cause $7 of slippage during London hours might move the price $200. If you're trading into a thin book, limit orders aren't optional. They're survival.

Walls can be fake. Spoofing — placing a massive order to simulate demand or supply, then canceling before it fills — remains a real problem. The order was never meant to execute. It's a bluff designed to push other traders into acting. Navinder Sarao's spoofing during the 2010 flash crash cost him a $25.7M penalty, but the practice persists in less-regulated venues. Treat large resting orders with healthy skepticism: they might vanish the moment price gets close.

The Order Book on GaiaEx

GaiaEx runs a central limit order book for every listed market. Spot pairs, perpetual futures, tokenized real-world assets — all of them funnel through a single matching engine operating on price-time priority. Same architecture as the CME or Nasdaq, adapted for 24/7 crypto markets.

The depth visualization streams live over WebSocket. What you see on screen reflects the actual book state within milliseconds — not a snapshot from three seconds ago, not an approximation. It's the real thing. During high-volatility periods you can watch levels appear and vanish dozens of times per second, which is both fascinating and a little terrifying.

Beyond market and limit orders, the platform supports stop-limit, take-profit, and trailing-stop orders. A stop-limit at $66,000 does nothing until the last-traded price hits your trigger — then it converts into a limit order and enters the book. Until that trigger fires, it's invisible to other participants. Useful for protecting positions without telegraphing your exit plan.

Every fill comes with a timestamp, exact price, matched quantity, and a clear label of whether you paid maker or taker fee. No "price improvement" mystery. No order internalization. The book is the book, and the receipt matches.

Here's the thing nobody tells beginners: reading the order book is a skill, and it compounds. A trader who knows where depth sits, how the spread widens at 4 AM UTC versus 2 PM UTC, and when to use limits versus markets will consistently get better prices than someone trading blind — even running the same strategy. The edge isn't in the strategy. It's in the execution. Pull up the BTC/USDT depth chart on GaiaEx during the next Fed rate decision and just watch. You don't need to trade. Just observe how the book behaves when 500,000 people have the same idea at the same time.