> ## Documentation Index
> Fetch the complete documentation index at: https://docs.delphai.io/llms.txt
> Use this file to discover all available pages before exploring further.

# How It Works

> Understanding the delphAI oracle resolution system

## What is delphAI?

delphAI is an **AI-powered oracle** that resolves prediction markets autonomously. We don't run the markets - we resolve them. Prediction market platforms integrate our oracle to get automated, trustless resolution of their markets.

## The Resolution Flow

<Steps>
  <Step title="Platform Creates Market">
    A prediction market platform calls delphAI's smart contract to register a market for resolution.

    They provide:

    * The question to resolve
    * Resolution time (when to resolve it)
    * Resolution criteria (how to determine the outcome)
  </Step>

  <Step title="Users Bet on the Platform">
    Users interact with the prediction market platform (not with delphAI).

    They:

    * Browse markets
    * Place bets
    * Manage their positions

    All betting happens on the platform's own contracts.
  </Step>

  <Step title="delphAI Resolves at Scheduled Time">
    When the resolution time arrives, delphAI's AI automatically:

    * Fetches data from specified sources
    * Analyzes the information
    * Determines the outcome
    * Submits the resolution onchain
  </Step>

  <Step title="Platform Handles Payouts">
    The platform receives delphAI's resolution and:

    * Updates the market state
    * Calculates winnings
    * Allows users to claim their rewards

    All payouts happen on the platform's side.
  </Step>
</Steps>

## delphAI's Role

<CardGroup cols={2}>
  <Card title="What We Do" icon="check" color="#D4AF37">
    * Resolve markets with AI
    * Fetch and verify data
    * Submit outcomes onchain
    * Provide resolution proofs
  </Card>

  <Card title="What We Don't Do" icon="xmark" color="#666">
    * Host prediction markets
    * Handle user bets
    * Manage user funds
    * Process payouts
  </Card>
</CardGroup>

## Architecture

```mermaid theme={null}
graph TB
    A[Prediction Market Platform] -->|Requests Resolution| B[delphAI Oracle]
    C[Users] -->|Place Bets| A
    B -->|Queries Data| D[Data Sources]
    D -->|Returns Data| B
    B -->|AI Analysis| E[Resolution Decision]
    E -->|Submit Result| F[Blockchain]
    F -->|Resolution Event| A
    A -->|Distributes Winnings| C
```

## How Resolution Works

### 1. Data Collection

When resolution time arrives, delphAI:

* Queries the data sources specified in the resolution criteria
* Fetches multiple sources for verification
* Validates data integrity

### 2. AI Analysis

The AI evaluates the data against the resolution criteria:

* Parses the question and criteria
* Applies logic to the fetched data
* Determines the outcome (YES/NO or multi-choice)
* Generates confidence score

### 3. Onchain Submission

If confidence threshold is met:

* delphAI submits the resolution to the blockchain
* Includes cryptographic proof of data sources
* Emits resolution event
* Platform contracts receive the callback

## Example Resolution

**Market Question**: "Will Bitcoin reach \$100,000 by December 31, 2025?"

**Resolution Criteria**: "Use CoinGecko API. Check BTC price at 23:59:59 UTC on Dec 31, 2025. YES if >= \$100,000, NO otherwise."

**Resolution Process**:

<Steps>
  <Step title="Trigger">
    Clock hits Dec 31, 2025, 23:59:59 UTC → delphAI activates
  </Step>

  <Step title="Data Fetch">
    Queries CoinGecko API for BTC price → Returns \$105,432
  </Step>

  <Step title="Analysis">
    AI checks: Is $105,432 >= $100,000? → YES
  </Step>

  <Step title="Submit">
    Submits outcome = YES to smart contract with proof
  </Step>

  <Step title="Platform Settlement">
    Platform receives YES outcome → Distributes winnings to YES bettors
  </Step>
</Steps>

## Data Sources

delphAI can resolve markets using various data sources:

<AccordionGroup>
  <Accordion title="Price Data" icon="dollar-sign">
    * CoinGecko, CoinMarketCap for crypto prices
    * Traditional finance APIs
    * DEX price feeds
  </Accordion>

  <Accordion title="Sports Results" icon="futbol">
    * Official sports league APIs
    * ESPN, The Sport DB
    * Verified sports data providers
  </Accordion>

  <Accordion title="Real-world Events" icon="globe">
    * News APIs
    * Government databases
    * Official announcement channels
  </Accordion>

  <Accordion title="Onchain Data" icon="link">
    * Blockchain events
    * Smart contract states
    * Token transfers
  </Accordion>
</AccordionGroup>

## Security & Trust

### How Do You Trust delphAI?

<CardGroup cols={2}>
  <Card title="Verifiable Data Sources" icon="shield-check">
    All data sources are specified upfront in resolution criteria. Anyone can verify.
  </Card>

  <Card title="Cryptographic Proofs" icon="key">
    Each resolution includes proof of the data fetched and how it was analyzed.
  </Card>

  <Card title="Open Source AI" icon="code">
    Resolution logic is transparent and auditable.
  </Card>

  <Card title="Dispute Mechanism" icon="gavel">
    Contested resolutions can be challenged (with stake).
  </Card>
</CardGroup>

### What If delphAI Goes Down?

* Markets have fallback resolution mechanisms
* Platforms can implement backup oracles
* Time-based emergency resolution available

## Integration Benefits

Why platforms integrate delphAI:

<CardGroup cols={3}>
  <Card title="Instant Resolution" icon="bolt">
    No waiting for manual resolution - happens at exact scheduled time
  </Card>

  <Card title="Trustless" icon="shield">
    No human bias or manipulation - pure data-driven outcomes
  </Card>

  <Card title="Scalable" icon="chart-line">
    Resolve unlimited markets simultaneously
  </Card>

  <Card title="Cost-Effective" icon="coins">
    Cheaper than manual oracle systems
  </Card>

  <Card title="24/7 Automated" icon="clock">
    Works around the clock without human intervention
  </Card>

  <Card title="Transparent" icon="eye">
    All resolutions verifiable onchain with proofs
  </Card>
</CardGroup>

## Next Steps

<CardGroup cols={2}>
  <Card title="Integrate delphAI" icon="plug" href="/quickstart">
    Start integrating the oracle into your platform
  </Card>

  <Card title="Resolution Criteria" icon="list-check" href="/ai-oracle/resolution-criteria">
    Learn how to write effective resolution criteria
  </Card>

  <Card title="Smart Contracts" icon="file-contract" href="/contracts/oracle-contract">
    Explore the oracle contract API
  </Card>

  <Card title="AI Oracle Details" icon="brain" href="/ai-oracle/overview">
    Deep dive into how the AI works
  </Card>
</CardGroup>
