Skip to main content

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.
Parameters:
  • marketId (indexed) - Unique market identifier
  • creator (indexed) - Address that created the market
  • question - The market question
  • description - Additional context and resolution criteria
  • possibleOutcomes - Array of possible outcome strings
  • createdAt - Block timestamp when market was created
  • resolutionTimestamp - When the market should be resolved
Example Usage:

MarketResolved

Emitted when the AI resolver resolves a market.
Parameters:
  • marketId (indexed) - The market identifier
  • outcomeIndex - Index of the winning outcome in possibleOutcomes array
  • outcome - The actual outcome string that was selected
  • resolver (indexed) - Address that resolved the market
  • resolutionData - AI explanation and reasoning for the resolution
  • resolutionSources - Array of source URLs used for resolution
  • resolutionConfidence - Confidence level of the resolution (0-100)
  • proofData - TEE attestation or cryptographic proof
  • resolvedAt - Block timestamp when resolved
Example Usage:

MarketCancelled

Emitted when a market is cancelled before resolution.
Parameters:
  • marketId (indexed) - The market identifier
  • cancelledBy (indexed) - Address that cancelled the market (creator or owner)
  • cancelledAt - Block timestamp when cancelled
Example Usage:

Admin Events

FeeUpdated

Emitted when the market creation fee is changed.
Parameters:
  • oldFee - Previous fee amount in wei
  • newFee - New fee amount in wei
Example Usage:

ResolverUpdated

Emitted when the authorized resolver address is changed.
Parameters:
  • oldResolver (indexed) - Previous resolver address
  • newResolver (indexed) - New resolver address
Example Usage:

FeesWithdrawn

Emitted when accumulated fees are withdrawn.
Parameters:
  • to (indexed) - Recipient address
  • amount - Amount withdrawn in wei
Example Usage:

TokensRecovered

Emitted when ERC20 tokens are recovered from the contract.
Parameters:
  • token (indexed) - ERC20 token address
  • to (indexed) - Recipient address
  • amount - Amount recovered
Example Usage:

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