Developer Docs
Contract addresses
Contract addresses will be published at testnet launch.
Package overview
| Module | Responsibility |
|---|---|
| admin | Platform configuration, capability issuance, pause mechanism |
| market_factory | Market creation validation and routing (bot / user / admin paths) |
| prediction_market | Market lifecycle: deposit, close, resolve, cancel, claim |
| market_position | Soulbound position receipts |
| resolution_snapshot | Bot-authored on-chain resolution proofs |
| reward_vault | Winner escrow, staker fee distribution, treasury balance |
| royalty_vault | Secondary royalty deposits and distribution |
| nft_staking | Staking registry, weight accounting, rewards index |
| types | All numeric constants (single source of truth) |
| errors | Named abort codes (unique u64 values for every error path) |
| events | Typed event emissions for every state transition |
| yume_spirits | NFT object definition and soulbound transfer logic |
| yume_spirits_mint | Mint registry, phase gating, allowlist, per-wallet cap |
| automation_caps | Capability primitives for the bot operator |
Key events
| Event | Trigger |
|---|---|
| MarketCreated | New market created |
| MarketCreatedWithBond | Bond posted at market creation |
| MarketEntered | Position deposited |
| MarketClosed | Market status -> Closed |
| MarketNeedsReview | Oracle failure / low confidence |
| MarketResolved | Final outcome set |
| MarketCancelled | Admin cancel |
| MarketAutoCancelled | Watchdog 7-day auto-cancel |
| PositionClaimed | Winner claimed payout |
| PositionRefunded | Depositor refunded (cancelled market) |
| BondReturned | Creator bond returned after clean resolve |
| BondSlashed | Creator bond slashed after cancel |
| CreatorFeePaid | 1.5% creator fee transferred |
| TreasuryWithdrawn | Admin withdrew from treasury |
| WinnerEscrowSwept | Admin swept unclaimed winner dust |
| StakerRewardsClaimed | Staker claimed accumulated fees |
| RoyaltyDeposited | Marketplace deposited royalties |
| RoyaltyDistributed | Royalties split to stakers + treasury |
Supabase API
REST endpoint pattern: /rest/v1/{table}. Available tables include markets, positions, bonds, creator_fees, staked_nfts, royalty_deposits, mints, audit_log, bot_health, market_comments, achievements, streaks, activity_feed, and leaderboard_snapshots. Realtime channels are available for markets, activity_feed, and market_comments.
Bot architecture
The indexer listens to Sui events and writes to Supabase. The resolver bot runs on a cron trigger, fetches oracle data, and resolves clear markets. The watchdog runs on a cron trigger and auto-cancels stale NeedsReview markets after the seven-day timeout.
Oracle sources
| Source ID | Provider | Use case |
|---|---|---|
| 0 | Pyth Network | Crypto price feeds (primary for price markets) |
| 1 | CoinGecko | Price fallback, volume data |
| 2 | DefiLlama | TVL data |
| 3 | Sui RPC | On-chain state queries |
| 4 | Sui GraphQL | Indexer queries |
| 5 | YumeBet Events | Protocol-internal event data |
| 6 | Internal Indexer | Cached Supabase reads |
| 7 | Manual Review | Admin override path |