Every exchange answers one question in its architecture, whether or not it says so: who decides which orders trade, and in what order? On a traditional exchange the answer is the operator, overseen by a regulator. On many venues described as decentralised, the answer is still an operator. Custody may sit onchain, but matching happens on a server.
This matters for anyone allocating size. The matching step sets fill quality, queue priority and the treatment of informed flow. If it runs out of view, a trader has to trust the operator's description of it.
Four common designs
Order-book venues today tend to follow one of a few patterns. The descriptions below come from each project's public materials.
- Off-chain matching, onchain settlement. A central engine matches orders and posts the results to a chain. Orderly runs a shared book this way across many front ends. LayerZero's ATLAS design, announced in August 2026, matches off-chain and verifies the results with zero-knowledge proofs after the fact.
- A central sequencer. One party orders transactions before they reach the book. Lighter uses a central sequencer and a deliberate delay on taker orders.
- An app-specific chain with a closed engine. Hyperliquid's HIP-3 lets third parties deploy venues after staking 500,000 HYPE, on a matching engine that is not open source.
- Fully onchain matching. The book and the matching logic are smart contracts on a general-purpose chain. Injective is the closest established example, with roughly one-second blocks.
Each design trades something away. Off-chain matching is fast but asks traders to trust that the engine ran as described, or to accept proofs that arrive later. Sequencers give consistent latency but put one party in charge of ordering. Closed engines cannot be inspected. Onchain matching has been the most transparent option and, until recently, the slowest.
What onchain matching means on Somnia
In Somnia Markets, the order book and the matching engine are smart contracts. Orders match by price-time priority, using deterministic rules written in published code, and settle atomically in the same block in which they match. Spot markets, perpetual markets and binary event contracts all run on this one engine.
Transaction ordering comes from Somnia's MultiStream consensus. Each validator publishes its own data chain, and a separate consensus chain merges their heads in a deterministic order. No single block producer chooses the sequence of a block, and there is no private queue in which an operator can reorder flow. Together with matching rules in open code, this removes the usual places where value is extracted from order flow.
The result is a venue where three properties hold at the same time:
- No company in the trade. Matching and settlement are contract calls, not services.
- No toll and no stake gate. Somnia Markets charges no protocol fee, and launching a venue requires no stake.
- One composable chain. Lending, USDso, vaults and agents interact with the book directly, in the same execution environment.
Is it fast enough?
Speed was the historical objection to onchain order books, and the base layer is what answers it. Somnia produces 100-millisecond blocks and compiles EVM bytecode to native code. Its IceDB storage engine has average read and write times of 15 to 100 nanoseconds (Somnia documentation). On dreamDEX, 95% of orders were placed within 24.4 milliseconds, and the venue has processed more than $120M in spot volume (Somnia blog, 1 September 2026). A trade costs gas only: a fraction of a cent.
- Block time
- 100 ms
- Somnia documentation
- 95th percentile order placement, dreamDEX
- 24.4 ms
- Somnia blog, 1 Sep 2026
- Protocol fee
- 0 bps
- dreamDEX documentation
Auditability as a feature
When matching is a contract, an audit is a query. Every order, fill and cancel is an onchain transaction with a hash. A compliance team can rebuild the book at any block. A market maker can check its queue position against the rules. A regulator can read the matching logic rather than a description of it. Off-chain venues can publish reports, but onchain venues publish the record itself.
That is the case for putting matching onchain. It is not mainly ideological: it changes who has to be trusted, and makes the remaining trust checkable.