Skip to main content

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

1

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.
2

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.
3

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).
4

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.
5

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.
6

Redeem Winnings

After market resolution, redeem winning tokens for $1 USDC each directly to your smart wallet.

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 TypeDescription
limitRests in the book at your specified price until filled or cancelled
marketFills immediately at best available prices; unfilled remainder is cancelled
Time-in-ForceDescription
gtcGood-Til-Cancelled — stays in book until filled, cancelled, or expired
iocImmediate-Or-Cancel — fills what it can, cancels the rest
fokFill-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.