This repository contains the Intelligent Contracts for an AI-powered oracle system that can resolve prediction markets using natural language processing and web data analysis.
The IntelligentOracle
contract serves as an AI-powered oracle that can resolve prediction market outcomes by analyzing web content using Large Language Models (LLMs).
- Flexible Data Sources: Supports both predefined resolution URLs and dynamic evidence URL validation
- Multiple Outcome Support: Handles multiple potential outcomes for prediction markets
- Rule-based Resolution: Uses natural language rules to guide the resolution process
- AI-Powered Analysis: Leverages LLMs to analyze web content and determine outcomes
- Domain Validation: Ensures evidence URLs come from trusted domains
- Time-locked Resolution: Prevents resolution before a specified date
prediction_market_id
: Identifier for communication with the prediction markettitle
: Title of the oracledescription
: Detailed description of what is being predictedpotential_outcomes
: Comma-separated list of possible outcomesrules
: Comma-separated list of resolution rulesdata_source_domains
: Allowed domains for evidence URLs. If set,resolution_urls
need to be empty.resolution_urls
: Predefined URLs for resolution. If set,data_source_domains
need to be empty.earliest_resolution_date
: Earliest date when the oracle can be resolved
The Registry
contract maintains a list of deployed intelligent oracle contracts, serving as a central directory.
- Contract Registration: Stores addresses of deployed oracle contracts
- Address Retrieval: Provides access to all registered oracle addresses
- The oracle waits until the
earliest_resolution_date
- Resolution can be triggered by providing evidence URLs (if configured) or using predefined resolution URLs
- The system:
- Fetches and validates web content
- Processes data using LLMs
- Analyzes multiple sources if available
- Determines the final outcome
- Updates the contract state
ACTIVE
: Oracle is active but not yet resolvedRESOLVED
: Oracle has successfully determined an outcomeERROR
: Resolution failed or produced invalid outcome
- The system uses GenLayer for contract execution
- Global imports are currently handled in specific ways due to simulator limitations
- Contract deployment is direct rather than using a factory pattern due to current platform constraints