CLOB — Coming Soon ⚡
A fully on-chain central limit order book for prediction markets, deployed on an app-specific Arbitrum Orbit chain (L3), with the matching engine written in Rust and compiled to WASM via Arbitrum Stylus.
The vision
Order placement, cancellation, and matching are all on-chain state transitions. No off-chain matching server. That is the core trust claim — and it is literally true.
In one sentence: self-custodial, verifiable on-chain matching with Ethereum-inherited security, performance close to a CEX, and a public sequencer-decentralization roadmap.
Why it matters
🔐 Self-custody, always
User funds live in audited vault contracts. Forced inclusion and forced exit via the parent chain (Arbitrum One) work from day one — even a malicious sequencer cannot trap funds.
🔍 Verifiable matching
Every match is an on-chain state transition emitting structured events. The full book can be reconstructed from logs alone — no trust in an operator's matching server.
⚡ CEX-like performance
An app-specific L3 with fast blocks plus a Stylus-native Rust engine targets sub-cent order operations and 100–250 ms confirmations — performance market makers can actually quote on.
📐 Deterministic rules
Strict price-time priority and exact, documented matching semantics. Market makers can model queue position precisely — ambiguity in matching is treated as a bug.
Architecture — four layers
From user-facing infrastructure at the top down to Ethereum-anchored settlement:
Market-maker & user infrastructure
Low-latency RPC/WS tier with a dedicated order gateway and streaming book feed (depth deltas + trades) · MM SDK in Rust + TypeScript (book reconstruction from events, order management, batch ops) · indexer + public API (snapshots, candles, trades, positions) · paymaster-pattern gas policy for high-frequency operations like cancels.
Core contracts
Matching engine (Rust/Stylus) — one order book per market, price-time priority, FIFO queues per price level, all matching emitting events sufficient to rebuild the book · Vault & outcome tokens — collateral deposits, fully collateralized YES/NO pairs (1 unit of collateral mints 1 YES + 1 NO; no leverage in v1) · Market factory & registry · Optimistic resolution module (assert → challenge window → escalation) · Fee module with maker rebates.
App-specific Arbitrum Orbit chain
Deployed on the Arbitrum Nitro stack. Fast block times tuned for order flow, with a single sequencer at launch backed by working forced inclusion and a published sequencer-decentralization roadmap.
Settlement on Arbitrum One
The Orbit chain posts state roots here. Fraud proofs and the forced-inclusion mechanism anchor to Arbitrum One — inheriting Ethereum's security.
Matching rules — highlights
| Property | Behavior |
|---|---|
| Priority | Strict price-time priority. Better price first; within a price level, first-in-first-out. Queue position is exactly modelable. |
| Order types | limit · market · post-only flag · reduce-only flag |
| Time-in-force | IOC (immediate-or-cancel) · FOK (fill-or-kill) |
| Batch ops | Atomic place / cancel / replace in a single operation — built for market-maker quote updates. |
| Determinism | Deterministic integer arithmetic throughout. Replaying the event log reproduces the book byte-for-byte. |
| Transparency | Every operation emits structured events sufficient to reconstruct the entire book off-chain from logs alone. |
Roadmap
Six phases, built strictly in order — each phase gates the next.
Matching Engine Core
The CLOB as a standalone, deterministic Rust library — zero blockchain dependencies. Property-based testing of every matching invariant and a deterministic replay harness.
Stylus Port
Port the engine into an Arbitrum Stylus contract. Real gas profiling per operation against a local Nitro node, with storage layout aggressively optimized.
Vaults & Resolution
Collateral vaults, fully collateralized YES/NO outcome tokens, optimistic resolution with bonded challenges, and the fee module — integrated end to end.
Orbit Testnet
A running Orbit testnet settling to Arbitrum Sepolia. Forced inclusion wired and explicitly tested — a user can always exit, even against a censoring sequencer.
MM Infrastructure
Streaming book feed, order gateway, the Rust + TypeScript MM SDK, cancel-friendly gas subsidies, and market-maker economics validation on testnet.
Hardening & Audit
Fuzzing of the contract surface, economic attack review, mitigations for griefing vectors, external audit preparation, and bug bounty design.
Early access
Until then: the existing on-chain order book in rain-sdk-v2 is live on Arbitrum One today — limit orders, cancellations, and book reads, with the same Yes/No prediction-market semantics the CLOB will scale up.