Intelligent Oracle Contracts
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.
Contracts Overview
IntelligentOracle
The IntelligentOracle
contract serves as an AI-powered oracle that can resolve prediction market outcomes by analyzing web content using Large Language Models (LLMs).
Key Features
- 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
Initialization Parameters
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 URLsresolution_urls
: Predefined URLs for resolutionearliest_resolution_date
: Earliest date when the oracle can be resolved
Registry
The Registry
contract maintains a list of deployed intelligent oracle contracts, serving as a central directory.
Features
- Contract Registration: Stores addresses of deployed oracle contracts
- Address Retrieval: Provides access to all registered oracle addresses
Resolution Process
- 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
Status States
ACTIVE
: Oracle is active but not yet resolvedRESOLVED
: Oracle has successfully determined an outcomeERROR
: Resolution failed or produced invalid outcomeUNDETERMINED
: Resolution cannot be determined
Technical Notes
- 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