Overview
DelphAI emits events for all important state changes. These events can be indexed by platforms for real-time updates, historical data, and user interfaces.Market Events
MarketCreated
Emitted when a new prediction market is created.marketId(indexed) - Unique market identifiercreator(indexed) - Address that created the marketquestion- The market questiondescription- Additional context and resolution criteriapossibleOutcomes- Array of possible outcome stringscreatedAt- Block timestamp when market was createdresolutionTimestamp- When the market should be resolved
MarketResolved
Emitted when the AI resolver resolves a market.marketId(indexed) - The market identifieroutcomeIndex- Index of the winning outcome inpossibleOutcomesarrayoutcome- The actual outcome string that was selectedresolver(indexed) - Address that resolved the marketresolutionData- AI explanation and reasoning for the resolutionresolutionSources- Array of source URLs used for resolutionresolutionConfidence- Confidence level of the resolution (0-100)proofData- TEE attestation or cryptographic proofresolvedAt- Block timestamp when resolved
MarketCancelled
Emitted when a market is cancelled before resolution.marketId(indexed) - The market identifiercancelledBy(indexed) - Address that cancelled the market (creator or owner)cancelledAt- Block timestamp when cancelled
Admin Events
FeeUpdated
Emitted when the market creation fee is changed.oldFee- Previous fee amount in weinewFee- New fee amount in wei
ResolverUpdated
Emitted when the authorized resolver address is changed.oldResolver(indexed) - Previous resolver addressnewResolver(indexed) - New resolver address
FeesWithdrawn
Emitted when accumulated fees are withdrawn.to(indexed) - Recipient addressamount- Amount withdrawn in wei
TokensRecovered
Emitted when ERC20 tokens are recovered from the contract.token(indexed) - ERC20 token addressto(indexed) - Recipient addressamount- Amount recovered
Querying Historical Events
Get All Markets Created
Get Markets by Creator
Get All Resolutions
Get Specific Market Resolution
Real-Time Monitoring
Complete Event Listener Setup
Event Indexing with The Graph
Example subgraph schema for indexing DelphAI events:Next Steps
Oracle Contract
View complete contract API reference
Integration Guide
Learn how to integrate DelphAI
Market Lifecycle
Understand the market lifecycle
Examples
View example implementations
