How an Onchain Order Book Works

Beginner | 5 min | Last verified 2026-09-07

Bids, asks, spreads, price-time priority, and what makes Hyperliquid's native order book different from an AMM.

An order book is a list of prices and quantities at which participants are willing to buy or sell. Hyperliquid maintains native central limit order books for spot and perpetual markets inside HyperCore, so resting orders, cancellations, and fills are part of the chain's financial state.

The important idea is that price is only one dimension of execution. Quantity, queue position, urgency, and available depth all affect the result of a trade.

NoYesYesNo

New order

Crosses the best opposite price

Rest on book

Match against best price

More size remains

Move to next price level

Order complete

Wait for future matching or cancellation

Bids, asks, and the spread

A bid is an order to buy. An ask is an order to sell. The highest bid and lowest ask form the top of the book, while the distance between them is the spread.

If the best bid for HYPE is $40.00 and the best ask is $40.01, a new buy at $40.00 can rest as a bid. A buy willing to pay $40.01 can trade with the resting ask immediately.

The visible top price does not tell you how much can trade there. A level may contain only a small quantity, which means a larger order can continue into worse prices.

Depth determines how far an order travels

Order book depth is the amount of liquidity available across price levels. A market can display a narrow spread and still be expensive to trade if there is little size behind the best bid and ask.

Suppose the best ask has 100 HYPE at $40.01, the next has 500 at $40.05, and the next has 2,000 at $40.15. A market buy for 1,000 HYPE would consume several levels. The average execution price would therefore be worse than the first price visible on screen.

That difference is one source of slippage. Spread, depth, slippage, and market impact should be evaluated together.

Queue position matters for resting orders

At the same price, order priority determines which resting order fills first. HyperCore uses price and time priority, so an order already resting at a better queue position can trade before a later order at the same price.

This matters most to market makers and passive traders. Posting at the best price does not guarantee a fill if a large amount of liquidity is already ahead in the queue.

Maker and taker describe the interaction

An order that rests and later provides liquidity generally fills as a maker. An incoming order that immediately consumes resting liquidity is the taker.

This distinction affects fees and strategy economics. Hyperliquid Fees, Makers, and Takers explains the fee side in more detail.

What makes the book onchain

HyperCore stores and updates the order book as native L1 state. Some decentralized exchanges use offchain matching with onchain settlement, while Hyperliquid places the market engine itself inside native execution.

Onchain matching does not create liquidity by itself. Market quality still depends on participants willing to quote competitive prices and maintain inventory during volatile conditions.

Continue reading

Read AMMs vs Order Books for the alternative pool based model, then Price Time Priority on HyperCore for deeper queue mechanics.

Sources

  1. https://hyperliquid.gitbook.io/hyperliquid-docs/trading/order-book
  2. https://hyperliquid.gitbook.io/hyperliquid-docs/hypercore/overview