OrderbookTrade
CLOB-Based matching engine with CRE-powered automated settlement for prediction markets
What it is
OrderbookTrade is infrastructure that gives any prediction market platform a Central Limit Order Book (CLOB) matching engine and Onchain Settlement Modular Infra — the same architecture used by institutional exchanges.
THE PROBLEM:
Most prediction markets run on AMMs, which suffer from high slippage, poor price discovery, and low capital efficiency.
Building a CLOB from scratch requires months of engineering. Most teams don't have that capacity.
THE SOLUTION:
OrderbookTrade provides this as a plug-and-play infrastructure service.
Platforms integrate via API and get: high-performance order matching (price-time priority), real-time order book depth, WebSocket feeds, and automated on-chain settlement.
CHAINLINK CRE INTEGRATION:
We use Chainlink CRE as the settlement orchestration layer.
When a prediction market resolves, a CRE Workflow:
- Fetches the real-world outcome via HTTP Action (CoinGecko / external API)
- Cross-references with Chainlink Data Feeds for verification
- Triggers the on-chain settlement contract to distribute winnings
- Cancels remaining open orders and returns funds This makes settlement trustless, verifiable, and fully automated — no manual resolution needed.
How it Works
Matching Engine (Go):
- High-performance CLOB with price-time priority
- Redis for in-memory order book state (sub-millisecond latency)
- PostgreSQL for persistent trade history and position tracking
- REST + WebSocket API for real-time order book updates
Smart Contracts (Solidity):
- Settlement contract implementing IReceiver interface
- Receives CRE resolution signal via Chainlink Forwarder
- Distributes payouts to winning positions on-chain
- Deployed on Base Sepolia testnet
Chainlink CRE Workflow (Go SDK):
- Trigger: HTTP Capability (called by matching engine post-match)
- Step 1: HTTP Action → fetch market outcome from CoinGecko API
- Step 2: Chainlink Data Feed cross-verification
- Step 3: EVM Write → call settlement contract with verified outcome
- Simulated via CRE CLI
Frontend (React + TailwindCSS):
- Live order book UI with bids/asks and recent trades
- WebSocket connection to matching engine for real-time updates
- Demo at
Links
Created by
- Baice Li
- Ethan
- Adrian