Order Book Mechanics
dYdX uses a central limit order book (CLOB) model - matching orders directly between traders rather than routing through a pool. This means tighter spreads, deeper liquidity for large orders, and maker rebates for providing liquidity.
Order Book Architecture
Price-time priority Maker/taker fees Priority fee auctions
Order Book Visualization
The live order book shows all resting buy (bid) and sell (ask) orders. Depth is shown in BTC. Price improves as you go up the book.
Fee Calculator
Calculate your trading costs based on order size and fee tier.
Order Types Deep Dive
Priority Fee Auction System
When the order book has many resting orders, the matching engine uses priority fees to determine execution order among same-price orders. Higher priority fee = faster matching. This prevents spam and incentivizes efficient ordering.
Matching Engine: Price-Time Priority
New order arrives. Validated (balance, position limits, margin). Placed in queue.
Best available price selected from opposite book side. Best bid meets best ask.
At same price, orders ranked by: (1) Priority fee (highest first), (2) Time (oldest first). FIFO within fee tier.
Orders filled in priority order. Partial fills proceed down the queue. Mark price updated.