{"address":"FWyTPzm5cfJwRKzfkscxozatSxF6Qu78JQovQUwKPruJ","metadata":{"name":"baozi_markets_v4_7_6","version":"0.1.0","spec":"0.1.0","description":"Baozi Markets V4.7.6 - Security Audit Fixes"},"instructions":[{"name":"add_to_race_whitelist","docs":["Add address to Race market whitelist","SECURITY: Only creator can add to whitelist, prevents unauthorized access"],"discriminator":[144,229,112,184,199,39,27,156],"accounts":[{"name":"race_market","pda":{"seeds":[{"kind":"const","value":[114,97,99,101]},{"kind":"account","path":"race_market.market_id","account":"RaceMarket"}]}},{"name":"whitelist","writable":true,"pda":{"seeds":[{"kind":"const","value":[114,97,99,101,95,119,104,105,116,101,108,105,115,116]},{"kind":"account","path":"race_market"}]}},{"name":"creator","signer":true}],"args":[{"name":"address","type":"pubkey"}]},{"name":"add_to_whitelist","docs":["Add address to Private Table whitelist"],"discriminator":[157,211,52,54,144,81,5,55],"accounts":[{"name":"market","pda":{"seeds":[{"kind":"const","value":[109,97,114,107,101,116]},{"kind":"account","path":"market.market_id","account":"Market"}]}},{"name":"whitelist","writable":true,"pda":{"seeds":[{"kind":"const","value":[119,104,105,116,101,108,105,115,116]},{"kind":"account","path":"market.market_id","account":"Market"}]}},{"name":"creator","signer":true}],"args":[{"name":"address","type":"pubkey"}]},{"name":"admin_resolve_dispute","docs":[": Admin escape hatch to resolve disputed markets","This prevents funds from being permanently locked when disputes are raised","Admin can either:","1. Affirm original resolution (affirm=true) - proceed with proposed outcome","2. Override resolution (affirm=false, new_outcome provided) - use new outcome","3. Cancel market (cancel=true) - full refunds to all bettors"],"discriminator":[143,4,85,209,252,216,103,176],"accounts":[{"name":"config","pda":{"seeds":[{"kind":"const","value":[99,111,110,102,105,103]}]}},{"name":"market","writable":true,"pda":{"seeds":[{"kind":"const","value":[109,97,114,107,101,116]},{"kind":"account","path":"market.market_id","account":"Market"}]}},{"name":"dispute_meta","writable":true,"pda":{"seeds":[{"kind":"const","value":[100,105,115,112,117,116,101,95,109,101,116,97]},{"kind":"account","path":"market"}]}},{"name":"admin","signer":true}],"args":[{"name":"affirm","type":"bool"},{"name":"new_outcome","type":{"option":"bool"}},{"name":"cancel","type":"bool"}]},{"name":"admin_resolve_race_dispute","docs":[": Admin escape hatch to resolve disputed race markets","Same as boolean version but for race markets"],"discriminator":[133,87,102,166,207,123,179,154],"accounts":[{"name":"config","pda":{"seeds":[{"kind":"const","value":[99,111,110,102,105,103]}]}},{"name":"race_market","writable":true,"pda":{"seeds":[{"kind":"const","value":[114,97,99,101]},{"kind":"account","path":"race_market.market_id","account":"RaceMarket"}]}},{"name":"dispute_meta","writable":true,"pda":{"seeds":[{"kind":"const","value":[100,105,115,112,117,116,101,95,109,101,116,97]},{"kind":"account","path":"race_market"}]}},{"name":"admin","signer":true}],"args":[{"name":"affirm","type":"bool"},{"name":"new_outcome","type":{"option":"u8"}},{"name":"cancel","type":"bool"}]},{"name":"bet_on_race_outcome_sol","docs":["Bet on a race outcome (multi-outcome betting supported)","","DESIGN: Users can bet on multiple outcomes in the same race market.","This enables hedging strategies while fees prevent guaranteed profit.","","SECURITY:","- Outcome index validated against market.outcome_count","- All math uses checked_add to prevent overflow","- Pool limits enforced per layer","- Whitelist access control for private markets"],"discriminator":[195,181,151,159,105,100,234,244],"accounts":[{"name":"config","pda":{"seeds":[{"kind":"const","value":[99,111,110,102,105,103]}]}},{"name":"race_market","writable":true,"pda":{"seeds":[{"kind":"const","value":[114,97,99,101]},{"kind":"account","path":"race_market.market_id","account":"RaceMarket"}]}},{"name":"position","docs":["User's position in this race (init_if_needed for first bet)"],"writable":true,"pda":{"seeds":[{"kind":"const","value":[114,97,99,101,95,112,111,115,105,116,105,111,110]},{"kind":"account","path":"race_market.market_id","account":"RaceMarket"},{"kind":"account","path":"user"}]}},{"name":"whitelist","docs":["Optional RaceWhitelist for Private Whitelist markets","Uses SEPARATE PDA namespace: [\"race_whitelist\", race_market.key()]","This prevents collision with boolean market whitelists"],"optional":true,"pda":{"seeds":[{"kind":"const","value":[114,97,99,101,95,119,104,105,116,101,108,105,115,116]},{"kind":"account","path":"race_market"}]}},{"name":"user","writable":true,"signer":true},{"name":"system_program","address":"11111111111111111111111111111111"}],"args":[{"name":"outcome_index","type":"u8"},{"name":"amount","type":"u64"}]},{"name":"bet_on_race_outcome_sol_with_affiliate","docs":[": Bet on race outcome with affiliate referral tracking","Creates/updates RaceReferral PDA on first bet (immutable thereafter)","Required for proper affiliate commission attribution during claim"],"discriminator":[26,224,14,181,67,52,24,0],"accounts":[{"name":"config","pda":{"seeds":[{"kind":"const","value":[99,111,110,102,105,103]}]}},{"name":"race_market","writable":true,"pda":{"seeds":[{"kind":"const","value":[114,97,99,101]},{"kind":"account","path":"race_market.market_id","account":"RaceMarket"}]}},{"name":"position","docs":["User's position in this race (init_if_needed for first bet)"],"writable":true,"pda":{"seeds":[{"kind":"const","value":[114,97,99,101,95,112,111,115,105,116,105,111,110]},{"kind":"account","path":"race_market.market_id","account":"RaceMarket"},{"kind":"account","path":"user"}]}},{"name":"affiliate","docs":[": Affiliate account for referral tracking","Owner is recorded in race_referral.referred_by on first bet"],"writable":true,"pda":{"seeds":[{"kind":"const","value":[97,102,102,105,108,105,97,116,101]},{"kind":"account","path":"affiliate.owner","account":"Affiliate"}]}},{"name":"race_referral","docs":["C1: Separate RaceReferral PDA for backward compatibility","This tracks referrals without changing RacePosition size (which would break existing accounts)"],"writable":true,"pda":{"seeds":[{"kind":"const","value":[114,97,99,101,95,114,101,102,101,114,114,97,108]},{"kind":"account","path":"race_market"},{"kind":"account","path":"user"}]}},{"name":"whitelist","docs":["Optional RaceWhitelist for Private Whitelist markets"],"optional":true,"pda":{"seeds":[{"kind":"const","value":[114,97,99,101,95,119,104,105,116,101,108,105,115,116]},{"kind":"account","path":"race_market"}]}},{"name":"user","writable":true,"signer":true},{"name":"system_program","address":"11111111111111111111111111111111"}],"args":[{"name":"outcome_index","type":"u8"},{"name":"amount","type":"u64"}]},{"name":"cancel_market","docs":["Cancel market (admin can cancel any, creator can cancel own Labs/Private with restrictions)","","Harden against creator griefing","Creators of Labs/Private markets can only cancel if:","- No bets have been placed yet (has_bets == false), OR","- Pool is small (< 0.5 SOL for SOL markets, < 100 USDC for USDC markets)","This prevents creators from baiting large pools then cancelling to waste bettor time.","Admin/guardian can always cancel for emergencies."],"discriminator":[205,121,84,210,222,71,150,11],"accounts":[{"name":"config","pda":{"seeds":[{"kind":"const","value":[99,111,110,102,105,103]}]}},{"name":"market","writable":true,"pda":{"seeds":[{"kind":"const","value":[109,97,114,107,101,116]},{"kind":"account","path":"market.market_id","account":"Market"}]}},{"name":"authority","signer":true}],"args":[{"name":"reason","type":"string"}]},{"name":"cancel_race","docs":["Cancel a race market (refunds all bettors)","SECURITY: Authorization enforced based on layer","Harden cancel_race against creator griefing","Same rules as cancel_market: creators can only cancel if pool is small","Admin/guardian can cancel Closed markets (emergency escape hatch)","Added reason parameter and event emission"],"discriminator":[223,214,232,232,43,15,165,234],"accounts":[{"name":"config","pda":{"seeds":[{"kind":"const","value":[99,111,110,102,105,103]}]}},{"name":"race_market","writable":true,"pda":{"seeds":[{"kind":"const","value":[114,97,99,101]},{"kind":"account","path":"race_market.market_id","account":"RaceMarket"}]}},{"name":"authority","docs":["The authority attempting to cancel - checked in instruction based on layer"],"signer":true}],"args":[{"name":"reason","type":"string"}]},{"name":"change_council_vote","docs":["Change a council vote (flip from YES to NO or vice versa)","Security: Only the original voter can change their vote.","Market must not be resolved yet."],"discriminator":[70,96,72,253,134,120,254,76],"accounts":[{"name":"config","pda":{"seeds":[{"kind":"const","value":[99,111,110,102,105,103]}]}},{"name":"market","writable":true,"pda":{"seeds":[{"kind":"const","value":[109,97,114,107,101,116]},{"kind":"account","path":"market.market_id","account":"Market"}]}},{"name":"council_vote","docs":["Existing council vote PDA","SECURITY: Must match the voter's key to prevent unauthorized changes"],"writable":true,"pda":{"seeds":[{"kind":"const","value":[99,111,117,110,99,105,108,95,118,111,116,101]},{"kind":"account","path":"market.market_id","account":"Market"},{"kind":"account","path":"voter"}]}},{"name":"dispute_meta","docs":["DisputeMeta for dispute window support when threshold reached"],"writable":true,"pda":{"seeds":[{"kind":"const","value":[100,105,115,112,117,116,101,95,109,101,116,97]},{"kind":"account","path":"market"}]}},{"name":"voter","docs":["The original voter changing their vote"],"writable":true,"signer":true},{"name":"system_program","address":"11111111111111111111111111111111"}],"args":[{"name":"new_vote","type":"bool"}]},{"name":"change_council_vote_race","docs":["Council member changes their vote on race market","SECURITY:","- Only existing voters can change vote","- Must still be council member","- Market must still be in Closed state (not resolved)","- Properly decrements old vote, increments new vote"],"discriminator":[54,185,210,126,40,252,146,6],"accounts":[{"name":"config","pda":{"seeds":[{"kind":"const","value":[99,111,110,102,105,103]}]}},{"name":"race_market","writable":true,"pda":{"seeds":[{"kind":"const","value":[114,97,99,101]},{"kind":"account","path":"race_market.market_id","account":"RaceMarket"}]}},{"name":"vote_record","docs":["Existing vote record"],"writable":true,"pda":{"seeds":[{"kind":"const","value":[114,97,99,101,95,99,111,117,110,99,105,108,95,118,111,116,101]},{"kind":"account","path":"race_market"},{"kind":"account","path":"voter"}]}},{"name":"dispute_meta","docs":["DisputeMeta for dispute window support when threshold reached"],"writable":true,"pda":{"seeds":[{"kind":"const","value":[100,105,115,112,117,116,101,95,109,101,116,97]},{"kind":"account","path":"race_market"}]}},{"name":"voter","writable":true,"signer":true},{"name":"system_program","address":"11111111111111111111111111111111"}],"args":[{"name":"new_outcome_vote","type":"u8"}]},{"name":"change_creator_reputation_vote","docs":["Change a reputation vote (flip from +1 to -1 or vice versa)","Security: Only the original voter can change their vote"],"discriminator":[150,172,252,214,155,23,124,7],"accounts":[{"name":"config","pda":{"seeds":[{"kind":"const","value":[99,111,110,102,105,103]}]}},{"name":"creator_reputation","docs":["Creator reputation account"],"writable":true,"pda":{"seeds":[{"kind":"const","value":[99,114,101,97,116,111,114,95,114,101,112]},{"kind":"account","path":"reputation_vote.creator","account":"ReputationVote"}]}},{"name":"reputation_vote","docs":["Existing reputation vote record","SECURITY: Must match the voter's key to prevent unauthorized changes"],"writable":true,"pda":{"seeds":[{"kind":"const","value":[114,101,112,95,118,111,116,101]},{"kind":"account","path":"voter"},{"kind":"account","path":"reputation_vote.creator","account":"ReputationVote"},{"kind":"account","path":"reputation_vote.market_id","account":"ReputationVote"}]}},{"name":"voter","docs":["The original voter changing their vote"],"writable":true,"signer":true}],"args":[{"name":"new_vote","type":"i8"}]},{"name":"claim_affiliate_sol","docs":["Claim affiliate earnings (SOL)","Uses SolTreasury PDA which the program can sign for"],"discriminator":[125,18,164,112,216,207,197,201],"accounts":[{"name":"config","pda":{"seeds":[{"kind":"const","value":[99,111,110,102,105,103]}]}},{"name":"affiliate","writable":true,"pda":{"seeds":[{"kind":"const","value":[97,102,102,105,108,105,97,116,101]},{"kind":"account","path":"owner"}]}},{"name":"sol_treasury","docs":["SOL Treasury PDA - program-controlled for signing lamport transfers"],"writable":true,"pda":{"seeds":[{"kind":"const","value":[115,111,108,95,116,114,101,97,115,117,114,121]}]}},{"name":"owner","writable":true,"signer":true},{"name":"system_program","address":"11111111111111111111111111111111"}],"args":[]},{"name":"claim_creator_sol","docs":["Claim creator earnings (SOL)","Uses SolTreasury PDA which the program can sign for"],"discriminator":[21,25,164,47,81,156,199,103],"accounts":[{"name":"creator_profile","writable":true,"pda":{"seeds":[{"kind":"const","value":[99,114,101,97,116,111,114,95,112,114,111,102,105,108,101]},{"kind":"account","path":"owner"}]}},{"name":"sol_treasury","docs":["SOL Treasury PDA - program-controlled for signing lamport transfers"],"writable":true,"pda":{"seeds":[{"kind":"const","value":[115,111,108,95,116,114,101,97,115,117,114,121]}]}},{"name":"owner","writable":true,"signer":true},{"name":"system_program","address":"11111111111111111111111111111111"}],"args":[]},{"name":"claim_race_refund","docs":["Claim refund from a cancelled race market (multi-outcome betting supported)","","DESIGN: With multi-outcome betting, refund returns ALL bets across all outcomes.","total_bet tracks the sum of all bets for exactly this purpose.","","SECURITY:","- Refunds entire total_bet (sum of all outcome bets)","- claimed flag prevents double-claiming","DISPUTE SYSTEM: Finality gate - refunds ONLY allowed when status == Cancelled"],"discriminator":[174,101,101,227,171,69,173,243],"accounts":[{"name":"race_market","writable":true,"pda":{"seeds":[{"kind":"const","value":[114,97,99,101]},{"kind":"account","path":"race_market.market_id","account":"RaceMarket"}]}},{"name":"position","writable":true,"pda":{"seeds":[{"kind":"const","value":[114,97,99,101,95,112,111,115,105,116,105,111,110]},{"kind":"account","path":"race_market.market_id","account":"RaceMarket"},{"kind":"account","path":"user"}]}},{"name":"user","writable":true,"signer":true},{"name":"system_program","address":"11111111111111111111111111111111"}],"args":[]},{"name":"claim_race_winnings_sol","docs":["Claim winnings from a resolved race market (multi-outcome betting supported)","","DESIGN: With multi-outcome betting, user may have bet on winning outcome even if","they also bet on other outcomes. Only the winning outcome bet pays out.","","SECURITY:","- Only pays out bet on winning outcome (other bets are lost)","- Fee accounting mirrors boolean markets - all fees go to treasury","- claimed flag prevents double-claiming entire position","DISPUTE SYSTEM: Finality gate - claims ONLY allowed when status == Resolved"],"discriminator":[46,120,202,194,126,72,22,52],"accounts":[{"name":"config","pda":{"seeds":[{"kind":"const","value":[99,111,110,102,105,103]}]}},{"name":"race_market","writable":true,"pda":{"seeds":[{"kind":"const","value":[114,97,99,101]},{"kind":"account","path":"race_market.market_id","account":"RaceMarket"}]}},{"name":"position","writable":true,"pda":{"seeds":[{"kind":"const","value":[114,97,99,101,95,112,111,115,105,116,105,111,110]},{"kind":"account","path":"race_market.market_id","account":"RaceMarket"},{"kind":"account","path":"user"}]}},{"name":"sol_treasury","docs":["SOL Treasury PDA receives protocol fees"],"writable":true,"pda":{"seeds":[{"kind":"const","value":[115,111,108,95,116,114,101,97,115,117,114,121]}]}},{"name":"affiliate","docs":["Optional affiliate account to credit affiliate share at claim time","Must match race_referral.referred_by if applicable"],"writable":true,"optional":true,"pda":{"seeds":[{"kind":"const","value":[97,102,102,105,108,105,97,116,101]},{"kind":"account","path":"affiliate.owner","account":"Affiliate"}]}},{"name":"race_referral","docs":["C1: Optional RaceReferral PDA for referral validation","Used instead of position.referred_by to maintain backward compatibility","Seeds: [\"race_referral\", race_market.key(), user.key()]"],"optional":true,"pda":{"seeds":[{"kind":"const","value":[114,97,99,101,95,114,101,102,101,114,114,97,108]},{"kind":"account","path":"race_market"},{"kind":"account","path":"user"}]}},{"name":"creator_profile","docs":["Optional creator profile for fee crediting"],"writable":true,"optional":true,"pda":{"seeds":[{"kind":"const","value":[99,114,101,97,116,111,114,95,112,114,111,102,105,108,101]},{"kind":"account","path":"creator_profile.owner","account":"CreatorProfile"}]}},{"name":"revenue_config","docs":["Optional: Revenue config for $BAOZI staking integration","If provided and is_active, protocol_share is routed to staking_vault"],"writable":true,"optional":true,"pda":{"seeds":[{"kind":"const","value":[114,101,118,101,110,117,101,95,99,111,110,102,105,103]}]}},{"name":"staking_vault","docs":["Optional: Staking reward vault to receive protocol_share"],"writable":true,"optional":true},{"name":"user","writable":true,"signer":true},{"name":"system_program","address":"11111111111111111111111111111111"}],"args":[]},{"name":"claim_refund_sol","docs":["Claim refund from a cancelled SOL market","DISPUTE SYSTEM: Finality gate - refunds ONLY allowed when status == Cancelled"],"discriminator":[8,82,5,144,194,114,255,20],"accounts":[{"name":"market","writable":true,"pda":{"seeds":[{"kind":"const","value":[109,97,114,107,101,116]},{"kind":"account","path":"market.market_id","account":"Market"}]}},{"name":"position","writable":true,"pda":{"seeds":[{"kind":"const","value":[112,111,115,105,116,105,111,110]},{"kind":"account","path":"market.market_id","account":"Market"},{"kind":"account","path":"user"}]}},{"name":"user","writable":true,"signer":true},{"name":"system_program","address":"11111111111111111111111111111111"}],"args":[]},{"name":"claim_winnings_sol","docs":["Claim winnings from a resolved SOL market","H-1 FIX: Platform fee is now split into affiliate_share, creator_share, and protocol_share","at claim time. This ensures pending balances are always backed by treasury.","","DISPUTE SYSTEM: Finality gate - claims ONLY allowed when status == Resolved","ResolvedPending and Disputed markets block claims until finalized/verdict delivered."],"discriminator":[64,158,207,116,128,129,169,76],"accounts":[{"name":"config","pda":{"seeds":[{"kind":"const","value":[99,111,110,102,105,103]}]}},{"name":"market","writable":true,"pda":{"seeds":[{"kind":"const","value":[109,97,114,107,101,116]},{"kind":"account","path":"market.market_id","account":"Market"}]}},{"name":"position","writable":true,"pda":{"seeds":[{"kind":"const","value":[112,111,115,105,116,105,111,110]},{"kind":"account","path":"market.market_id","account":"Market"},{"kind":"account","path":"user"}]}},{"name":"sol_treasury","docs":["SOL Treasury PDA receives platform fees for later payout to affiliates/creators"],"writable":true,"pda":{"seeds":[{"kind":"const","value":[115,111,108,95,116,114,101,97,115,117,114,121]}]}},{"name":"affiliate","docs":["H-1 FIX: Optional affiliate account to credit affiliate share at claim time","Must match position.referred_by if provided"],"writable":true,"optional":true,"pda":{"seeds":[{"kind":"const","value":[97,102,102,105,108,105,97,116,101]},{"kind":"account","path":"affiliate.owner","account":"Affiliate"}]}},{"name":"creator_profile","docs":["H-1 FIX: Optional creator profile to credit creator share at claim time","Must match market.creator_profile if provided"],"writable":true,"optional":true,"pda":{"seeds":[{"kind":"const","value":[99,114,101,97,116,111,114,95,112,114,111,102,105,108,101]},{"kind":"account","path":"creator_profile.owner","account":"CreatorProfile"}]}},{"name":"revenue_config","docs":["Optional: Revenue config for $BAOZI staking integration","If provided and is_active, protocol_share is routed to staking_vault"],"writable":true,"optional":true,"pda":{"seeds":[{"kind":"const","value":[114,101,118,101,110,117,101,95,99,111,110,102,105,103]}]}},{"name":"staking_vault","docs":["Optional: Staking reward vault to receive protocol_share"],"writable":true,"optional":true},{"name":"user","writable":true,"signer":true},{"name":"system_program","address":"11111111111111111111111111111111"}],"args":[]},{"name":"close_market","docs":["Close market and take snapshot (auto-triggered or manual)"],"discriminator":[88,154,248,186,48,14,123,244],"accounts":[{"name":"config","docs":["GlobalConfig needed for configurable betting_freeze_seconds"],"pda":{"seeds":[{"kind":"const","value":[99,111,110,102,105,103]}]}},{"name":"market","writable":true,"pda":{"seeds":[{"kind":"const","value":[109,97,114,107,101,116]},{"kind":"account","path":"market.market_id","account":"Market"}]}},{"name":"anyone","signer":true}],"args":[]},{"name":"close_race_market","docs":["Close a race market and take snapshot (like boolean markets)","Anyone can call this after closing_time to transition market to Closed state","This allows betting to stop and snapshot to be taken for payout calculations"],"discriminator":[39,189,166,118,134,37,102,41],"accounts":[{"name":"config","docs":["GlobalConfig needed for configurable betting_freeze_seconds"],"pda":{"seeds":[{"kind":"const","value":[99,111,110,102,105,103]}]}},{"name":"race_market","writable":true,"pda":{"seeds":[{"kind":"const","value":[114,97,99,101]},{"kind":"account","path":"race_market.market_id","account":"RaceMarket"}]}},{"name":"anyone","signer":true}],"args":[]},{"name":"create_creator_profile","docs":["Create a creator profile with optional display name and fee settings","Seeds: [\"creator_profile\", owner.pubkey]"],"discriminator":[139,244,127,145,95,172,140,154],"accounts":[{"name":"creator_profile","writable":true,"pda":{"seeds":[{"kind":"const","value":[99,114,101,97,116,111,114,95,112,114,111,102,105,108,101]},{"kind":"account","path":"owner"}]}},{"name":"owner","writable":true,"signer":true},{"name":"system_program","address":"11111111111111111111111111111111"}],"args":[{"name":"display_name","type":"string"},{"name":"default_fee_bps","type":"u16"}]},{"name":"create_lab_market_sol","docs":["Create a Lab SOL market (anyone can create, HostOracle or CouncilOracle resolution)","Added council support for consistency with Lab race markets"],"discriminator":[35,159,50,67,31,134,199,157],"accounts":[{"name":"config","writable":true,"pda":{"seeds":[{"kind":"const","value":[99,111,110,102,105,103]}]}},{"name":"market","writable":true,"pda":{"seeds":[{"kind":"const","value":[109,97,114,107,101,116]},{"kind":"account","path":"config.market_count","account":"GlobalConfig"}]}},{"name":"treasury","writable":true},{"name":"creator","writable":true,"signer":true},{"name":"creator_profile","docs":["Optional: Creator's profile for fee settings","If provided, market will use creator's default_creator_fee_bps"],"writable":true,"optional":true,"pda":{"seeds":[{"kind":"const","value":[99,114,101,97,116,111,114,95,112,114,111,102,105,108,101]},{"kind":"account","path":"creator"}]}},{"name":"system_program","address":"11111111111111111111111111111111"}],"args":[{"name":"question","type":"string"},{"name":"closing_time","type":"i64"},{"name":"resolution_buffer","type":"i64"},{"name":"auto_stop_buffer","type":"i64"},{"name":"resolution_mode","type":"u8"},{"name":"council","type":{"vec":"pubkey"}},{"name":"council_threshold","type":"u8"}]},{"name":"create_market_sol","docs":["Create an Official SOL market (admin/guardian only)"],"discriminator":[135,142,75,239,32,220,235,73],"accounts":[{"name":"config","writable":true,"pda":{"seeds":[{"kind":"const","value":[99,111,110,102,105,103]}]}},{"name":"market","writable":true,"pda":{"seeds":[{"kind":"const","value":[109,97,114,107,101,116]},{"kind":"account","path":"config.market_count","account":"GlobalConfig"}]}},{"name":"treasury","writable":true},{"name":"creator","writable":true,"signer":true},{"name":"system_program","address":"11111111111111111111111111111111"}],"args":[{"name":"question","type":"string"},{"name":"closing_time","type":"i64"},{"name":"resolution_buffer","type":"i64"},{"name":"auto_stop_buffer","type":"i64"}]},{"name":"create_private_table_sol","docs":["Create a Lab USDC market","Create a Private Table SOL market (whitelist access, custom resolution)"],"discriminator":[242,241,183,108,35,183,38,241],"accounts":[{"name":"config","writable":true,"pda":{"seeds":[{"kind":"const","value":[99,111,110,102,105,103]}]}},{"name":"market","writable":true,"pda":{"seeds":[{"kind":"const","value":[109,97,114,107,101,116]},{"kind":"account","path":"config.market_count","account":"GlobalConfig"}]}},{"name":"whitelist","writable":true,"pda":{"seeds":[{"kind":"const","value":[119,104,105,116,101,108,105,115,116]},{"kind":"account","path":"config.market_count","account":"GlobalConfig"}]}},{"name":"treasury","writable":true},{"name":"creator","writable":true,"signer":true},{"name":"creator_profile","docs":["Optional: Creator's profile for fee settings","If provided, market will use creator's default_creator_fee_bps"],"writable":true,"optional":true,"pda":{"seeds":[{"kind":"const","value":[99,114,101,97,116,111,114,95,112,114,111,102,105,108,101]},{"kind":"account","path":"creator"}]}},{"name":"system_program","address":"11111111111111111111111111111111"}],"args":[{"name":"question","type":"string"},{"name":"closing_time","type":"i64"},{"name":"resolution_buffer","type":"i64"},{"name":"auto_stop_buffer","type":"i64"},{"name":"resolution_mode","type":"u8"},{"name":"council","type":{"vec":"pubkey"}},{"name":"council_threshold","type":"u8"}]},{"name":"create_race_market_sol","docs":["Create a race market (multi-outcome single pool, horse-racing style)","Supports both Lab and Private layers"],"discriminator":[94,237,40,47,63,233,25,67],"accounts":[{"name":"config","writable":true,"pda":{"seeds":[{"kind":"const","value":[99,111,110,102,105,103]}]}},{"name":"race_market","writable":true,"pda":{"seeds":[{"kind":"const","value":[114,97,99,101]},{"kind":"account","path":"config.market_count","account":"GlobalConfig"}]}},{"name":"creator_profile","docs":["Optional creator profile for fee customization"],"optional":true,"pda":{"seeds":[{"kind":"const","value":[99,114,101,97,116,111,114,95,112,114,111,102,105,108,101]},{"kind":"account","path":"creator"}]}},{"name":"treasury","writable":true},{"name":"creator","writable":true,"signer":true},{"name":"system_program","address":"11111111111111111111111111111111"}],"args":[{"name":"question","type":"string"},{"name":"outcome_labels","type":{"vec":"string"}},{"name":"closing_time","type":"i64"},{"name":"resolution_buffer","type":"i64"},{"name":"auto_stop_buffer","type":"i64"},{"name":"layer","type":{"defined":{"name":"MarketLayer"}}},{"name":"resolution_mode","type":{"defined":{"name":"ResolutionMode"}}},{"name":"access_gate","type":{"defined":{"name":"AccessGate"}}},{"name":"council","type":{"option":{"vec":"pubkey"}}},{"name":"council_threshold","type":{"option":"u8"}}]},{"name":"create_race_whitelist","docs":["Create a whitelist for a Private race market with AccessGate::Whitelist","SECURITY: Uses separate PDA namespace [\"race_whitelist\", race_market.key()] to prevent collision","with boolean market whitelists which use [\"whitelist\", market_id]"],"discriminator":[236,103,41,9,152,23,229,58],"accounts":[{"name":"race_market","pda":{"seeds":[{"kind":"const","value":[114,97,99,101]},{"kind":"account","path":"race_market.market_id","account":"RaceMarket"}]}},{"name":"whitelist","docs":["RaceWhitelist uses race_market.key() as seed to prevent PDA collision"],"writable":true,"pda":{"seeds":[{"kind":"const","value":[114,97,99,101,95,119,104,105,116,101,108,105,115,116]},{"kind":"account","path":"race_market"}]}},{"name":"creator","writable":true,"signer":true},{"name":"system_program","address":"11111111111111111111111111111111"}],"args":[]},{"name":"extend_market","docs":["Extend market times (admin only, with safety limits)"],"discriminator":[105,89,206,205,57,31,153,252],"accounts":[{"name":"config","pda":{"seeds":[{"kind":"const","value":[99,111,110,102,105,103]}]}},{"name":"market","writable":true,"pda":{"seeds":[{"kind":"const","value":[109,97,114,107,101,116]},{"kind":"account","path":"market.market_id","account":"Market"}]}},{"name":"admin","signer":true}],"args":[{"name":"new_closing_time","type":"i64"},{"name":"new_resolution_time","type":"i64"}]},{"name":"extend_race_market","docs":["Extend race market times (admin only, with safety limits)","Same logic as extend_market but for RaceMarket"],"discriminator":[242,176,227,152,79,116,110,168],"accounts":[{"name":"config","pda":{"seeds":[{"kind":"const","value":[99,111,110,102,105,103]}]}},{"name":"race_market","writable":true,"pda":{"seeds":[{"kind":"const","value":[114,97,99,101]},{"kind":"account","path":"race_market.market_id","account":"RaceMarket"}]}},{"name":"admin","signer":true}],"args":[{"name":"new_closing_time","type":"i64"},{"name":"new_resolution_time","type":"i64"}]},{"name":"finalize_race_resolution","docs":["Finalize race resolution after challenge window ends","Anyone can call after challenge_ends_at"],"discriminator":[19,232,81,138,191,218,54,200],"accounts":[{"name":"race_market","writable":true,"pda":{"seeds":[{"kind":"const","value":[114,97,99,101]},{"kind":"account","path":"race_market.market_id","account":"RaceMarket"}]}},{"name":"dispute_meta","writable":true,"pda":{"seeds":[{"kind":"const","value":[100,105,115,112,117,116,101,95,109,101,116,97]},{"kind":"account","path":"race_market"}]}},{"name":"finalizer","signer":true}],"args":[]},{"name":"finalize_resolution","docs":["Finalize resolution after challenge window ends (boolean market)","Anyone can call after challenge_ends_at - permissionless finalization"],"discriminator":[191,74,94,214,45,150,152,125],"accounts":[{"name":"market","writable":true,"pda":{"seeds":[{"kind":"const","value":[109,97,114,107,101,116]},{"kind":"account","path":"market.market_id","account":"Market"}]}},{"name":"dispute_meta","writable":true,"pda":{"seeds":[{"kind":"const","value":[100,105,115,112,117,116,101,95,109,101,116,97]},{"kind":"account","path":"market"}]}},{"name":"finalizer","docs":["Anyone can finalize after challenge window"],"signer":true}],"args":[]},{"name":"flag_dispute","docs":["Flag a dispute during challenge window (boolean market)","STUB: Admin-only for now. Future: permissionless with dispute case validation"],"discriminator":[150,222,78,72,117,140,2,75],"accounts":[{"name":"config","pda":{"seeds":[{"kind":"const","value":[99,111,110,102,105,103]}]}},{"name":"market","writable":true,"pda":{"seeds":[{"kind":"const","value":[109,97,114,107,101,116]},{"kind":"account","path":"market.market_id","account":"Market"}]}},{"name":"dispute_meta","writable":true,"pda":{"seeds":[{"kind":"const","value":[100,105,115,112,117,116,101,95,109,101,116,97]},{"kind":"account","path":"market"}]}},{"name":"authority","signer":true}],"args":[{"name":"dispute_case","type":"pubkey"}]},{"name":"flag_race_dispute","docs":["Flag a dispute during challenge window (race market)","STUB: Admin-only for now"],"discriminator":[154,160,110,29,65,3,77,7],"accounts":[{"name":"config","pda":{"seeds":[{"kind":"const","value":[99,111,110,102,105,103]}]}},{"name":"race_market","writable":true,"pda":{"seeds":[{"kind":"const","value":[114,97,99,101]},{"kind":"account","path":"race_market.market_id","account":"RaceMarket"}]}},{"name":"dispute_meta","writable":true,"pda":{"seeds":[{"kind":"const","value":[100,105,115,112,117,116,101,95,109,101,116,97]},{"kind":"account","path":"race_market"}]}},{"name":"authority","signer":true}],"args":[{"name":"dispute_case","type":"pubkey"}]},{"name":"grant_affiliate_bonus_sol","docs":["Admin: Grant extra SOL bonus to an affiliate from the affiliate bonus budget.","This only increases pending_sol - actual transfer happens when affiliate claims.","Ensures treasury has enough lamports to pay.","Check sol_treasury PDA instead of system treasury","Added defense-in-depth auth check"],"discriminator":[110,235,194,198,69,247,186,240],"accounts":[{"name":"config","writable":true,"pda":{"seeds":[{"kind":"const","value":[99,111,110,102,105,103]}]}},{"name":"affiliate","writable":true,"pda":{"seeds":[{"kind":"const","value":[97,102,102,105,108,105,97,116,101]},{"kind":"account","path":"affiliate.owner","account":"Affiliate"}]}},{"name":"sol_treasury","docs":["SOL Treasury PDA that actually pays bonuses"],"pda":{"seeds":[{"kind":"const","value":[115,111,108,95,116,114,101,97,115,117,114,121]}]}},{"name":"admin","signer":true}],"args":[{"name":"amount","type":"u64"}]},{"name":"init_oracle_config","docs":["Initialize oracle config PDA. Admin-only.","Sets the universal oracle key that can resolve any market."],"discriminator":[77,144,180,246,217,15,118,92],"accounts":[{"name":"config","pda":{"seeds":[{"kind":"const","value":[99,111,110,102,105,103]}]}},{"name":"oracle_config","writable":true,"pda":{"seeds":[{"kind":"const","value":[111,114,97,99,108,101,95,99,111,110,102,105,103]}]}},{"name":"admin","writable":true,"signer":true},{"name":"system_program","address":"11111111111111111111111111111111"}],"args":[{"name":"oracle","type":"pubkey"}]},{"name":"init_revenue_config","docs":["Initialize the revenue configuration for routing protocol fees to staking.","Must be called once after protocol initialization.","","DESIGN: This enables protocol_share from claims to be routed to a staking","reward vault, allowing $BAOZI token holders to earn a share of protocol fees."],"discriminator":[220,130,186,12,124,48,112,220],"accounts":[{"name":"config","pda":{"seeds":[{"kind":"const","value":[99,111,110,102,105,103]}]}},{"name":"revenue_config","writable":true,"pda":{"seeds":[{"kind":"const","value":[114,101,118,101,110,117,101,95,99,111,110,102,105,103]}]}},{"name":"admin","writable":true,"signer":true},{"name":"system_program","address":"11111111111111111111111111111111"}],"args":[]},{"name":"init_sol_treasury","docs":["Initialize the SOL treasury PDA","This PDA holds SOL fees that will be paid out to affiliates and creators.","Must be called once after protocol initialization.","","SECURITY: The SolTreasury PDA is program-controlled, allowing the program","to sign for lamport transfers when affiliates/creators claim their earnings.","This fixes the critical bug where the protocol tried to debit from a system","wallet which programs cannot sign for."],"discriminator":[135,74,108,88,30,24,112,87],"accounts":[{"name":"config","pda":{"seeds":[{"kind":"const","value":[99,111,110,102,105,103]}]}},{"name":"sol_treasury","writable":true,"pda":{"seeds":[{"kind":"const","value":[115,111,108,95,116,114,101,97,115,117,114,121]}]}},{"name":"admin","writable":true,"signer":true},{"name":"system_program","address":"11111111111111111111111111111111"}],"args":[]},{"name":"initialize","discriminator":[175,175,109,31,13,152,155,237],"accounts":[{"name":"config","writable":true,"pda":{"seeds":[{"kind":"const","value":[99,111,110,102,105,103]}]}},{"name":"payer","writable":true,"signer":true},{"name":"system_program","address":"11111111111111111111111111111111"}],"args":[{"name":"creation_fee_sol","type":"u64"},{"name":"market_bond_sol","type":"u64"},{"name":"platform_fee_bps","type":"u16"}]},{"name":"pause_market","docs":["Create an Official USDC market (admin/guardian only)","Pause/unpause a market (admin or guardian)","Prevent resurrecting Closed/Resolved/Cancelled markets","Only Active markets can be paused, only Paused markets can be unpaused"],"discriminator":[216,238,4,164,65,11,162,91],"accounts":[{"name":"config","pda":{"seeds":[{"kind":"const","value":[99,111,110,102,105,103]}]}},{"name":"market","writable":true,"pda":{"seeds":[{"kind":"const","value":[109,97,114,107,101,116]},{"kind":"account","path":"market.market_id","account":"Market"}]}},{"name":"authority","signer":true}],"args":[{"name":"paused","type":"bool"}]},{"name":"pause_protocol","discriminator":[144,95,0,107,119,39,248,141],"accounts":[{"name":"config","writable":true,"pda":{"seeds":[{"kind":"const","value":[99,111,110,102,105,103]}]}},{"name":"authority","signer":true}],"args":[{"name":"paused","type":"bool"}]},{"name":"place_bet_sol","docs":["Place a bet on a SOL market (with optional affiliate)"],"discriminator":[137,137,247,253,233,243,48,170],"accounts":[{"name":"config","pda":{"seeds":[{"kind":"const","value":[99,111,110,102,105,103]}]}},{"name":"market","writable":true,"pda":{"seeds":[{"kind":"const","value":[109,97,114,107,101,116]},{"kind":"account","path":"market.market_id","account":"Market"}]}},{"name":"position","writable":true,"pda":{"seeds":[{"kind":"const","value":[112,111,115,105,116,105,111,110]},{"kind":"account","path":"market.market_id","account":"Market"},{"kind":"account","path":"user"}]}},{"name":"whitelist","docs":["Optional whitelist account - required for Private markets with Whitelist access gate"],"optional":true,"pda":{"seeds":[{"kind":"const","value":[119,104,105,116,101,108,105,115,116]},{"kind":"account","path":"market.market_id","account":"Market"}]}},{"name":"user","writable":true,"signer":true},{"name":"system_program","address":"11111111111111111111111111111111"}],"args":[{"name":"outcome","type":"bool"},{"name":"amount","type":"u64"}]},{"name":"place_bet_sol_with_affiliate","docs":["Place a bet on a SOL market with affiliate attribution"],"discriminator":[197,186,187,145,252,239,101,96],"accounts":[{"name":"config","pda":{"seeds":[{"kind":"const","value":[99,111,110,102,105,103]}]}},{"name":"market","writable":true,"pda":{"seeds":[{"kind":"const","value":[109,97,114,107,101,116]},{"kind":"account","path":"market.market_id","account":"Market"}]}},{"name":"position","writable":true,"pda":{"seeds":[{"kind":"const","value":[112,111,115,105,116,105,111,110]},{"kind":"account","path":"market.market_id","account":"Market"},{"kind":"account","path":"user"}]}},{"name":"affiliate","writable":true,"pda":{"seeds":[{"kind":"const","value":[97,102,102,105,108,105,97,116,101]},{"kind":"account","path":"affiliate.owner","account":"Affiliate"}]}},{"name":"referred_user","writable":true,"pda":{"seeds":[{"kind":"const","value":[114,101,102,101,114,114,101,100]},{"kind":"account","path":"user"}]}},{"name":"whitelist","docs":["Optional whitelist account - required for Private markets with Whitelist access gate"],"optional":true,"pda":{"seeds":[{"kind":"const","value":[119,104,105,116,101,108,105,115,116]},{"kind":"account","path":"market.market_id","account":"Market"}]}},{"name":"user","writable":true,"signer":true},{"name":"system_program","address":"11111111111111111111111111111111"}],"args":[{"name":"outcome","type":"bool"},{"name":"amount","type":"u64"}]},{"name":"propose_race_resolution","docs":["Propose resolution for race market","If disputes disabled or window == 0, immediately finalizes (backward compat)"],"discriminator":[14,204,17,188,243,49,107,255],"accounts":[{"name":"config","pda":{"seeds":[{"kind":"const","value":[99,111,110,102,105,103]}]}},{"name":"race_market","writable":true,"pda":{"seeds":[{"kind":"const","value":[114,97,99,101]},{"kind":"account","path":"race_market.market_id","account":"RaceMarket"}]}},{"name":"dispute_meta","writable":true,"pda":{"seeds":[{"kind":"const","value":[100,105,115,112,117,116,101,95,109,101,116,97]},{"kind":"account","path":"race_market"}]}},{"name":"resolver","writable":true,"signer":true},{"name":"system_program","address":"11111111111111111111111111111111"}],"args":[{"name":"winning_outcome","type":"u8"}]},{"name":"propose_resolution","docs":["Propose resolution for BaoziTvs boolean market (admin/guardian)","If disputes disabled or window == 0, immediately finalizes (backward compat)","Otherwise sets ResolvedPending and creates DisputeMeta"],"discriminator":[19,68,181,23,194,146,152,252],"accounts":[{"name":"config","pda":{"seeds":[{"kind":"const","value":[99,111,110,102,105,103]}]}},{"name":"market","writable":true,"pda":{"seeds":[{"kind":"const","value":[109,97,114,107,101,116]},{"kind":"account","path":"market.market_id","account":"Market"}]}},{"name":"dispute_meta","docs":["DisputeMeta PDA - created lazily when disputes enabled","Seeds: [\"dispute_meta\", market_key]"],"writable":true,"pda":{"seeds":[{"kind":"const","value":[100,105,115,112,117,116,101,95,109,101,116,97]},{"kind":"account","path":"market"}]}},{"name":"authority","writable":true,"signer":true},{"name":"system_program","address":"11111111111111111111111111111111"}],"args":[{"name":"winning_outcome","type":"bool"}]},{"name":"propose_resolution_host","docs":["Propose resolution for HostOracle boolean market (creator resolves)","Same dispute logic as propose_resolution"],"discriminator":[116,231,75,185,127,129,46,124],"accounts":[{"name":"config","pda":{"seeds":[{"kind":"const","value":[99,111,110,102,105,103]}]}},{"name":"market","writable":true,"pda":{"seeds":[{"kind":"const","value":[109,97,114,107,101,116]},{"kind":"account","path":"market.market_id","account":"Market"}]}},{"name":"dispute_meta","writable":true,"pda":{"seeds":[{"kind":"const","value":[100,105,115,112,117,116,101,95,109,101,116,97]},{"kind":"account","path":"market"}]}},{"name":"host","writable":true,"signer":true},{"name":"system_program","address":"11111111111111111111111111111111"}],"args":[{"name":"winning_outcome","type":"bool"}]},{"name":"register_affiliate","docs":["Register as an affiliate"],"discriminator":[87,121,99,184,126,63,103,217],"accounts":[{"name":"config","pda":{"seeds":[{"kind":"const","value":[99,111,110,102,105,103]}]}},{"name":"affiliate","writable":true,"pda":{"seeds":[{"kind":"const","value":[97,102,102,105,108,105,97,116,101]},{"kind":"account","path":"owner"}]}},{"name":"owner","writable":true,"signer":true},{"name":"system_program","address":"11111111111111111111111111111111"}],"args":[{"name":"code","type":"string"}]},{"name":"remove_from_race_whitelist","docs":["Remove address from Race market whitelist","SECURITY: Only creator can remove from whitelist"],"discriminator":[150,136,17,158,48,19,39,232],"accounts":[{"name":"race_market","pda":{"seeds":[{"kind":"const","value":[114,97,99,101]},{"kind":"account","path":"race_market.market_id","account":"RaceMarket"}]}},{"name":"whitelist","writable":true,"pda":{"seeds":[{"kind":"const","value":[114,97,99,101,95,119,104,105,116,101,108,105,115,116]},{"kind":"account","path":"race_market"}]}},{"name":"creator","signer":true}],"args":[{"name":"address","type":"pubkey"}]},{"name":"remove_from_whitelist","docs":["Remove address from Private Table whitelist"],"discriminator":[7,144,216,239,243,236,193,235],"accounts":[{"name":"market","pda":{"seeds":[{"kind":"const","value":[109,97,114,107,101,116]},{"kind":"account","path":"market.market_id","account":"Market"}]}},{"name":"whitelist","writable":true,"pda":{"seeds":[{"kind":"const","value":[119,104,105,116,101,108,105,115,116]},{"kind":"account","path":"market.market_id","account":"Market"}]}},{"name":"creator","signer":true}],"args":[{"name":"address","type":"pubkey"}]},{"name":"resolve_market","docs":["Resolve market - BaoziTvs mode (admin/guardian only, for Official markets)"],"discriminator":[155,23,80,173,46,74,23,239],"accounts":[{"name":"config","pda":{"seeds":[{"kind":"const","value":[99,111,110,102,105,103]}]}},{"name":"market","writable":true,"pda":{"seeds":[{"kind":"const","value":[109,97,114,107,101,116]},{"kind":"account","path":"market.market_id","account":"Market"}]}},{"name":"authority","signer":true}],"args":[{"name":"winning_outcome","type":"bool"}]},{"name":"resolve_market_host","docs":["Resolve market - HostOracle mode (creator resolves)"],"discriminator":[140,50,133,146,72,5,210,116],"accounts":[{"name":"config","pda":{"seeds":[{"kind":"const","value":[99,111,110,102,105,103]}]}},{"name":"market","writable":true,"pda":{"seeds":[{"kind":"const","value":[109,97,114,107,101,116]},{"kind":"account","path":"market.market_id","account":"Market"}]}},{"name":"host","signer":true}],"args":[{"name":"winning_outcome","type":"bool"}]},{"name":"resolve_race","docs":["Resolve a race market (creator/oracle only)","SECURITY: Authorization enforced based on resolution_mode"],"discriminator":[181,252,7,209,242,100,95,172],"accounts":[{"name":"config","pda":{"seeds":[{"kind":"const","value":[99,111,110,102,105,103]}]}},{"name":"race_market","writable":true,"pda":{"seeds":[{"kind":"const","value":[114,97,99,101]},{"kind":"account","path":"race_market.market_id","account":"RaceMarket"}]}},{"name":"resolver","docs":["The resolver - authorization checked in instruction based on resolution_mode"],"signer":true}],"args":[{"name":"winning_outcome","type":"u8"}]},{"name":"set_affiliate_bonus_budgets","docs":["Admin: Set affiliate bonus budget cap (SOL only)","This is a logical cap that limits grant_affiliate_bonus_sol calls.","Off-chain, admin should ensure treasury holds enough to cover the budget.","SOLVENCY-AWARE: Cannot set budget below current outstanding amount.","Added defense-in-depth auth check","USDC removed - SOL only platform"],"discriminator":[145,230,186,126,187,158,152,116],"accounts":[{"name":"config","writable":true,"pda":{"seeds":[{"kind":"const","value":[99,111,110,102,105,103]}]}},{"name":"admin","signer":true}],"args":[{"name":"bonus_budget_sol","type":"u64"},{"name":"_bonus_budget_usdc","type":"u64"}]},{"name":"set_betting_freeze","docs":["Set the global betting freeze period (admin only)","","WHALE PROTECTION: This configures how long before market closing that betting stops.","A longer freeze period prevents whales from making large last-second bets based on","information advantages, protecting retail bettors.","","Parameters:","- freeze_seconds: Duration in seconds (300 to 86400)","- 300 (5 min) = default, minimal protection","- 3600 (1 hour) = recommended for high-stakes markets","- 86400 (24 hours) = maximum protection","","SECURITY: Only admin can change this setting. Changes affect all future bets","on all markets. Existing markets with closed betting are not affected."],"discriminator":[120,191,28,162,70,14,140,219],"accounts":[{"name":"config","writable":true,"pda":{"seeds":[{"kind":"const","value":[99,111,110,102,105,103]}]}},{"name":"admin","signer":true}],"args":[{"name":"freeze_seconds","type":"i64"}]},{"name":"set_cancel_threshold","docs":["Set creator cancel threshold","Controls the maximum pool size at which creators can cancel their own markets","","Parameters:","- threshold_sol: Amount in lamports (e.g., 500_000_000 = 0.5 SOL)"],"discriminator":[25,235,196,142,247,83,92,73],"accounts":[{"name":"config","writable":true,"pda":{"seeds":[{"kind":"const","value":[99,111,110,102,105,103]}]}},{"name":"admin","signer":true}],"args":[{"name":"threshold_sol","type":"u64"}]},{"name":"set_dispute_config","docs":["Set dispute system configuration","","Parameters:","- dispute_window_seconds: Duration in seconds for challenge window (0 = immediate finalization)","- disputes_enabled: Kill switch for dispute system (false = immediate finalization always)"],"discriminator":[140,9,117,207,15,127,158,49],"accounts":[{"name":"config","writable":true,"pda":{"seeds":[{"kind":"const","value":[99,111,110,102,105,103]}]}},{"name":"admin","signer":true}],"args":[{"name":"dispute_window_seconds","type":"i64"},{"name":"disputes_enabled","type":"bool"}]},{"name":"set_staking_vault","docs":["Set the staking reward vault address.","When set and active, protocol_share from claims is routed to this address.","","SECURITY: Only admin can set this. The vault should be the staking program's","reward vault PDA that accumulates fees for distribution to stakers."],"discriminator":[165,99,29,53,40,201,251,153],"accounts":[{"name":"config","pda":{"seeds":[{"kind":"const","value":[99,111,110,102,105,103]}]}},{"name":"revenue_config","writable":true,"pda":{"seeds":[{"kind":"const","value":[114,101,118,101,110,117,101,95,99,111,110,102,105,103]}]}},{"name":"admin","signer":true}],"args":[{"name":"staking_vault","type":"pubkey"},{"name":"is_active","type":"bool"}]},{"name":"shorten_market_time","docs":["Shorten market times (admin only)","Allows resolving markets earlier when outcome is definitively known","Use case: Event cancelled, election called early, game ended, etc."],"discriminator":[222,130,130,254,167,49,247,177],"accounts":[{"name":"config","pda":{"seeds":[{"kind":"const","value":[99,111,110,102,105,103]}]}},{"name":"market","writable":true,"pda":{"seeds":[{"kind":"const","value":[109,97,114,107,101,116]},{"kind":"account","path":"market.market_id","account":"Market"}]}},{"name":"admin","signer":true}],"args":[{"name":"new_closing_time","type":"i64"},{"name":"new_resolution_time","type":"i64"}]},{"name":"shorten_race_market_time","docs":["Shorten race market times (admin only)","Allows resolving race markets earlier when outcome is definitively known"],"discriminator":[191,145,172,98,61,175,16,177],"accounts":[{"name":"config","pda":{"seeds":[{"kind":"const","value":[99,111,110,102,105,103]}]}},{"name":"race_market","writable":true,"pda":{"seeds":[{"kind":"const","value":[114,97,99,101]},{"kind":"account","path":"race_market.market_id","account":"RaceMarket"}]}},{"name":"admin","signer":true}],"args":[{"name":"new_closing_time","type":"i64"},{"name":"new_resolution_time","type":"i64"}]},{"name":"sweep_dust_sol","docs":["Admin: Sweep leftover SOL dust from a resolved/cancelled market to treasury","This handles rounding dust that accumulates due to integer division","Can only be called after market is fully resolved/cancelled and some time has passed","Extended grace period and max dust cap","Previous: 7 days, no cap - could steal unclaimed winnings","Now: 90 days, max 0.01 SOL - only actual rounding dust","One-time sweep only - prevents repeated calls draining all funds"],"discriminator":[245,159,140,93,91,228,173,3],"accounts":[{"name":"config","pda":{"seeds":[{"kind":"const","value":[99,111,110,102,105,103]}]}},{"name":"market","writable":true,"pda":{"seeds":[{"kind":"const","value":[109,97,114,107,101,116]},{"kind":"account","path":"market.market_id","account":"Market"}]}},{"name":"treasury","writable":true},{"name":"admin","signer":true}],"args":[]},{"name":"sweep_race_dust_sol","docs":["Admin sweep leftover dust from a resolved/cancelled RACE market","","This is the race market equivalent of sweep_dust_sol","Previously missing, causing dust in race markets to be locked forever.","","Same security protections as sweep_dust_sol:","- 90 day grace period after resolution","- Max 0.01 SOL dust cap","- Outstanding funds check (only sweep rounding dust, not user funds)","- One-time sweep only (dust_swept flag)"],"discriminator":[72,237,133,210,88,187,79,186],"accounts":[{"name":"config","pda":{"seeds":[{"kind":"const","value":[99,111,110,102,105,103]}]}},{"name":"race_market","writable":true,"pda":{"seeds":[{"kind":"const","value":[114,97,99,101]},{"kind":"account","path":"race_market.market_id","account":"RaceMarket"}]}},{"name":"treasury","writable":true},{"name":"admin","signer":true}],"args":[]},{"name":"toggle_affiliate","docs":["Admin: Disable/enable an affiliate","Added defense-in-depth auth check"],"discriminator":[47,161,133,19,172,44,43,194],"accounts":[{"name":"config","pda":{"seeds":[{"kind":"const","value":[99,111,110,102,105,103]}]}},{"name":"affiliate","writable":true,"pda":{"seeds":[{"kind":"const","value":[97,102,102,105,108,105,97,116,101]},{"kind":"account","path":"affiliate.owner","account":"Affiliate"}]}},{"name":"admin","signer":true}],"args":[{"name":"active","type":"bool"}]},{"name":"update_admin","discriminator":[161,176,40,213,60,184,179,228],"accounts":[{"name":"config","writable":true,"pda":{"seeds":[{"kind":"const","value":[99,111,110,102,105,103]}]}},{"name":"admin","signer":true}],"args":[{"name":"new_admin","type":"pubkey"}]},{"name":"update_affiliate_settings","discriminator":[253,24,188,132,227,111,7,77],"accounts":[{"name":"config","writable":true,"pda":{"seeds":[{"kind":"const","value":[99,111,110,102,105,103]}]}},{"name":"admin","signer":true}],"args":[{"name":"affiliate_fee_bps","type":"u16"},{"name":"enabled","type":"bool"}]},{"name":"update_creator_profile","docs":["Update creator profile settings"],"discriminator":[8,240,162,55,110,46,177,108],"accounts":[{"name":"creator_profile","writable":true,"pda":{"seeds":[{"kind":"const","value":[99,114,101,97,116,111,114,95,112,114,111,102,105,108,101]},{"kind":"account","path":"owner"}]}},{"name":"owner","signer":true}],"args":[{"name":"display_name","type":"string"},{"name":"default_fee_bps","type":"u16"}]},{"name":"update_fees","discriminator":[225,27,13,6,69,84,172,191],"accounts":[{"name":"config","writable":true,"pda":{"seeds":[{"kind":"const","value":[99,111,110,102,105,103]}]}},{"name":"admin","signer":true}],"args":[{"name":"creation_fee_sol","type":"u64"},{"name":"platform_fee_bps","type":"u16"}]},{"name":"update_guardian","discriminator":[67,64,31,60,145,93,95,51],"accounts":[{"name":"config","writable":true,"pda":{"seeds":[{"kind":"const","value":[99,111,110,102,105,103]}]}},{"name":"admin","signer":true}],"args":[{"name":"new_guardian","type":"pubkey"}]},{"name":"update_lab_settings","discriminator":[193,91,97,71,74,11,36,225],"accounts":[{"name":"config","writable":true,"pda":{"seeds":[{"kind":"const","value":[99,111,110,102,105,103]}]}},{"name":"admin","signer":true}],"args":[{"name":"creation_fee_sol","type":"u64"},{"name":"platform_fee_bps","type":"u16"},{"name":"max_pool_sol","type":"u64"},{"name":"enabled","type":"bool"}]},{"name":"update_oracle_config","docs":["Update oracle config. Admin-only.","Can swap oracle key and/or toggle active (kill switch)."],"discriminator":[83,16,11,254,57,99,156,58],"accounts":[{"name":"config","pda":{"seeds":[{"kind":"const","value":[99,111,110,102,105,103]}]}},{"name":"oracle_config","writable":true,"pda":{"seeds":[{"kind":"const","value":[111,114,97,99,108,101,95,99,111,110,102,105,103]}]}},{"name":"admin","signer":true}],"args":[{"name":"oracle","type":{"option":"pubkey"}},{"name":"active","type":{"option":"bool"}}]},{"name":"update_private_settings","discriminator":[81,79,51,197,190,40,57,182],"accounts":[{"name":"config","writable":true,"pda":{"seeds":[{"kind":"const","value":[99,111,110,102,105,103]}]}},{"name":"admin","signer":true}],"args":[{"name":"creation_fee_sol","type":"u64"},{"name":"platform_fee_bps","type":"u16"},{"name":"max_pool_sol","type":"u64"},{"name":"enabled","type":"bool"}]},{"name":"update_treasury","discriminator":[60,16,243,66,96,59,254,131],"accounts":[{"name":"config","writable":true,"pda":{"seeds":[{"kind":"const","value":[99,111,110,102,105,103]}]}},{"name":"admin","signer":true}],"args":[{"name":"new_treasury","type":"pubkey"}]},{"name":"verify_creator","docs":["Admin: Verify a creator profile"],"discriminator":[52,17,96,132,71,4,85,194],"accounts":[{"name":"config","pda":{"seeds":[{"kind":"const","value":[99,111,110,102,105,103]}]}},{"name":"creator_profile","writable":true,"pda":{"seeds":[{"kind":"const","value":[99,114,101,97,116,111,114,95,112,114,111,102,105,108,101]},{"kind":"account","path":"creator_profile.owner","account":"CreatorProfile"}]}},{"name":"admin","signer":true}],"args":[{"name":"verification_type","type":"u8"}]},{"name":"vote_council","docs":["Cast a council vote on a CouncilOracle market","Only council members can vote. Market auto-resolves when threshold is reached.","Security: PDA init prevents double voting."],"discriminator":[252,167,165,182,221,242,174,249],"accounts":[{"name":"config","pda":{"seeds":[{"kind":"const","value":[99,111,110,102,105,103]}]}},{"name":"market","writable":true,"pda":{"seeds":[{"kind":"const","value":[109,97,114,107,101,116]},{"kind":"account","path":"market.market_id","account":"Market"}]}},{"name":"council_vote","docs":["Council vote PDA - init constraint prevents double voting","Seeds: [\"council_vote\", market_id, voter]"],"writable":true,"pda":{"seeds":[{"kind":"const","value":[99,111,117,110,99,105,108,95,118,111,116,101]},{"kind":"account","path":"market.market_id","account":"Market"},{"kind":"account","path":"voter"}]}},{"name":"dispute_meta","docs":["DisputeMeta for dispute window support when threshold reached"],"writable":true,"pda":{"seeds":[{"kind":"const","value":[100,105,115,112,117,116,101,95,109,101,116,97]},{"kind":"account","path":"market"}]}},{"name":"voter","docs":["The council member casting the vote","Must be in market.council array (verified in instruction logic)"],"writable":true,"signer":true},{"name":"system_program","address":"11111111111111111111111111111111"}],"args":[{"name":"vote","type":"bool"}]},{"name":"vote_council_race","docs":["Council member casts vote on race market outcome","SECURITY:","- Only council members can vote","- One vote per council member (enforced by PDA init)","- Must be after market closes","- Auto-resolves if threshold reached"],"discriminator":[79,176,145,193,225,24,183,234],"accounts":[{"name":"config","pda":{"seeds":[{"kind":"const","value":[99,111,110,102,105,103]}]}},{"name":"race_market","writable":true,"pda":{"seeds":[{"kind":"const","value":[114,97,99,101]},{"kind":"account","path":"race_market.market_id","account":"RaceMarket"}]}},{"name":"vote_record","docs":["Vote record - init on first vote"],"writable":true,"pda":{"seeds":[{"kind":"const","value":[114,97,99,101,95,99,111,117,110,99,105,108,95,118,111,116,101]},{"kind":"account","path":"race_market"},{"kind":"account","path":"voter"}]}},{"name":"dispute_meta","docs":["DisputeMeta for dispute window support when threshold reached"],"writable":true,"pda":{"seeds":[{"kind":"const","value":[100,105,115,112,117,116,101,95,109,101,116,97]},{"kind":"account","path":"race_market"}]}},{"name":"voter","writable":true,"signer":true},{"name":"system_program","address":"11111111111111111111111111111111"}],"args":[{"name":"outcome_vote","type":"u8"}]},{"name":"vote_creator_reputation","docs":["Vote on a creator's reputation after participating in their resolved market","Security: Requires a position in the resolved market (sybil resistance)","Security: One vote per market per creator per user (PDA constraint)"],"discriminator":[70,64,70,238,141,95,102,221],"accounts":[{"name":"config","pda":{"seeds":[{"kind":"const","value":[99,111,110,102,105,103]}]}},{"name":"market","docs":["The resolved market - used to identify the creator"],"pda":{"seeds":[{"kind":"const","value":[109,97,114,107,101,116]},{"kind":"account","path":"market.market_id","account":"Market"}]}},{"name":"position","docs":["Voter's position in this market - proves they participated","SECURITY: Must have non-zero wagered amount (sybil resistance)"],"pda":{"seeds":[{"kind":"const","value":[112,111,115,105,116,105,111,110]},{"kind":"account","path":"market.market_id","account":"Market"},{"kind":"account","path":"voter"}]}},{"name":"creator_reputation","docs":["Creator reputation account - init_if_needed for first voter"],"writable":true,"pda":{"seeds":[{"kind":"const","value":[99,114,101,97,116,111,114,95,114,101,112]},{"kind":"account","path":"market.creator","account":"Market"}]}},{"name":"reputation_vote","docs":["Individual vote record - prevents double voting on same creator for same market","Seeds include market_id to allow voting once per market per creator per user"],"writable":true,"pda":{"seeds":[{"kind":"const","value":[114,101,112,95,118,111,116,101]},{"kind":"account","path":"voter"},{"kind":"account","path":"market.creator","account":"Market"},{"kind":"account","path":"market.market_id","account":"Market"}]}},{"name":"voter","docs":["The voter - must have participated in the market"],"writable":true,"signer":true},{"name":"system_program","address":"11111111111111111111111111111111"}],"args":[{"name":"vote","type":"i8"}]}],"accounts":[{"name":"Affiliate","discriminator":[136,95,107,149,36,195,146,35]},{"name":"CouncilVote","discriminator":[98,136,7,228,224,14,177,195]},{"name":"CreatorProfile","discriminator":[251,250,184,111,214,178,32,221]},{"name":"CreatorReputation","discriminator":[76,107,128,9,3,235,176,152]},{"name":"DisputeMeta","discriminator":[172,110,190,78,173,57,254,229]},{"name":"GlobalConfig","discriminator":[149,8,156,202,160,252,176,217]},{"name":"Market","discriminator":[219,190,213,55,0,227,198,154]},{"name":"OracleConfig","discriminator":[133,196,152,50,27,21,145,254]},{"name":"PrivateWhitelist","discriminator":[183,227,207,97,233,244,56,67]},{"name":"RaceCouncilVote","discriminator":[14,249,207,171,77,226,126,51]},{"name":"RaceMarket","discriminator":[235,196,111,75,230,113,118,238]},{"name":"RacePosition","discriminator":[44,182,16,1,230,14,174,46]},{"name":"RaceReferral","discriminator":[15,177,82,201,128,32,154,129]},{"name":"RaceWhitelist","discriminator":[249,150,142,63,70,174,183,216]},{"name":"ReferredUser","discriminator":[74,220,238,29,172,145,111,223]},{"name":"ReputationVote","discriminator":[219,54,19,180,157,214,40,152]},{"name":"RevenueConfig","discriminator":[7,27,216,11,136,50,125,57]},{"name":"SolTreasury","discriminator":[12,193,151,147,249,50,239,28]},{"name":"UserPosition","discriminator":[251,248,209,245,83,234,17,27]}],"events":[{"name":"AdminUpdated","discriminator":[69,82,49,171,43,3,80,161]},{"name":"AffiliateBonusGranted","discriminator":[220,210,233,232,194,143,106,191]},{"name":"AffiliateEarningsClaimed","discriminator":[108,177,154,240,236,210,252,115]},{"name":"AffiliateRegistered","discriminator":[105,5,31,167,189,121,113,42]},{"name":"BetPlaced","discriminator":[88,88,145,226,126,206,32,0]},{"name":"BettingFreezeUpdated","discriminator":[70,237,148,198,44,251,184,233]},{"name":"CouncilVoteCast","discriminator":[163,33,110,83,145,142,89,177]},{"name":"CreatorEarningsClaimed","discriminator":[109,80,195,152,135,213,253,181]},{"name":"CreatorProfileCreated","discriminator":[176,54,59,229,108,194,247,111]},{"name":"CreatorProfileUpdated","discriminator":[197,176,22,163,254,186,181,103]},{"name":"CreatorVerified","discriminator":[11,119,99,24,181,152,102,15]},{"name":"DisputeConfigUpdated","discriminator":[231,168,142,115,107,235,60,4]},{"name":"DisputeFlagged","discriminator":[52,205,253,115,186,119,132,141]},{"name":"DisputeVerdictDelivered","discriminator":[110,14,134,83,1,105,132,103]},{"name":"DustSwept","discriminator":[131,70,179,205,208,80,13,168]},{"name":"FeesUpdated","discriminator":[65,34,234,59,248,242,101,118]},{"name":"GuardianUpdated","discriminator":[31,95,81,24,90,9,246,32]},{"name":"LayerSettingsUpdated","discriminator":[128,114,86,9,230,253,225,69]},{"name":"MarketCancelledEvent","discriminator":[216,244,148,122,217,220,248,188]},{"name":"MarketClosed","discriminator":[86,91,119,43,94,0,217,113]},{"name":"MarketCreated","discriminator":[88,184,130,231,226,84,6,58]},{"name":"MarketExtended","discriminator":[67,165,253,192,45,189,179,47]},{"name":"MarketPausedEvent","discriminator":[188,195,34,16,53,37,64,100]},{"name":"MarketResolved","discriminator":[89,67,230,95,143,106,199,202]},{"name":"MarketResolvedByCouncil","discriminator":[142,197,15,84,237,195,146,0]},{"name":"MarketShortened","discriminator":[202,15,203,123,181,125,209,119]},{"name":"OracleConfigUpdated","discriminator":[130,6,5,137,29,155,34,68]},{"name":"ProtocolInitialized","discriminator":[173,122,168,254,9,118,76,132]},{"name":"ProtocolPausedEvent","discriminator":[0,32,186,132,252,198,0,66]},{"name":"ProtocolShareRouted","discriminator":[56,254,70,154,147,255,199,141]},{"name":"RaceDustSwept","discriminator":[4,58,123,110,46,40,28,141]},{"name":"RaceMarketCancelledEvent","discriminator":[150,142,254,0,18,181,19,15]},{"name":"RaceMarketExtended","discriminator":[115,51,210,85,41,178,50,91]},{"name":"RaceMarketShortened","discriminator":[248,157,236,57,76,158,91,32]},{"name":"RefundClaimed","discriminator":[136,64,242,99,4,244,208,130]},{"name":"ReputationVoteCast","discriminator":[179,236,23,107,173,36,195,82]},{"name":"ReputationVoteChanged","discriminator":[241,44,49,109,229,77,61,16]},{"name":"ResolutionFinalized","discriminator":[149,12,63,110,234,46,241,202]},{"name":"ResolutionProposed","discriminator":[209,21,193,193,218,234,131,108]},{"name":"StakingVaultUpdated","discriminator":[221,245,59,72,3,1,208,33]},{"name":"TreasuryUpdated","discriminator":[80,239,54,168,43,38,85,145]},{"name":"UserReferred","discriminator":[129,114,1,27,66,43,24,143]},{"name":"WhitelistUpdated","discriminator":[205,110,205,193,238,237,220,22]},{"name":"WinningsClaimed","discriminator":[187,184,29,196,54,117,70,150]}],"errors":[{"code":6000,"name":"Unauthorized","msg":"Unauthorized access"},{"code":6001,"name":"NotExpectedAdmin","msg":"Not the expected admin"},{"code":6002,"name":"InvalidGuardian","msg":"Invalid guardian"},{"code":6003,"name":"NotAdminOrGuardian","msg":"Only admin or guardian can perform this action"},{"code":6004,"name":"InvalidAddress","msg":"Invalid address: cannot be default/null pubkey"},{"code":6005,"name":"ProtocolPaused","msg":"Protocol is paused"},{"code":6006,"name":"MarketPaused","msg":"Market is paused"},{"code":6007,"name":"AlreadyInitialized","msg":"Already initialized"},{"code":6008,"name":"MarketNotActive","msg":"Market not active"},{"code":6009,"name":"MarketNotClosed","msg":"Market not closed"},{"code":6010,"name":"MarketNotResolved","msg":"Market not resolved"},{"code":6011,"name":"MarketAlreadyResolved","msg":"Market already resolved"},{"code":6012,"name":"MarketCancelled","msg":"Market cancelled"},{"code":6013,"name":"BettingClosed","msg":"Betting closed"},{"code":6014,"name":"BettingFrozen","msg":"Betting frozen before closing time"},{"code":6015,"name":"SnapshotNotTaken","msg":"Snapshot not taken yet"},{"code":6016,"name":"ResolutionBufferNotPassed","msg":"Resolution buffer not passed"},{"code":6017,"name":"EmergencyResolutionNotAvailable","msg":"Emergency resolution not available yet"},{"code":6018,"name":"MarketStillActive","msg":"Market still active"},{"code":6019,"name":"CreatorCancelPoolTooLarge","msg":"Creator cannot cancel: pool too large"},{"code":6020,"name":"CreatorCancelsDisabled","msg":"Creator cancellation is disabled for this layer"},{"code":6021,"name":"DisputeWindowTooLong","msg":"Dispute window cannot exceed maximum allowed duration"},{"code":6022,"name":"CouncilVotingExpired","msg":"Council voting window has expired"},{"code":6023,"name":"BetTooLow","msg":"Bet amount too low"},{"code":6024,"name":"BetTooHigh","msg":"Bet amount too high"},{"code":6025,"name":"InvalidOutcome","msg":"Invalid outcome"},{"code":6026,"name":"NothingToClaim","msg":"Nothing to claim"},{"code":6027,"name":"AlreadyClaimed","msg":"Already claimed"},{"code":6028,"name":"InsufficientFunds","msg":"Insufficient funds"},{"code":6029,"name":"InvalidClosingTime","msg":"Invalid closing time"},{"code":6030,"name":"InvalidResolutionBuffer","msg":"Invalid resolution buffer"},{"code":6031,"name":"ResolutionBufferTooLong","msg":"Resolution buffer exceeds maximum (30 days)"},{"code":6032,"name":"InvalidAutoStopBuffer","msg":"Invalid auto-stop buffer"},{"code":6033,"name":"QuestionTooLong","msg":"Question too long"},{"code":6034,"name":"InvalidUsdcMint","msg":"Invalid USDC mint"},{"code":6035,"name":"InvalidCurrencyType","msg":"Invalid currency type"},{"code":6036,"name":"FeeTooHigh","msg":"Invalid fee: too high"},{"code":6037,"name":"InvalidExtension","msg":"Invalid extension amount"},{"code":6038,"name":"InvalidAccessGate","msg":"Invalid access gate: not implemented"},{"code":6039,"name":"InvalidShortening","msg":"Invalid shortening: new time must be less than current time"},{"code":6040,"name":"ShortenedTimeMustBeFuture","msg":"Invalid shortening: new time must be in the future"},{"code":6041,"name":"ShortenedResolutionBeforeClose","msg":"Invalid shortening: resolution time must be after closing time"},{"code":6042,"name":"ReasonTooLong","msg":"Reason string too long (max 200 chars)"},{"code":6043,"name":"InvalidBettingFreeze","msg":"Invalid betting freeze period (must be 300-86400 seconds)"},{"code":6044,"name":"MathOverflow","msg":"Math overflow"},{"code":6045,"name":"DivisionByZero","msg":"Division by zero"},{"code":6046,"name":"PoolAccountingInvariant","msg":"Pool accounting invariant violated: sum(outcome_pools) != total_pool"},{"code":6047,"name":"InvalidVault","msg":"Invalid vault"},{"code":6048,"name":"InvalidMarket","msg":"Invalid market account"},{"code":6049,"name":"InsufficientRent","msg":"Insufficient rent"},{"code":6050,"name":"NotRentExempt","msg":"Account not rent exempt"},{"code":6051,"name":"LabsDisabled","msg":"Labs feature is disabled"},{"code":6052,"name":"PrivateTablesDisabled","msg":"Private tables feature is disabled"},{"code":6053,"name":"LabPoolExceeded","msg":"Lab pool size exceeded"},{"code":6054,"name":"PrivatePoolExceeded","msg":"Private pool size exceeded"},{"code":6055,"name":"InvalidLayer","msg":"Invalid layer for this operation"},{"code":6056,"name":"CannotCreateOfficial","msg":"Cannot create Official market with this instruction"},{"code":6057,"name":"InvalidResolutionMode","msg":"Invalid resolution mode for this layer"},{"code":6058,"name":"NotOracleHost","msg":"Not the oracle host"},{"code":6059,"name":"NotCouncilMember","msg":"Not a council member"},{"code":6060,"name":"AlreadyVoted","msg":"Already voted"},{"code":6061,"name":"CouncilThresholdNotReached","msg":"Council threshold not reached"},{"code":6062,"name":"InvalidCouncilSize","msg":"Invalid council size"},{"code":6063,"name":"InvalidCouncilThreshold","msg":"Invalid council threshold"},{"code":6064,"name":"DuplicateCouncilMember","msg":"Duplicate council member"},{"code":6065,"name":"NotWhitelisted","msg":"Not whitelisted"},{"code":6066,"name":"InvalidInviteHash","msg":"Invalid invite hash"},{"code":6067,"name":"WhitelistFull","msg":"Whitelist full"},{"code":6068,"name":"AlreadyWhitelisted","msg":"Already whitelisted"},{"code":6069,"name":"AffiliatesDisabled","msg":"Affiliates feature is disabled"},{"code":6070,"name":"AffiliateCodeTaken","msg":"Affiliate code already taken"},{"code":6071,"name":"AffiliateCodeTooLong","msg":"Affiliate code too long"},{"code":6072,"name":"AffiliateNotFound","msg":"Affiliate not found"},{"code":6073,"name":"AffiliateNotActive","msg":"Affiliate not active"},{"code":6074,"name":"AlreadyReferred","msg":"Already referred"},{"code":6075,"name":"CannotSelfRefer","msg":"Cannot self-refer"},{"code":6076,"name":"NoPendingEarnings","msg":"No pending affiliate earnings"},{"code":6077,"name":"ReferralMustBeFirstBet","msg":"Referral can only be set on first bet"},{"code":6078,"name":"CreatorProfileExists","msg":"Creator profile already exists"},{"code":6079,"name":"CreatorProfileNotFound","msg":"Creator profile not found"},{"code":6080,"name":"DisplayNameTooLong","msg":"Display name too long (max 32 chars)"},{"code":6081,"name":"InvalidVerificationType","msg":"Invalid verification type"},{"code":6082,"name":"InsufficientAffiliateBonusBudget","msg":"Insufficient affiliate bonus budget"},{"code":6083,"name":"BudgetBelowOutstanding","msg":"Cannot set budget below outstanding amount"},{"code":6084,"name":"AffiliateAccountRequired","msg":"Affiliate account required for referred position"},{"code":6085,"name":"InvalidReputationVote","msg":"Invalid vote value. Must be +1 or -1"},{"code":6086,"name":"NoPositionInMarket","msg":"No position in this market - must have bet to vote on creator"},{"code":6087,"name":"SameVote","msg":"New vote must be different from current vote"},{"code":6088,"name":"MarketNotResolvedForVote","msg":"Market must be resolved to vote on creator reputation"},{"code":6089,"name":"ReputationNotFound","msg":"Creator reputation account not found"},{"code":6090,"name":"InvalidOutcomeCount","msg":"Invalid outcome count - must be between 2 and 10"},{"code":6091,"name":"InvalidOutcomeIndex","msg":"Invalid outcome index"},{"code":6092,"name":"RaceNotResolved","msg":"Race market not resolved"},{"code":6093,"name":"AlreadyBetOnDifferentOutcome","msg":"Already bet on a different outcome - can only bet on one outcome per race"},{"code":6094,"name":"RaceMarketsDisabled","msg":"Race markets not enabled"},{"code":6095,"name":"OutcomeLabelTooLong","msg":"Outcome label too long - max 32 characters"},{"code":6096,"name":"RacePoolExceeded","msg":"Race pool limit exceeded"},{"code":6097,"name":"ResolutionTooEarly","msg":"Cannot resolve before closing time"},{"code":6098,"name":"MarketNotCancelled","msg":"Market must be cancelled for refunds"},{"code":6099,"name":"CreatorFeeTooHigh","msg":"Creator fee cannot exceed layer platform fee"},{"code":6100,"name":"AffiliateOwnerMismatch","msg":"Affiliate account owner does not match position referrer"},{"code":6101,"name":"CreatorProfileRequired","msg":"Creator profile account required when market has creator fees"},{"code":6102,"name":"ResolutionPending","msg":"Market resolution is pending - wait for challenge window to end"},{"code":6103,"name":"MarketDisputed","msg":"Market is disputed - awaiting external verdict"},{"code":6104,"name":"ChallengeWindowActive","msg":"Challenge window has not ended - wait until challenge_ends_at"},{"code":6105,"name":"ChallengeWindowEnded","msg":"Challenge window has ended - too late to dispute"},{"code":6106,"name":"ResolutionAlreadyPending","msg":"Market already has a pending resolution"},{"code":6107,"name":"NotResolvedPending","msg":"Market is not in ResolvedPending status"},{"code":6108,"name":"DisputesDisabled","msg":"Dispute system is disabled"},{"code":6109,"name":"InvalidDisputeCase","msg":"Invalid dispute case - cannot be default pubkey"},{"code":6110,"name":"DisputeMetaMismatch","msg":"DisputeMeta account does not match market"},{"code":6111,"name":"ResolutionAlreadyFinalized","msg":"Resolution has already been finalized"},{"code":6112,"name":"MustUseProposeResolution","msg":"Disputes enabled - must use propose_resolution instead of legacy resolve"},{"code":6113,"name":"MarketNotDisputed","msg":"Market is not in Disputed state"},{"code":6114,"name":"NoDisputeCase","msg":"No dispute case has been recorded for this market"},{"code":6115,"name":"NewOutcomeRequired","msg":"A new outcome must be provided when overriding the resolution"},{"code":6116,"name":"ConflictingDisputeActions","msg":"Conflicting dispute resolution: specify exactly one of affirm, override (new_outcome), or cancel"},{"code":6117,"name":"NoWinningBets","msg":"No bets on winning outcome - cannot resolve, must cancel"},{"code":6118,"name":"OutstandingFundsTooHigh","msg":"Outstanding funds exceed dust threshold - users may still have unclaimed winnings"},{"code":6119,"name":"AffiliateCodeEmpty","msg":"Affiliate code cannot be empty"},{"code":6120,"name":"InvalidStakingVault","msg":"Staking vault address does not match revenue config"},{"code":6121,"name":"RevenueConfigNotFound","msg":"Revenue config not initialized"},{"code":6122,"name":"InvalidOracleConfig","msg":"Invalid oracle config account"}],"types":[{"name":"AccessGate","type":{"kind":"enum","variants":[{"name":"Public"},{"name":"Whitelist"},{"name":"InviteHash"}]}},{"name":"AdminUpdated","type":{"kind":"struct","fields":[{"name":"old_admin","type":"pubkey"},{"name":"new_admin","type":"pubkey"}]}},{"name":"Affiliate","docs":["Affiliate account - tracks referral performance and earnings"],"type":{"kind":"struct","fields":[{"name":"owner","type":"pubkey"},{"name":"code","type":"string"},{"name":"total_referred_users","type":"u64"},{"name":"total_volume_sol","type":"u64"},{"name":"_reserved_total_volume_usdc","type":"u64"},{"name":"total_earnings_sol","type":"u64"},{"name":"_reserved_total_earnings_usdc","type":"u64"},{"name":"pending_sol","type":"u64"},{"name":"_reserved_pending_usdc","type":"u64"},{"name":"created_at","type":"i64"},{"name":"is_active","type":"bool"},{"name":"bump","type":"u8"},{"name":"reserved","type":{"array":["u8",32]}}]}},{"name":"AffiliateBonusGranted","type":{"kind":"struct","fields":[{"name":"affiliate","type":"pubkey"},{"name":"amount_sol","type":"u64"},{"name":"granted_by","type":"pubkey"}]}},{"name":"AffiliateEarningsClaimed","type":{"kind":"struct","fields":[{"name":"affiliate","type":"pubkey"},{"name":"amount_sol","type":"u64"}]}},{"name":"AffiliateRegistered","type":{"kind":"struct","fields":[{"name":"affiliate","type":"pubkey"},{"name":"owner","type":"pubkey"},{"name":"code","type":"string"}]}},{"name":"BetPlaced","type":{"kind":"struct","fields":[{"name":"market_id","type":"u64"},{"name":"user","type":"pubkey"},{"name":"outcome","type":"bool"},{"name":"amount","type":"u64"},{"name":"yes_pool","type":"u64"},{"name":"no_pool","type":"u64"},{"name":"affiliate","type":{"option":"pubkey"}},{"name":"affiliate_fee","type":"u64"}]}},{"name":"BettingFreezeUpdated","type":{"kind":"struct","fields":[{"name":"old_freeze_seconds","type":"i64"},{"name":"new_freeze_seconds","type":"i64"},{"name":"updated_by","type":"pubkey"}]}},{"name":"CouncilVote","docs":["Council vote tracking for CouncilOracle markets"],"type":{"kind":"struct","fields":[{"name":"market_id","type":"u64"},{"name":"voter","type":"pubkey"},{"name":"vote","type":"bool"},{"name":"voted_at","type":"i64"},{"name":"bump","type":"u8"}]}},{"name":"CouncilVoteCast","type":{"kind":"struct","fields":[{"name":"market_id","type":"u64"},{"name":"voter","type":"pubkey"},{"name":"vote","type":"bool"},{"name":"votes_yes","type":"u8"},{"name":"votes_no","type":"u8"}]}},{"name":"CreatorEarningsClaimed","type":{"kind":"struct","fields":[{"name":"profile","type":"pubkey"},{"name":"amount_sol","type":"u64"}]}},{"name":"CreatorProfile","docs":["Creator profile for trust/reputation system"],"type":{"kind":"struct","fields":[{"name":"owner","type":"pubkey"},{"name":"display_name","type":"string"},{"name":"is_verified","type":"bool"},{"name":"verification_type","type":"u8"},{"name":"total_markets_created","type":"u64"},{"name":"total_volume_sol","type":"u64"},{"name":"_reserved_total_volume_usdc","type":"u64"},{"name":"markets_resolved","type":"u64"},{"name":"disputes_lost","type":"u64"},{"name":"created_at","type":"i64"},{"name":"last_market_at","type":"i64"},{"name":"default_creator_fee_bps","type":"u16"},{"name":"total_earnings_sol","type":"u64"},{"name":"_reserved_total_earnings_usdc","type":"u64"},{"name":"pending_sol","type":"u64"},{"name":"_reserved_pending_usdc","type":"u64"},{"name":"bump","type":"u8"},{"name":"reserved","type":{"array":["u8",16]}}]}},{"name":"CreatorProfileCreated","type":{"kind":"struct","fields":[{"name":"profile","type":"pubkey"},{"name":"owner","type":"pubkey"},{"name":"display_name","type":"string"},{"name":"default_fee_bps","type":"u16"}]}},{"name":"CreatorProfileUpdated","type":{"kind":"struct","fields":[{"name":"profile","type":"pubkey"},{"name":"display_name","type":"string"},{"name":"default_fee_bps","type":"u16"}]}},{"name":"CreatorReputation","docs":["Community feedback on creators (aggregated votes)"],"type":{"kind":"struct","fields":[{"name":"creator","type":"pubkey"},{"name":"upvotes","type":"u64"},{"name":"downvotes","type":"u64"},{"name":"total_voters","type":"u64"},{"name":"reputation_score","type":"i64"},{"name":"last_updated","type":"i64"},{"name":"bump","type":"u8"},{"name":"reserved","type":{"array":["u8",16]}}]}},{"name":"CreatorVerified","type":{"kind":"struct","fields":[{"name":"profile","type":"pubkey"},{"name":"verification_type","type":"u8"},{"name":"verified_by","type":"pubkey"}]}},{"name":"CurrencyType","docs":["Currency type (SOL-only, kept for account compatibility)"],"type":{"kind":"enum","variants":[{"name":"Sol"}]}},{"name":"DisputeConfigUpdated","type":{"kind":"struct","fields":[{"name":"dispute_window_seconds","type":"i64"},{"name":"disputes_enabled","type":"bool"},{"name":"updated_by","type":"pubkey"}]}},{"name":"DisputeFlagged","type":{"kind":"struct","fields":[{"name":"market_id","type":"u64"},{"name":"market_key","type":"pubkey"},{"name":"is_race_market","type":"bool"},{"name":"dispute_case","type":"pubkey"},{"name":"flagged_by","type":"pubkey"},{"name":"flagged_at","type":"i64"},{"name":"resolution_nonce","type":"u64"}]}},{"name":"DisputeMeta","docs":["Dispute metadata - tracks resolution proposals and challenge state","Created when disputes are enabled and a resolution is proposed."],"type":{"kind":"struct","fields":[{"name":"market","type":"pubkey"},{"name":"is_race_market","type":"bool"},{"name":"proposed_outcome","type":"u8"},{"name":"proposed_at","type":"i64"},{"name":"challenge_ends_at","type":"i64"},{"name":"resolution_nonce","type":"u64"},{"name":"dispute_case","type":{"option":"pubkey"}},{"name":"proposer","type":"pubkey"},{"name":"finalized","type":"bool"},{"name":"bump","type":"u8"},{"name":"reserved","type":{"array":["u8",32]}}]}},{"name":"DisputeVerdict","type":{"kind":"enum","variants":[{"name":"Affirmed"},{"name":"Overridden"},{"name":"Cancelled"}]}},{"name":"DisputeVerdictDelivered","type":{"kind":"struct","fields":[{"name":"market_id","type":"u64"},{"name":"market_key","type":"pubkey"},{"name":"is_race_market","type":"bool"},{"name":"verdict","type":{"defined":{"name":"DisputeVerdict"}}},{"name":"final_outcome","type":{"option":"u8"}},{"name":"dispute_case","type":{"option":"pubkey"}},{"name":"resolved_by","type":"pubkey"},{"name":"resolved_at","type":"i64"}]}},{"name":"DustSwept","type":{"kind":"struct","fields":[{"name":"market_id","type":"u64"},{"name":"amount_lamports","type":"u64"}]}},{"name":"FeesUpdated","type":{"kind":"struct","fields":[{"name":"creation_fee_sol","type":"u64"},{"name":"platform_fee_bps","type":"u16"}]}},{"name":"GlobalConfig","docs":["Global protocol configuration (singleton PDA)"],"type":{"kind":"struct","fields":[{"name":"admin","type":"pubkey"},{"name":"treasury","type":"pubkey"},{"name":"guardian","type":"pubkey"},{"name":"_reserved_usdc_mint","type":{"array":["u8",32]}},{"name":"_reserved_creation_fee_usdc","type":"u64"},{"name":"creation_fee_sol","type":"u64"},{"name":"_reserved_market_bond_usdc","type":"u64"},{"name":"market_bond_sol","type":"u64"},{"name":"platform_fee_bps","type":"u16"},{"name":"market_count","type":"u64"},{"name":"paused","type":"bool"},{"name":"bump","type":"u8"},{"name":"lab_creation_fee_sol","type":"u64"},{"name":"_reserved_lab_creation_fee_usdc","type":"u64"},{"name":"lab_platform_fee_bps","type":"u16"},{"name":"lab_max_pool_sol","type":"u64"},{"name":"_reserved_lab_max_pool_usdc","type":"u64"},{"name":"labs_enabled","type":"bool"},{"name":"private_creation_fee_sol","type":"u64"},{"name":"_reserved_private_creation_fee_usdc","type":"u64"},{"name":"private_platform_fee_bps","type":"u16"},{"name":"private_max_pool_sol","type":"u64"},{"name":"_reserved_private_max_pool_usdc","type":"u64"},{"name":"private_tables_enabled","type":"bool"},{"name":"affiliate_fee_bps","type":"u16"},{"name":"affiliates_enabled","type":"bool"},{"name":"affiliate_bonus_budget_sol","type":"u64"},{"name":"_reserved_affiliate_bonus_budget_usdc","type":"u64"},{"name":"affiliate_bonus_outstanding_sol","type":"u64"},{"name":"_reserved_affiliate_bonus_outstanding_usdc","type":"u64"},{"name":"dispute_window_seconds","type":"i64"},{"name":"disputes_enabled","type":"bool"},{"name":"creator_cancel_threshold_sol","type":"u64"},{"name":"betting_freeze_seconds","type":"i64"},{"name":"reserved","type":{"array":["u8",7]}}]}},{"name":"GuardianUpdated","type":{"kind":"struct","fields":[{"name":"old_guardian","type":"pubkey"},{"name":"new_guardian","type":"pubkey"}]}},{"name":"LayerSettingsUpdated","type":{"kind":"struct","fields":[{"name":"layer","type":"u8"},{"name":"enabled","type":"bool"},{"name":"creation_fee_sol","type":"u64"},{"name":"platform_fee_bps","type":"u16"},{"name":"max_pool_sol","type":"u64"}]}},{"name":"Market","docs":["Boolean (YES/NO) prediction market account"],"type":{"kind":"struct","fields":[{"name":"market_id","type":"u64"},{"name":"question","type":"string"},{"name":"closing_time","type":"i64"},{"name":"resolution_time","type":"i64"},{"name":"auto_stop_buffer","type":"i64"},{"name":"yes_pool","type":"u64"},{"name":"no_pool","type":"u64"},{"name":"snapshot_yes_pool","type":"u64"},{"name":"snapshot_no_pool","type":"u64"},{"name":"status","type":{"defined":{"name":"MarketStatus"}}},{"name":"winning_outcome","type":{"option":"bool"}},{"name":"currency_type","type":{"defined":{"name":"CurrencyType"}}},{"name":"_reserved_usdc_vault","type":{"array":["u8",33]}},{"name":"creator_bond","type":"u64"},{"name":"total_claimed","type":"u64"},{"name":"platform_fee_collected","type":"u64"},{"name":"last_bet_time","type":"i64"},{"name":"bump","type":"u8"},{"name":"layer","type":{"defined":{"name":"MarketLayer"}}},{"name":"resolution_mode","type":{"defined":{"name":"ResolutionMode"}}},{"name":"access_gate","type":{"defined":{"name":"AccessGate"}}},{"name":"creator","type":"pubkey"},{"name":"oracle_host","type":{"option":"pubkey"}},{"name":"council","type":{"array":["pubkey",5]}},{"name":"council_size","type":"u8"},{"name":"council_votes_yes","type":"u8"},{"name":"council_votes_no","type":"u8"},{"name":"council_threshold","type":"u8"},{"name":"total_affiliate_fees","type":"u64"},{"name":"invite_hash","type":{"option":{"array":["u8",32]}}},{"name":"creator_fee_bps","type":"u16"},{"name":"total_creator_fees","type":"u64"},{"name":"creator_profile","type":{"option":"pubkey"}},{"name":"platform_fee_bps_at_creation","type":"u16"},{"name":"affiliate_fee_bps_at_creation","type":"u16"},{"name":"betting_freeze_seconds_at_creation","type":"i64"},{"name":"has_bets","type":"bool"},{"name":"dust_swept","type":"bool"},{"name":"reserved","type":{"array":["u8",2]}}]}},{"name":"MarketCancelledEvent","type":{"kind":"struct","fields":[{"name":"market_id","type":"u64"},{"name":"reason","type":"string"}]}},{"name":"MarketClosed","type":{"kind":"struct","fields":[{"name":"market_id","type":"u64"},{"name":"snapshot_yes_pool","type":"u64"},{"name":"snapshot_no_pool","type":"u64"}]}},{"name":"MarketCreated","type":{"kind":"struct","fields":[{"name":"market_id","type":"u64"},{"name":"question","type":"string"},{"name":"closing_time","type":"i64"},{"name":"resolution_time","type":"i64"},{"name":"currency_type","type":"u8"},{"name":"creator","type":"pubkey"},{"name":"layer","type":"u8"},{"name":"resolution_mode","type":"u8"},{"name":"access_gate","type":"u8"}]}},{"name":"MarketExtended","type":{"kind":"struct","fields":[{"name":"market_id","type":"u64"},{"name":"old_closing_time","type":"i64"},{"name":"new_closing_time","type":"i64"},{"name":"old_resolution_time","type":"i64"},{"name":"new_resolution_time","type":"i64"}]}},{"name":"MarketLayer","type":{"kind":"enum","variants":[{"name":"Official"},{"name":"Lab"},{"name":"Private"}]}},{"name":"MarketPausedEvent","type":{"kind":"struct","fields":[{"name":"market_id","type":"u64"},{"name":"paused","type":"bool"}]}},{"name":"MarketResolved","type":{"kind":"struct","fields":[{"name":"market_id","type":"u64"},{"name":"winning_outcome","type":"bool"},{"name":"resolver","type":"pubkey"},{"name":"resolution_mode","type":"u8"}]}},{"name":"MarketResolvedByCouncil","type":{"kind":"struct","fields":[{"name":"market_id","type":"u64"},{"name":"winning_outcome","type":"bool"},{"name":"votes_yes","type":"u8"},{"name":"votes_no","type":"u8"},{"name":"threshold","type":"u8"}]}},{"name":"MarketShortened","type":{"kind":"struct","fields":[{"name":"market_id","type":"u64"},{"name":"old_closing_time","type":"i64"},{"name":"new_closing_time","type":"i64"},{"name":"old_resolution_time","type":"i64"},{"name":"new_resolution_time","type":"i64"}]}},{"name":"MarketStatus","docs":["Market lifecycle status","","State transitions:","- With disputes: Active → Closed → ResolvedPending → Resolved","- Without disputes: Active → Closed → Resolved (immediate)","- Dispute flow: ResolvedPending → Disputed → Resolved/Cancelled","","Claims are ONLY allowed when status is Resolved (winnings) or Cancelled (refunds)."],"type":{"kind":"enum","variants":[{"name":"Active"},{"name":"Closed"},{"name":"Resolved"},{"name":"Cancelled"},{"name":"Paused"},{"name":"ResolvedPending"},{"name":"Disputed"}]}},{"name":"OracleConfig","docs":["Oracle config PDA - stores the universal oracle key that can resolve","any market type (boolean/race) and any layer (Official/Lab/Private).","Admin controls the oracle via init/update; oracle resolves outcomes.","Seeds: [\"oracle_config\"]"],"type":{"kind":"struct","fields":[{"name":"oracle","docs":["The oracle pubkey that can resolve markets"],"type":"pubkey"},{"name":"active","docs":["Kill switch - admin can deactivate to instantly block oracle"],"type":"bool"},{"name":"bump","docs":["PDA bump"],"type":"u8"}]}},{"name":"OracleConfigUpdated","type":{"kind":"struct","fields":[{"name":"oracle","type":"pubkey"},{"name":"active","type":"bool"},{"name":"updated_by","type":"pubkey"},{"name":"timestamp","type":"i64"}]}},{"name":"PrivateWhitelist","docs":["Whitelist for private boolean markets"],"type":{"kind":"struct","fields":[{"name":"market_id","type":"u64"},{"name":"addresses","type":{"vec":"pubkey"}},{"name":"bump","type":"u8"},{"name":"reserved","type":{"array":["u8",8]}}]}},{"name":"ProtocolInitialized","type":{"kind":"struct","fields":[{"name":"admin","type":"pubkey"},{"name":"treasury","type":"pubkey"},{"name":"guardian","type":"pubkey"}]}},{"name":"ProtocolPausedEvent","type":{"kind":"struct","fields":[{"name":"paused","type":"bool"}]}},{"name":"ProtocolShareRouted","type":{"kind":"struct","fields":[{"name":"market_id","type":"u64"},{"name":"is_race_market","type":"bool"},{"name":"protocol_share","type":"u64"},{"name":"destination","type":"pubkey"},{"name":"timestamp","type":"i64"}]}},{"name":"RaceCouncilVote","docs":["Race Council Vote - tracks individual council member votes on race market outcomes","Seeds: [\"race_council_vote\", race_market.key(), voter.pubkey]","SECURITY: PDA ensures one vote per council member per race market"],"type":{"kind":"struct","fields":[{"name":"race_market","type":"pubkey"},{"name":"market_id","type":"u64"},{"name":"voter","type":"pubkey"},{"name":"outcome_vote","type":"u8"},{"name":"voted_at","type":"i64"},{"name":"bump","type":"u8"}]}},{"name":"RaceDustSwept","type":{"kind":"struct","fields":[{"name":"market_id","type":"u64"},{"name":"amount_lamports","type":"u64"}]}},{"name":"RaceMarket","docs":["Pari-mutuel race market - multiple outcomes (2-10), winner takes all"],"type":{"kind":"struct","fields":[{"name":"market_id","type":"u64"},{"name":"question","type":"string"},{"name":"closing_time","type":"i64"},{"name":"resolution_time","type":"i64"},{"name":"auto_stop_buffer","type":"i64"},{"name":"outcome_count","type":"u8"},{"name":"outcome_labels","type":{"array":[{"array":["u8",32]},10]}},{"name":"outcome_pools","type":{"array":["u64",10]}},{"name":"total_pool","type":"u64"},{"name":"snapshot_pools","type":{"array":["u64",10]}},{"name":"snapshot_total","type":"u64"},{"name":"status","type":{"defined":{"name":"MarketStatus"}}},{"name":"winning_outcome","type":{"option":"u8"}},{"name":"currency_type","type":{"defined":{"name":"CurrencyType"}}},{"name":"platform_fee_collected","type":"u64"},{"name":"creator_fee_collected","type":"u64"},{"name":"total_claimed","type":"u64"},{"name":"last_bet_time","type":"i64"},{"name":"bump","type":"u8"},{"name":"layer","type":{"defined":{"name":"MarketLayer"}}},{"name":"resolution_mode","type":{"defined":{"name":"ResolutionMode"}}},{"name":"access_gate","type":{"defined":{"name":"AccessGate"}}},{"name":"creator","type":"pubkey"},{"name":"oracle_host","type":{"option":"pubkey"}},{"name":"council","type":{"array":["pubkey",5]}},{"name":"council_size","type":"u8"},{"name":"council_votes","type":{"array":["u8",10]}},{"name":"council_threshold","type":"u8"},{"name":"creator_fee_bps","type":"u16"},{"name":"creator_profile","type":{"option":"pubkey"}},{"name":"platform_fee_bps_at_creation","type":"u16"},{"name":"affiliate_fee_bps_at_creation","type":"u16"},{"name":"betting_freeze_seconds_at_creation","type":"i64"},{"name":"dust_swept","type":"bool"},{"name":"reserved","type":{"array":["u8",19]}}]}},{"name":"RaceMarketCancelledEvent","type":{"kind":"struct","fields":[{"name":"market_id","type":"u64"},{"name":"reason","type":"string"},{"name":"cancelled_by","type":"pubkey"},{"name":"total_pool_refunded","type":"u64"}]}},{"name":"RaceMarketExtended","type":{"kind":"struct","fields":[{"name":"market_id","type":"u64"},{"name":"old_closing_time","type":"i64"},{"name":"new_closing_time","type":"i64"},{"name":"old_resolution_time","type":"i64"},{"name":"new_resolution_time","type":"i64"}]}},{"name":"RaceMarketShortened","type":{"kind":"struct","fields":[{"name":"market_id","type":"u64"},{"name":"old_closing_time","type":"i64"},{"name":"new_closing_time","type":"i64"},{"name":"old_resolution_time","type":"i64"},{"name":"new_resolution_time","type":"i64"}]}},{"name":"RacePosition","docs":["User's betting position in a race market (can bet on multiple outcomes)"],"type":{"kind":"struct","fields":[{"name":"user","type":"pubkey"},{"name":"market_id","type":"u64"},{"name":"bets","type":{"array":["u64",10]}},{"name":"total_bet","type":"u64"},{"name":"claimed","type":"bool"},{"name":"bump","type":"u8"},{"name":"reserved","type":{"array":["u8",6]}}]}},{"name":"RaceReferral","docs":["Race market referral tracking (separate PDA for backward compatibility)"],"type":{"kind":"struct","fields":[{"name":"race_market","type":"pubkey"},{"name":"user","type":"pubkey"},{"name":"referred_by","type":"pubkey"},{"name":"created_at","type":"i64"},{"name":"bump","type":"u8"},{"name":"reserved","type":{"array":["u8",7]}}]}},{"name":"RaceWhitelist","docs":["Whitelist for private race markets (separate PDA namespace)"],"type":{"kind":"struct","fields":[{"name":"race_market","type":"pubkey"},{"name":"market_id","type":"u64"},{"name":"addresses","type":{"vec":"pubkey"}},{"name":"bump","type":"u8"},{"name":"reserved","type":{"array":["u8",8]}}]}},{"name":"ReferredUser","docs":["Tracks user referral attribution"],"type":{"kind":"struct","fields":[{"name":"user","type":"pubkey"},{"name":"affiliate","type":"pubkey"},{"name":"first_bet_market","type":"u64"},{"name":"first_bet_time","type":"i64"},{"name":"total_bets","type":"u64"},{"name":"total_volume_sol","type":"u64"},{"name":"_reserved_total_volume_usdc","type":"u64"},{"name":"bump","type":"u8"},{"name":"reserved","type":{"array":["u8",16]}}]}},{"name":"RefundClaimed","type":{"kind":"struct","fields":[{"name":"market_id","type":"u64"},{"name":"user","type":"pubkey"},{"name":"amount","type":"u64"}]}},{"name":"ReputationVote","docs":["Individual reputation vote (one per market per user)"],"type":{"kind":"struct","fields":[{"name":"voter","type":"pubkey"},{"name":"creator","type":"pubkey"},{"name":"market_id","type":"u64"},{"name":"vote","type":"i8"},{"name":"voted_at","type":"i64"},{"name":"bump","type":"u8"}]}},{"name":"ReputationVoteCast","type":{"kind":"struct","fields":[{"name":"market_id","type":"u64"},{"name":"creator","type":"pubkey"},{"name":"voter","type":"pubkey"},{"name":"vote","type":"i8"},{"name":"new_reputation_score","type":"i64"},{"name":"total_upvotes","type":"u64"},{"name":"total_downvotes","type":"u64"}]}},{"name":"ReputationVoteChanged","type":{"kind":"struct","fields":[{"name":"market_id","type":"u64"},{"name":"creator","type":"pubkey"},{"name":"voter","type":"pubkey"},{"name":"old_vote","type":"i8"},{"name":"new_vote","type":"i8"},{"name":"new_reputation_score","type":"i64"}]}},{"name":"ResolutionFinalized","type":{"kind":"struct","fields":[{"name":"market_id","type":"u64"},{"name":"market_key","type":"pubkey"},{"name":"is_race_market","type":"bool"},{"name":"winning_outcome","type":"u8"},{"name":"finalizer","type":"pubkey"},{"name":"finalized_at","type":"i64"}]}},{"name":"ResolutionMode","type":{"kind":"enum","variants":[{"name":"BaoziTvs"},{"name":"HostOracle"},{"name":"CouncilOracle"}]}},{"name":"ResolutionProposed","type":{"kind":"struct","fields":[{"name":"market_id","type":"u64"},{"name":"market_key","type":"pubkey"},{"name":"is_race_market","type":"bool"},{"name":"proposed_outcome","type":"u8"},{"name":"proposer","type":"pubkey"},{"name":"proposed_at","type":"i64"},{"name":"challenge_ends_at","type":"i64"},{"name":"resolution_nonce","type":"u64"}]}},{"name":"RevenueConfig","docs":["Revenue configuration for routing protocol fees to staking rewards.","When staking_vault is set, protocol_share from claims is routed there","instead of staying in SolTreasury. This enables $BAOZI token holders","to earn a share of protocol fees through staking."],"type":{"kind":"struct","fields":[{"name":"admin","docs":["The admin who can modify revenue routing"],"type":"pubkey"},{"name":"staking_vault","docs":["The staking reward vault address (receives protocol_share from claims)","If set to Pubkey::default(), protocol_share stays in SolTreasury"],"type":"pubkey"},{"name":"total_routed_to_staking","docs":["Total SOL routed to staking vault (for analytics)"],"type":"u64"},{"name":"is_active","docs":["Whether staking routing is active"],"type":"bool"},{"name":"bump","docs":["PDA bump"],"type":"u8"},{"name":"reserved","docs":["Reserved for future use"],"type":{"array":["u8",62]}}]}},{"name":"SolTreasury","docs":["SOL Treasury PDA - Program-controlled account for fee payouts"],"type":{"kind":"struct","fields":[{"name":"bump","type":"u8"},{"name":"total_deposited","type":"u64"},{"name":"total_withdrawn","type":"u64"},{"name":"reserved","type":{"array":["u8",32]}}]}},{"name":"StakingVaultUpdated","type":{"kind":"struct","fields":[{"name":"staking_vault","type":"pubkey"},{"name":"is_active","type":"bool"},{"name":"timestamp","type":"i64"}]}},{"name":"TreasuryUpdated","type":{"kind":"struct","fields":[{"name":"old_treasury","type":"pubkey"},{"name":"new_treasury","type":"pubkey"}]}},{"name":"UserPosition","docs":["User's betting position in a boolean market"],"type":{"kind":"struct","fields":[{"name":"user","type":"pubkey"},{"name":"market_id","type":"u64"},{"name":"yes_amount","type":"u64"},{"name":"no_amount","type":"u64"},{"name":"claimed","type":"bool"},{"name":"bump","type":"u8"},{"name":"referred_by","type":{"option":"pubkey"}},{"name":"affiliate_fee_paid","type":"u64"},{"name":"reserved","type":{"array":["u8",16]}}]}},{"name":"UserReferred","type":{"kind":"struct","fields":[{"name":"user","type":"pubkey"},{"name":"affiliate","type":"pubkey"},{"name":"market_id","type":"u64"}]}},{"name":"WhitelistUpdated","type":{"kind":"struct","fields":[{"name":"market_id","type":"u64"},{"name":"address","type":"pubkey"},{"name":"added","type":"bool"}]}},{"name":"WinningsClaimed","type":{"kind":"struct","fields":[{"name":"market_id","type":"u64"},{"name":"user","type":"pubkey"},{"name":"amount","type":"u64"}]}}]}