Overview
The UMA CTF Adapter emits events throughout the question lifecycle, from initialization to resolution. Monitoring these events is critical for:- Tracking question state changes
- Detecting disputes and manual interventions
- Auditing resolution outcomes
- Building off-chain integrations and dashboards
Core Events
QuestionInitialized
Emitted when a new question is created and submitted to the Optimistic Oracle.questionID- Unique identifier (keccak256 hash of ancillary data)requestTimestamp- Timestamp of the OO price requestcreator- Address that initialized the questionancillaryData- The question data with creator address appendedrewardToken- ERC20 token used for rewards/bondsreward- Amount offered to successful proposersproposalBond- Bond required from proposers/disputers
- Track new questions as they’re created
- Validate reward and bond amounts are economically secure
- Record creator addresses for accountability
- Store ancillary data for question interpretation
QuestionResolved
Emitted when a question is resolved through the Optimistic Oracle.questionID- The resolved question identifiersettledPrice- Price from OO (0, 0.5 ether, or 1 ether)payouts- Array[YES_payout, NO_payout]
0→ NO (payouts:[0, 1])0.5 ether→ UNKNOWN/TIE (payouts:[1, 1])1 ether→ YES (payouts:[1, 0])
- Track resolution outcomes for market settlement
- Detect unusual resolutions (e.g., ties)
- Verify payout arrays match expected values
- Trigger settlement flows in dependent systems
QuestionManuallyResolved
Emitted when an admin resolves a question manually after flagging.- Critical: Manual resolutions bypass the Optimistic Oracle
- Review all manual resolutions for governance compliance
- Alert on unexpected manual interventions
- Verify safety period (1 hour) was respected
QuestionReset
Emitted when a question is reset, triggering a new OO price request.- OO price was disputed (
priceDisputedcallback) - OO returned the ignore price (
type(int256).min) - Admin manually called
reset()(failsafe)
- Multiple resets may indicate contentious questions
- Track reset frequency per question (max 1 automatic reset)
- Alert if reset occurs after dispute
QuestionFlagged / QuestionUnflagged
Admin actions to flag questions for manual resolution.- Flagging pauses automatic resolution
- Sets
manualResolutionTimestamp=block.timestamp + 1 hour - Unflagging only possible before safety period expires
- Alert governance channels on flag events
QuestionPaused / QuestionUnpaused
Admin controls to pause/resume resolution.- Paused questions cannot be resolved
- Track pause duration for SLA monitoring
- Distinguish from flagging (flagging also sets pause)
Setting Up Event Listeners
Using ethers.js
Using Viem
Querying Historical Events
Best Practices
1. Monitor All Lifecycle Events
Track the complete flow:2. Set Up Alerts
High Priority:QuestionFlagged- Admin intervention requiredQuestionManuallyResolved- Governance action taken- Multiple
QuestionResetevents for same questionID
QuestionPaused- Resolution blocked- Resolution with
0.5 etherprice (tie/unknown)
3. Correlate with Optimistic Oracle Events
Monitor OO events for complete visibility:ProposePrice- Someone proposed an answerDisputePrice- Proposal was disputedSettle- OO finalized the price
4. Store Event Data
Persist events to a database for:- Historical analysis
- Dispute tracking
- Performance metrics
- Audit trails
5. Handle Reorgs
Implement reorg-safe event processing:Event Data Interpretation
Question State from Events
Derive question state from event history:Resolution Outcome Analysis
Integration Examples
Dashboard Metrics
See Also
- Troubleshooting - Common issues and debugging
- Market States - State transitions
- Admin Functions - Administrative controls