Skip to main content

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

order_book is not a PDA

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

PresetCapacity (bids / asks / seats)Account sizeEst. rent
Small512 / 512 / 128≈ 215 KB≈ 1.50 SOL
Medium1024 / 1024 / 128≈ 412 KB≈ 2.87 SOL
Large2048 / 2048 / 128≈ 805 KB≈ 5.61 SOL
XL4096 / 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 sizeEst. 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:

FieldDescription
name[64] / url[256]Market name and IPFS metadata URL
market_size_paramsOrder book capacity parameters
order_book_keyOrder book account address
authorityCreator
ipfs_hash / market_typeMetadata hash / 10 categories
expiry_dateExpiry time
vault_value_usdcVault bookkeeping value
security_deposit_usdcCreator deposit
timestamp_recorderPer-phase timestamps (result submission time, …)
status / has_dispute / resultState machine fields
feed_idLocked 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.