Market Lifecycle
Markets go through a clear lifecycle from creation to resolution.
Lifecycle Stages
Stage Details
1. Pending
- Market contract deployed
- Creator places initial trade
- Waiting for someone to match on opposite side
- Can be canceled by creator or auto-cancels after 24 hours
2. Active
- Market matched and activated
- Trading open on both sides
- Pools grow as users trade
- Prices update dynamically based on pool sizes
3. Closed
- Trading stops at close time
- Positions lock
- No new trades allowed
- Waiting for resolution
4. Resolved
- Outcome determined (YES, NO, or CANCELLED)
- Redemption enabled
- Winners can redeem tokens for USDC
- Losers' tokens become worthless
On-Chain State
The contract tracks:
isActive: Whether market is tradingisResolved: Whether market has been resolvedoutcome: The final outcome (NONE, YES, NO, CANCELLED)yesPool/noPool: Current pool sizesrequiredMatchAmount: Amount needed to match (pending markets)
State Transitions
All state transitions happen on-chain:
- Pending → Active: When matching trade is placed
- Active → Closed: Automatically at close time (handled off-chain)
- Closed → Resolved: When admin calls
resolveMarket() - Any → Canceled: When admin or creator cancels