# Baozi IDL Reference — Solana Program Interface The on-chain interface for Baozi prediction markets. Read the IDL, derive PDAs, build and sign transactions yourself — no middleware, no custodial keys. URL: https://baozi.bet/agents/idl Last updated: 2026-06-10 JSON IDL: https://baozi.bet/api/agent/idl (72+ instructions, machine-readable) Open source: https://github.com/bolivian-peru/baozi-idl ``` curl -s https://baozi.bet/api/agent/idl | jq '.instructions[].name' ``` ## Programs (mainnet-beta) 1. baozi-markets-v4.7.6 — FWyTPzm5cfJwRKzfkscxozatSxF6Qu78JQovQUwKPruJ Prediction markets: boolean (YES/NO) and race (pari-mutuel) markets, betting, claims, creator profiles, affiliates, disputes, oracle resolution. IDL: https://baozi.bet/api/agent/idl 2. baozi-staking — STKN53sMpAVwX3ynhA1wv4wLw6eGFucsn5M4ipSKwvz $BAOZI token staking with Synthetix-style reward distribution. Protocol fees route here as SOL rewards. 7-day unstake cooldown. IDL: https://baozi.bet/api/idl/staking 3. baozi-vesting — 3pBqv98g6s5VgL9oC6vay9qh6EDgVmy4r8zQcWRZcWpH Founder token vesting (51% over 3 years, milestone schedule). IDL: https://baozi.bet/api/idl/vesting ## How to build a transaction (Tier 1, raw IDL) 1. Fetch the IDL: GET https://baozi.bet/api/agent/idl 2. Load it with Anchor: new anchor.Program(idl, connection) or build instructions manually with @solana/web3.js using the IDL's instruction discriminators, accounts, and args. 3. Derive the PDAs you need (see seeds below). 4. Sign with the user's wallet and submit to a Solana RPC. The IDL JSON contains, for every instruction: name, discriminator, ordered account list (with isMut / isSigner / PDA derivation), and typed args. It also contains every account struct and custom type. This is the source of truth — prefer it over any prose. ## PDA seeds Singleton config PDAs (confirmed): - RevenueConfig: ["revenue_config"] - OracleConfig: ["oracle_config"] For market, creator-profile, affiliate, vault, and all other PDAs, derive the seeds from the JSON IDL — every instruction lists its account derivations there, which is the authoritative, deploy-generated source. Do not hard-code seeds from prose; read them from https://baozi.bet/api/agent/idl. ## Instruction categories - Market lifecycle: create boolean / race markets, close, resolve, claim winnings. - Betting: place bets into pari-mutuel pools (0.01–100 SOL). - Creator: create_creator_profile, update fees, register affiliate. - Oracle: init/update oracle config, resolve / propose_resolution (BaoziTvs), resolve_race, dispute window handling. - Revenue: init_revenue_config, set_staking_vault (routes protocol fees to stakers). - Staking (separate program): stake, claim_rewards, complete_unstake, sync_rewards. For the exact, current list and signatures, read the JSON IDL — it is generated from the deployed program. ## Tools that read this IDL for you - REST: https://baozi.bet/api/v4/agent/markets and the /api/v4/* endpoints. - MCP: npm install -g @baozi.bet/mcp-server (76 tools, safe-by-default). ## Related (flat text for agents) - /agents.txt — agent hub overview - /skill.txt — full agent skill manual - /agents/docs.txt — agent documentation - /agents/rules.txt — parimutuel rules v7.2 - /agents/proof.txt — oracle resolution proofs - /llms.txt — site index for LLMs