Package pool is Mimir's two-sided pool prediction market, settled by an AI oracle: the gno.land port of contracts/MimirPoolErc20.sol. Stakes are mUSD (gno.land/r/.../musd, 6 decimals).
Model
- A market has two sides, A and B (YES / NO). The creator opens it with a stake on one side. Anyone, the creator included, can then stake on either side until LockSeconds before the deadline. Stakes by the same address add up per side.
- After the deadline the oracle proposes A, B, DRAW or UNRESOLVABLE. A participant can dispute within the dispute window by posting DisputeBond; the arbiter then rules. The bond comes back if the ruling changes the verdict and goes to the platform otherwise. An undisputed proposal is finalized by anyone.
- Escape hatch: ResolutionGraceSeconds after the deadline (or after the proposal or dispute), anyone can refund the market in full. From that moment the oracle and the arbiter can no longer rule.
- Fees: every stake pays an entry fee, fees.EntryBps(caller) of the amount (0.5% by default, less with a signed ticket); the rest is staked. The entry fee is kept on refunds. Winnings pay no fee, except copy trades: a stake made with a referrer pays ReferrerFeeBps of its net profit to the referrer and CopyFeeBps to the platform.
- Payout: a winner gets their stake back plus a pro-rata share of the losing side, rounded down (dust stays in the realm). If either side is empty, or on DRAW / UNRESOLVABLE, everyone gets their stake back.
- Settlement only records the outcome. Each staker is then paid by Claim(id), or by anyone through ClaimFor(id, user).
- Roles: owner, arbiter (rules disputes), oracle (may never also be owner, arbiter or fee recipient), fee recipient, and an optional audit agent that may dispute. Ownership, oracle and fee-recipient changes are timelocked; the owner can revoke the oracle at once, veto a proposal to the arbiter, cap stakes, set an early lock and pause.
- Pause stops new markets and stakes AND settlement and winners' payouts; refunds are still paid, and RefundExpired while paused refunds instead of honouring a proposal.
Differences from the EVM contract, all from the transport:
- Amounts are mUSD units in int64; MinStake, DisputeBond and caps are in those units. The caller approves this realm on mUSD first; Adena sends the approve and the call in one transaction, so there are no *WithPermit variants.
- mUSD has no blacklist and no callbacks, so a payout cannot be refused and cannot re-enter: payouts are sent directly (no parked withdrawals, no gas stipend, no reentrancy lock).
- Times are block-time unix seconds.