08 · VS Mode
VS is a two-player, three-minute, winner-takes-all match whose lifecycle is owned by one strongly consistent match authority and whose effects are idempotent.
House and friend paths converge before readiness
A challenge records creator, network, allowed universe, wager terms, expiry and mode (House or friend invitation). Acceptance is authenticated and idempotent. Funding commitments are verified for both players before readiness; no client may force start or change terms after both accept.
One revision, explicit guards and terminals
| State | Entry guard | Allowed action | Failure terminals |
|---|---|---|---|
| Challenge | Authenticated valid terms | Accept, cancel, expire | Expired, canceled |
| Accepted | Two unique eligible players | Verify commitments/readiness | Refund pending, abandoned |
| Ready | Funds/signers/feeds/policy verified | Atomic start | Readiness failed |
| Live | Persisted timestamps and revision | Bounded trading/steering | Void/refund per outage rule |
| Locked | now ≥ lockAt | Cancel/reduce only | Snapshot review |
| Snapshotted | Immutable evidence for both players | Flatten and calculate | Manual review/refund |
| Flattening | Snapshot immutable | Cancel/reduce/reconcile | Flatten failed/manual review |
| Settled | Decision and payout/refund reconciled | Replay/dispute record | None; corrections are new audited records |
Persisted timestamps, not UI countdowns or delayed alarms
The Match Durable Object persists startsAtMs, lockAtMs and snapshotAtMs in the accepted start transition. Every command is checked against authoritative time and state revision. Clients derive countdown display from server timestamps. An alarm wakes reconciliation; its firing time never moves the deadline.
Score first; risk removal second
At the deadline, new risk is rejected and the service gathers the immutable equity inputs for both players using the approved reference-price hierarchy. The score freezes from that common timestamp. Only then does each account run cancel-all plus fresh-position reduce-only flatten. Sequential flatten prices do not change the winner. Settlement requires the frozen snapshot and verified/explicitly escalated flatten status.
Published rules decide; operators cannot improvise silently
- Player/opponent disconnect: server continues; reconnect returns current revision unless the published abandonment condition applies.
- Failed participant before start: expire/refund; never start a one-sided live match.
- Exchange outage: stop risk, use the predefined void/snapshot fallback based on outage timing and evidence.
- Partial flatten: preserve frozen score, keep recovery active and mark settlement pending/manual review according to policy.
- Dispute: retain immutable inputs, formula version, transitions and artifact hashes; administrative resolution creates a separate signed record.