Account Model (PDA System)
All market assets are held in program-derived accounts; the market PDA is the sole authority over the vaults and mints.
Each market derives a family of PDAs around its main account: the YES / NO mints, three fund vaults (YES / NO / USDC), the deposit escrow account, plus the dispute account, vote records and DAO proposal used by the dispute flow. At the global level there are trader_info (cross-market user stats), dao_config (DAO configuration) and log_authority (audit-log signer).
The order book is an independent keypair account created by the client and bound to the market, storing the order book data.
Available Book Sizes & Estimated SOL Cost
| Preset | Capacity (bids / asks / seats) | Account size | Est. rent |
|---|---|---|---|
| Small | 512 / 512 / 128 | ≈ 215 KB | ≈ 1.50 SOL |
| Medium | 1024 / 1024 / 128 | ≈ 412 KB | ≈ 2.87 SOL |
| Large | 2048 / 2048 / 128 | ≈ 805 KB | ≈ 5.61 SOL |
| XL | 4096 / 4096 / 128 | ≈ 1.59 MB | ≈ 11.08 SOL |
These are the four frontend presets. At the program level, 12 legal combinations are supported:
| Capacity (bids / asks / seats) | Account size | Est. rent |
|---|---|---|
| 512 / 512 / 128 | ≈ 215 KB | ≈ 1.50 SOL |
| 512 / 512 / 1025 | ≈ 345 KB | ≈ 2.40 SOL |
| 512 / 512 / 1153 | ≈ 363 KB | ≈ 2.53 SOL |
| 1024 / 1024 / 128 | ≈ 412 KB | ≈ 2.87 SOL |
| 1024 / 1024 / 2049 | ≈ 689 KB | ≈ 4.79 SOL |
| 1024 / 1024 / 2177 | ≈ 707 KB | ≈ 4.92 SOL |
| 2048 / 2048 / 128 | ≈ 805 KB | ≈ 5.61 SOL |
| 2048 / 2048 / 4097 | ≈ 1.38 MB | ≈ 9.58 SOL |
| 2048 / 2048 / 4225 | ≈ 1.40 MB | ≈ 9.71 SOL |
| 4096 / 4096 / 128 | ≈ 1.59 MB | ≈ 11.08 SOL |
| 4096 / 4096 / 8193 | ≈ 2.75 MB | ≈ 19.16 SOL |
| 4096 / 4096 / 8321 | ≈ 2.77 MB | ≈ 19.29 SOL |
The rent is paid by the creator and fully refunded once the market is settled, emptied and closed.
Market Account
Key fields:
| Field | Description |
|---|---|
name[64] / url[256] | Market name and IPFS metadata URL |
market_size_params | Order book capacity parameters |
order_book_key | Order book account address |
authority | Creator |
ipfs_hash / market_type | Metadata hash / 10 categories |
expiry_date | Expiry time |
vault_value_usdc | Vault bookkeeping value |
security_deposit_usdc | Creator deposit |
timestamp_recorder | Per-phase timestamps (result submission time, …) |
status / has_dispute / result | State machine fields |
feed_id | Locked oracle feed identifier |
Trader Info
Global PDA, cross-market:
total_order_count,total_volume_usdc,active_order_count,market_count;markets[18]: the 18 most recent markets, each keeping a circular history of the last 20 order IDs.
Once the trader info account is initialized, trading data can be recorded.
Fund Flow Cheat Sheet
wallet ──MintPair──► usdc_vault ──RedeemPair──► wallet
wallet ──NewOrder (locked)──► book seat ──ClaimFunds──► wallet
creator ──CreateMarket──► market_usdc_account (deposit) ──CloseMarket/ClaimDisputeReward──► creator or disputer
disputer/voters ──StartDispute/Vote──► dispute vault ──ClaimVoteReward/ClaimDisputeReward──► winners
Every outbound transfer is signed by the market PDA or dispute PDA.