Hyperliquid Architecture · The Hyperliquid L1 · 3/8
The On-Chain Order Book
Why a CLOB?
Hyperliquid uses a Central Limit Order Book (CLOB) — the same model used by every major centralized exchange (Binance, NYSE, CME). In a CLOB:
- Makers post limit orders at specific prices
- Takers send market orders that match against resting limit orders
- The matching engine pairs orders by price-time priority
This is fundamentally different from AMMs (Uniswap, Curve) where liquidity is provided through mathematical formulas rather than discrete orders.
Order Types
Hyperliquid supports a rich set of order types, comparable to centralized exchanges:
Basic Orders
- Market Order — Execute immediately at the best available price
- Limit Order — Execute only at the specified price or better
- GTC (Good-Til-Cancelled) — Remains active until filled or cancelled
- IOC (Immediate-or-Cancel) — Fill what you can immediately, cancel the rest
- ALO (Add Liquidity Only) — Reject if it would take liquidity (post-only)
Advanced Orders
- Stop Limit — Limit order triggered when price reaches stop price
- Stop Market — Market order triggered at stop price
- Take Profit — Close position at a target profit level
- Trailing Stop — Stop price that moves with the market
- TWAP — Time-weighted average price execution over a period
Matching Engine
The matching engine is part of HyperCore, the chain's execution state. There is no separate off-chain matching server: every validator executes the same ordered transactions and arrives at the same book state.
- A signed order is sent to an API server or node, which gossips it to the validators
- Consensus orders it into a block alongside other transactions
- Every validator executes the block and checks the opposing side of the book
- If a match exists (bid >= ask), the trade executes; margin is checked for both sides
- Partial fills are supported — the remainder rests on the book
- Price-time priority: better price first, then earlier placement
Because matching happens inside consensus, the book itself, every fill, and every resulting position are part of the verifiable chain state.
No Gas for Order Actions
One of Hyperliquid's most important design decisions is no gas fees for order operations. Placing, modifying, and cancelling orders costs no gas; trading fees are charged only when an order fills. This is critical because:
- Market makers may send thousands of order updates per second
- Gas costs would make tight spreads uneconomical
- Free cancellations enable sophisticated quoting strategies
The L1 achieves this by treating order operations as native HyperCore actions rather than smart contract calls. Spam is controlled instead by address-based rate limits that grow with an account's cumulative traded volume (rate limits).
Funding Rate Mechanism
For perpetual futures, Hyperliquid uses a funding rate mechanism to keep perp prices anchored to spot:
- Funding is exchanged directly between longs and shorts every hour; the protocol takes no fee on it
- The rate has two parts: a premium (how far the perp's impact bid/ask prices are from the oracle price) and a small fixed interest component (0.01% per 8 hours)
- The rate is computed on an 8-hour basis and one eighth of it is paid each hour, with an overall cap of 4% per hour
- Positive funding: longs pay shorts (perp trading above the oracle price)
- Negative funding: shorts pay longs (perp trading below the oracle price)
See the funding docs for the exact formula.
This creates an incentive for traders to take the side that receives funding, which pushes perp prices back toward spot.