Overview
Market resolution is the process of finalizing a prediction market’s outcome by pulling the settled price from UMA’s Optimistic Oracle and reporting it to the Conditional Tokens Framework. This determines how positions pay out to holders.Resolution Flow
Checking Market Readiness
ready() Function
Before attempting resolution, check if a market is ready:UmaCtfAdapter.sol
Question is Initialized
Question is Initialized
The
questionID exists in the adapter’s storage (created via initialize())Not Paused
Not Paused
The question hasn’t been paused by an admin
Not Already Resolved
Not Already Resolved
The question hasn’t been resolved yet
Price Available
Price Available
The Optimistic Oracle has a finalized price (proposal liveness period has passed without dispute)
Example: Polling for Readiness
Check Readiness
Off-Chain Monitoring
TypeScript Example
Resolving Markets
resolve() Function
UmaCtfAdapter.sol
The unique identifier of the question to resolve, returned from
initialize()Permissionless: Anyone can call
resolve() once a market is ready. This allows for automated resolution by bots or interested parties.Resolution Process
Whenresolve() is called:
Validation
Verifies:
- Question is initialized
- Question is not paused
- Question is not already resolved
- Price is available from Optimistic Oracle
Price Settlement
Calls
optimisticOracle.settleAndGetPrice() to retrieve the finalized answer:0= NO (proposal rejected)0.5 ether= UNKNOWN (tie/ambiguous)1 ether= YES (proposal accepted)type(int256).min= IGNORE (trigger reset)
Handle IGNORE Price
If the OO returns the IGNORE price, the question is automatically reset with a new price request instead of resolving
Construct Payouts
Converts the OO price to a payout array:
0→[0, 1](NO wins, YES loses)0.5 ether→[1, 1](50/50 split)1 ether→[1, 0](YES wins, NO loses)
Report to CTF
Calls
ctf.reportPayouts(questionID, payouts) to finalize the condition and enable redemptionsExample: Basic Resolution
Resolve Market
Understanding Payouts
Payout Array Structure
The CTF uses a payout array to determine how positions redeem:Payout Scenarios
YES Wins
Price:
1 etherPayouts: [1, 0]YES tokens redeem for full collateralNO tokens are worthlessNO Wins
Price:
0Payouts: [0, 1]NO tokens redeem for full collateralYES tokens are worthlessUNKNOWN
Price:
0.5 etherPayouts: [1, 1]Both tokens redeem for 50% of collateralQuerying Expected Payouts
You can check what payouts a market will have before resolving:UmaCtfAdapter.sol
Example Usage
Resolution Errors
The
questionID doesn’t exist in the adapter.Solution: Verify the correct questionID from the initialize() callThe question has been paused by an admin.Solution: Wait for admin to unpause or investigate the reason for pausing
The question has already been resolved.Solution: Check resolution status before calling
resolve()The Optimistic Oracle doesn’t have a finalized price yet.Possible Reasons:
- Liveness period hasn’t elapsed
- No proposal has been submitted
- Proposal was disputed and is being resolved by DVM
ready() firstThe Optimistic Oracle returned an invalid price (not 0, 0.5, or 1 ether).Solution: This indicates an oracle malfunction - contact UMA protocol team
Price Reset on IGNORE
If the Optimistic Oracle returns the special IGNORE price (type(int256).min), the adapter automatically resets the question:
Source: UmaCtfAdapter.sol:423
- New
requestTimestampis set to current block timestamp - New price request is sent to Optimistic Oracle
- Original reward is reused (paid by the adapter)
- Question remains unresolved
resetflag is set totrue
The IGNORE price is used when a question is deemed invalid, ambiguous, or needs to be re-proposed with additional context.
Events Emitted
Resolution Event
Reset Event
Integration Patterns
Automated Resolution Bot
Resolution Bot
Multi-Market Resolution
Batch Resolution
Best Practices
Always Check ready()
Call
ready() before attempting resolution to avoid reverts and wasted gasHandle Errors
Use try/catch blocks when resolving to gracefully handle failures
Monitor Events
Listen for
QuestionResolved and QuestionReset events to track market stateQuery Payouts
Use
getExpectedPayouts() to preview outcomes before resolutionNext Steps
Handling Disputes
Learn about the dispute flow, reset mechanism, and DVM escalation