The Resolution Problem
Every prediction market must answer one question at deadline: did the event happen or not? The quality of this answer determines whether the market produced a useful signal or a worthless one. Prophet delegates resolution to an AI oracle agent that runs on 0G Compute — a decentralized GPU inference network. The oracle uses DeepSeek V3 (testnet: Qwen 2.5 7B) to reason about the outcome, writes its full chain-of-thought to 0G Storage, and posts only the verdict on-chain. Anyone can verify the reasoning independently.Market Lifecycle
Step 1: Open → PendingResolution
When a market’sdeadline timestamp passes, the market is eligible for resolution. Any address (not just the oracle) can call:
ResolutionTriggered event and sets the market status to PendingResolution. This open-trigger design ensures markets resolve even if the oracle is temporarily offline — anyone can initiate the process.
The oracle agent listens for ResolutionTriggered events. It also runs a periodic scan every 5 minutes to catch any expired markets it may have missed.
Step 2: Oracle Agent Runs Inference
When the oracle receives a resolution trigger, it executes the following sequence:1
Read metadata from 0G Storage
The oracle fetches the market’s metadata (question, resolution criteria, approved sources, deadline) from 0G Storage using the root hash stored in the market contract.
2
Call 0G Compute (inference)
The oracle calls the 0G Compute endpoint with a structured prompt. It uses the
@0glabs/0g-serving-broker SDK to get the provider’s endpoint, verify TEE attestation, and send the inference request.3
Check confidence threshold
If the model returns confidence below 70%, the oracle marks the result as inconclusive and may extend the resolution window or trigger a second inference pass. A market is never resolved on a low-confidence reading.
4
Write reasoning to 0G Storage
Before posting anything on-chain, the oracle uploads the full reasoning object to 0G Storage:The upload returns a root hash (e.g.,
0xabc123...).5
Post verdict on-chain
The oracle calls
postResolution(verdict, reasoningHash) where reasoningHash is the 0G Storage root hash. This permanently links the on-chain verdict to the off-chain reasoning.Step 3: The Challenge Window (Challenged Status)
AfterpostResolution is called, the market enters Challenged status with a 24-hour challenge window. During this window:
- The market is not yet finalized — no payouts distributed, no positions revealed
- Anyone can file a challenge by calling
fileChallenge()and posting a bond - If no challenge is filed, the window expires and the verdict is accepted
Filing a Challenge
- Bond must be at least 5% of the total pool or 50 USDT minimum (whichever is larger)
- Only one challenge per market
- Bond is returned if the challenge is upheld, forfeited if the oracle’s original verdict is confirmed
ResolutionChallenged event.
Step 4a: No Challenge → finalizeResolution
If the 24-hour window expires with no challenger (contract’schallenger field remains the zero address), anyone can call:
Resolved and emits ResolutionFinalized. The oracle agent listens for this event and proceeds to reveal positions and distribute payouts.
Step 4b: Challenge Filed → Second Inference
If a challenge is filed, the oracle agent runs a second, independent inference pass — potentially with additional context or a different prompt structure. The result of the second inference determines the final verdict:- If the second inference confirms the original verdict: challenge is rejected, challenger’s bond is forfeited to the protocol
- If the second inference overturns the original verdict: challenge is upheld, challenger receives their bond back plus a portion of the forfeited oracle fee
finalizeResolution is called and the market moves to Resolved.
Step 5: Position Reveal and Payout
AfterResolutionFinalized is emitted, the oracle agent calls:
redeemWinningShares() on MarketContract to collect their payout.
Why Reasoning Is Stored on 0G Storage
The reasoning hash in the contract is not just a convenience — it is a commitment to accountability.- Permanent: 0G Storage Log layer is immutable. The reasoning cannot be deleted or altered.
- Verifiable: Anyone with the root hash can download the exact JSON the oracle submitted.
- Tamper-proof: The hash stored on-chain must match the content in 0G Storage. If they disagree, the resolution is fraudulent — detectable by anyone.
- Complete: The full reasoning, not a summary, is stored. Every source the model considered, every piece of evidence, every confidence estimate.
Confidence Threshold
The oracle will not post a verdict if its confidence is below 70%. In these cases:- The market may extend its resolution window if the contract supports it
- The oracle logs the inconclusive result to 0G Storage
- A second inference pass is triggered with a longer reasoning budget
cancelMarket(), which enables redeemCancelledShares() for all participants.
Oracle Prompt Design
The oracle uses a fixed system prompt and a structured user prompt. Temperature is set to 0.1 for deterministic, consistent reasoning. The model is instructed to respond only in valid JSON — no preamble, no markdown.Challenge Economics
The challenge bond mechanism is designed to align incentives:
The bond requirement (5% of pool or 50 USDT minimum) ensures that challenges are only filed by participants with genuine conviction — random challenges are economically irrational.