Skip to main content

Unified market invariants

Slip has one account family.
  • Market: PDA ["market", creator, id_le]
  • MarketTicket: PDA ["ticket", market, owner, nonce_le]
  • Vault: settlement-mint ATA owned by the market PDA
  • Instructions: create_market, buy_ticket, resolve_market, resolve_market_v3, claim_ticket, void_market

Terms

A market stores one complete MarketExpression, never a goals-only product enum. It accepts the canonical TxLINE stat keys 1–8 and period prefixes 1000–7000. Full-match keys use the program’s canonical period tag 100. Side, key, period, optional second stat, and operation must agree. Two to five unique labels partition the expression’s integer result through two to eight ordered, contiguous bands. Bands cover negative infinity through positive infinity. Multiple disjoint bands may point at one outcome, which expresses rules such as Draw / Not draw without another primitive.

Money

All arithmetic is integer-only with u128 multiplication. The final winning claim sends deterministic rounding dust to the fee treasury. Tickets are immutable audit records; one wallet may buy several. At least two outcomes must be funded. Resolution also requires liquidity in the proved winner. If either condition fails, the market voids. A permissionless timeout void is allowed after void_at. Voided tickets refund their full stake. Losing and double claims fail.

Proof

Resolution is allowed only from resolve_at until, but not including, void_at. At the timeout boundary proof settlement is closed and the refund path is the only valid transition, so transaction ordering cannot change the economic result. The terminal proof timestamp must be at or after entry close, preventing a market created after a known result from settling against an older result batch. Resolution reuses the hardened Tier-A path: proof stat leaves, fold to the event root, fold the fixture subtree, Borsh-hash the tagged fixture leaf, fold to the daily root, and compare the TxLINE epoch-day and five-minute slot PDA. Both stats must come from the same terminal phase: 5, 10, 13, or the documented game_finalised period 100. Zero-valued leaves can be absent upstream. A missing proof is not a false result and not permission to void a funded market early; the keeper defers until proof availability or the explicit timeout policy.

Real Surfpool matrix

The suite creates 1X2 and five-band corners markets, rejects invalid bands and key/side Terms, buys different stakes, sends an unsolicited token unit directly to the vault, rejects late buys and pre-entry proofs, resolves from a two-stat terminal proof despite the donation, verifies the compact evidence commitment, rejects proof settlement after timeout, checks fee and resolver-tip routing, pays the hand-calculated winner amount, rejects losers and double claims, supports a multi-band binary complement, voids one-sided books, and voids/refunds a funded book after timeout.