What is the PMX Orderbook?
PMX Orderbook is a Central Limit Order Book (CLOB) for prediction markets on Solana. Orders are placed and cancelled entirely off-chain for speed and zero gas costs. Users deposit USDC into their personal on-chain smart wallet, trade gaslessly, and can withdraw anytime. Only settlement — the actual transfer of funds between users — happens on-chain.Zero Gas Orders
Place and cancel orders for free. No Solana transaction required — just sign a message with your wallet.
Deposit & Trade
Deposit USDC into your personal on-chain smart wallet. Trade gaslessly with zero fees on orders. Withdraw your funds anytime.
Instant Matching
The matching engine runs off-chain with sub-second latency. Supports direct fills, complementary matching, and sell-complementary matching.
Conditional Tokens
Uses a Polymarket-style CTF model. YES + NO tokens are always backed 1:1 by USDC.
Position Tracking & P&L
Automatic position tracking with weighted average cost basis, realized P&L on sells, and real-time unrealized P&L from orderbook prices.
How It Works
Deposit USDC
Deposit USDC into your personal on-chain smart wallet (a PDA-owned SPL token account derived from your public key). Your balance is the actual token balance in this account. You can withdraw anytime.
Place Orders (Free)
Sign an order message with your wallet (92-byte Borsh-serialized
OrderMessage). The matching engine stores it off-chain. No transaction fee.Automatic Matching
When your order crosses an existing order, the engine matches them instantly. Supports direct fills (buyer ↔ seller), complementary fills (buy YES + buy NO), and sell-complementary fills (sell YES + sell NO).
On-Chain Settlement
The engine submits a settlement transaction to Solana. The program verifies both Ed25519 signatures, checks balances, and atomically transfers tokens between users.
Track P&L
After each settled trade, your positions update automatically with cost basis, realized P&L, and real-time unrealized P&L from orderbook prices.
Key Principle
The on-chain program is the sole custodian of all smart wallets. The off-chain engine coordinates order placement, matching, and submits settlements, but cannot move funds outside the program’s rules. Your USDC is held in your personal smart wallet (PDA:["user_escrow", owner_pubkey]) — the actual SPL token balance is your balance, with no virtual bookkeeping. The exchange transfers USDC between smart wallets during settlement, and you can withdraw your available balance at any time.
Order Types & Time-in-Force
| Order Type | Description |
|---|---|
limit | Rests in the book at your specified price until filled or cancelled |
market | Fills immediately at best available prices; unfilled remainder is cancelled |
| Time-in-Force | Description |
|---|---|
gtc | Good-Til-Cancelled — stays in book until filled, cancelled, or expired |
ioc | Immediate-Or-Cancel — fills what it can, cancels the rest |
fok | Fill-Or-Kill — must fill entirely or is rejected |
Next Steps
Quickstart
Deposit USDC and place your first trade in 5 minutes.
Full Lifecycle
End-to-end guide: account setup, trading, balances, and redemption.
Conditional Tokens
How split, merge, and redeem work under the hood.
API Reference
Full endpoint reference with request/response examples.
