Oracle Architecture
Resolving real-world predictions is the hardest technical problem in this space. Price feeds resolve quantitative events precisely but cannot rule on a court case, a sports outcome, or a cultural shift. Human review introduces trusted parties. Decentralized dispute resolution is vulnerable to coordination attacks.
MAGMA's answer is a redundant, multi-source oracle that submits M-of-N consensus verdicts on-chain, backed by a 48-hour challenge window and a public admin dispute framework. No single key, model, or data source controls resolution.
Resolution categories
MAGMA resolves narratives across three distinct classes of claim:
| Class | What it covers | Examples |
|---|---|---|
| Empirical | Quantitative data | Asset prices, on-chain metrics, statistical measures |
| Evidential | Documented events | Court rulings, electoral results, scientific publications |
| Consensus | Collective social perception | Cultural movements, ideological shifts, platform trajectories |
Empirical and evidential claims resolve against external data and reasoning. Consensus claims use a dedicated Consensus Oracle Mode.
M-of-N oracle consensus
Resolution does not depend on a single oracle key. magma_backing_vault enforces an M-of-N
threshold: a minimum number of independent oracle signers must submit matching verdicts before
finalize_resolution can execute. Resolution is split into two on-chain instructions:
| Instruction | Who can call | Effect |
|---|---|---|
submit_oracle_resolution | Any authorized oracle signer | Writes an OracleSubmission account: signer pubkey, vote (true/false), timestamp, confidence (0–100) |
finalize_resolution | Anyone (permissionless) | Once threshold + timelock are met, counts matching submissions and executes if M-of-N agree |
finalize_resolution requires no privileged signer — once the conditions are met, anyone can
trigger distribution.
| Parameter | Testnet | Mainnet |
|---|---|---|
| Oracle threshold | 1 (single oracle) | 3 (M-of-N) |
| Resolution timelock | 0 seconds | 48 hours |
| Admin-parameter timelock | 0 seconds | 72 hours |
Testnet uses threshold = 1 for development velocity, but the account structures, instruction set,
and CPI calls are identical to mainnet. The testnet code is the exact code that will be audited.
The oracle backend runs as a Node.js / TypeScript service handling multi-source queries, weighted consensus computation, and resolution signing on cloud infrastructure with message-queue workers and distributed state. Three independent oracle processes each maintain their own signing keypair; on mainnet all three must submit matching verdicts before the on-chain threshold is met.
The oracle source stack
Twelve independent data sources feed resolution, with category-specific weights. No single source
controls an outcome. The overall resolution threshold is 70% confidence minimum across active
sources; below threshold, the challenge window opens instead of
auto-resolving, and a narrative still failing to reach 70% after the window resolves to REFUND.
| Source | Role | Categories |
|---|---|---|
| Grok (xAI) | LLM reasoning over event evidence; structured verdict with confidence | All standard categories |
| Tavily AI Search | Real-time web search and event verification | LEGAL, POLITICAL, SCIENTIFIC, GEOPOLITICAL, SPORTS, ESPORTS, EQUITIES, BUILDER |
| Perplexity | Secondary AI consensus validation | All standard categories |
| Pyth Network | Real-time on-chain price feeds; sole source for FAST narratives | MARKET (primary) |
| Switchboard | Decentralized fallback when a primary is unavailable or low-confidence | All categories |
| PandaScore | Live esports results (CS:GO, LoL, Dota 2, Valorant, Overwatch, R6, Rocket League, CoD) | ESPORTS (60%) |
| The Odds API | Game odds, spreads, player props (NFL, NBA, MLB, NHL, EPL, UFC, …); 500 req/mo, cached | SPORTS (50%) |
| Neynar | Farcaster cast search, engagement, channel metrics, follower counts | CAST (70%), SOCIAL (50%) |
| Twitter / X | Mention counts, trending topics, hashtag engagement; 100 searches/mo, cached | SOCIAL (30%) |
| DeFiLlama | Real-time TVL for 3,000+ protocols across all chains (free, no key) | ECOSYSTEM (40%) |
| Alpha Vantage | Commodity, equity, and forex data (oil USD/bbl, wheat/corn cents/bushel) | COMMODITIES (75%), EQUITIES (50%), FOREX (85%) |
| Dune Analytics | On-chain Solana metrics — TPS, active wallets, DEX volume, whale flows | ONCHAIN (70%) |
| FRED / BLS APIs | Federal Reserve and labor data — CPI, GDP, unemployment, policy | MACRO, ECONOMICS |
- RUMA oracle — deprecated; sunset June 9, 2026. References to RUMA in existing narratives remain valid through that date.
- Switchboard on-chain feeds — pending on-chain deployment; currently operating as a fallback layer, with full on-chain integration in development.
How a verdict is reached
Category-specific oracle weights
Exact weights per source are not published (see the appendix for rationale). The table below shows which sources are active per category and their approximate relative contribution. A dash means the source is not used for that category.
| Category | Pyth | Grok | Tavily | Perplexity | Switchboard | Specialist source |
|---|---|---|---|---|---|---|
| MARKET | 40% | 25% | 15% | — | 20% (fallback) | — |
| SPORTS | — | 20% | 30% | — | — | The Odds API 50% |
| ESPORTS | — | 40% | — | — | — | PandaScore 60% |
| LEGAL | — | 40% | 60% | — | — | — |
| POLITICAL | — | 35% | 65% | — | — | — |
| SCIENTIFIC | — | 40% | 60% | — | — | — |
| GEOPOLITICAL | — | 35% | 65% | — | — | — |
| ECONOMICS | — | 35% | 40% | 25% | — | FRED / BLS |
| TECHNOLOGY | — | 35% | 40% | 25% | — | — |
| SOCIAL | — | 20% | — | — | — | Neynar 50%, Twitter 30% |
| CULTURAL | — | 30% | — | 35% | — | — |
| CONVICTION | — | 30% | — | 35% | — | — |
| COMMODITIES | — | 25% | — | — | — | Alpha Vantage 75% |
| MACRO | — | 30% | — | 25% | — | FRED / BLS 45% |
| EQUITIES | — | 30% | 20% | — | — | Alpha Vantage 50% |
| FOREX | — | 15% | — | — | — | Alpha Vantage 85% |
| ECOSYSTEM | — | 30% | 30% | — | — | DeFiLlama 40% |
| ONCHAIN | — | 30% | — | — | — | Dune Analytics 70% |
| BUILDER | — | 35% | 40% | 25% | — | — |
| CAST | — | 30% | — | — | — | Neynar 70% |
| HEALTH | — | 40% | 60% | — | — | — |
| CLIMATE | — | 35% | 65% | — | — | — |
| BUSINESS | — | 35% | 40% | 25% | — | — |
| SATIRE | — | 50% | 25% | 25% | — | — |
FAST narrative oracle path
FAST narratives (5-minute duration, MARKET category only) use a simplified path:
- Pyth Network primary → Switchboard fallback.
- Grok, Tavily, and Perplexity are bypassed entirely.
- Resolution is near-instant after the deadline.
- Minimum backing: 10 USDC equivalent.
Consensus Oracle Mode
For SOCIAL, CULTURAL, and CONVICTION categories, empirical resolution is insufficient. Consensus Oracle Mode aggregates four signals:
| Signal | Source |
|---|---|
| Discourse | AI reasoning over public text — predominant framing of the claim |
| Community | On-chain Conviction-Score-weighted backing distribution across participants |
| Research | Web-search verification of proxy metrics specified at narrative creation |
| Time Horizon | Validation of measurable proxies declared by the creator at submission |
Narratives in this mode must include a Falsifiability Declaration (minimum 50 characters) and at least one measurable proxy metric. A Resolvability Score (0–100) is computed at submission; narratives scoring below 40 are rejected.
The 48-hour challenge window
After the M-of-N threshold is met, a 48-hour challenge window opens before any funds distribute. Any participant can inspect the on-chain submissions, compare them against publicly verifiable data, and raise a dispute.
The resolution pipeline
- Oracle M-of-N threshold met —
OracleSubmissionaccounts written on-chain. - 48-hour challenge window opens — anyone can audit and dispute.
- No valid challenge →
finalize_resolutionexecutes and the Forge pool distributes. - Valid challenge → admin scorecard review; resolution confirmed or corrected.
- All admin resolutions are permanently public and auditable on-chain.
Admin dispute framework
Admin reviews follow a structured scorecard covering empirical verification, narrative interpretation, and oracle-signal review:
- Single admin for clear cases.
- Escalated to two independent admins for uncertain cases.
- Automatically converted to
REFUNDif confidence is insufficient.
All admin resolutions and scorecards are permanently, publicly readable on-chain, and a scorecard must be completed before any resolution can be confirmed.
Deadline options
| Label | Duration | Oracle mode |
|---|---|---|
| FAST | 5 minutes | Pyth + Switchboard only |
| SHORT | 7 days | Full oracle stack |
| MEDIUM | 30 days | Full oracle stack |
| LONG | 90 days | Full oracle stack |
| EXTENDED | 180 days | Full oracle stack |
| YEAR | 365 days | Full oracle stack |