Skip to main content

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:

ClassWhat it coversExamples
EmpiricalQuantitative dataAsset prices, on-chain metrics, statistical measures
EvidentialDocumented eventsCourt rulings, electoral results, scientific publications
ConsensusCollective social perceptionCultural 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:

InstructionWho can callEffect
submit_oracle_resolutionAny authorized oracle signerWrites an OracleSubmission account: signer pubkey, vote (true/false), timestamp, confidence (0–100)
finalize_resolutionAnyone (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.

ParameterTestnetMainnet
Oracle threshold1 (single oracle)3 (M-of-N)
Resolution timelock0 seconds48 hours
Admin-parameter timelock0 seconds72 hours
Testnet is the audited code

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.

SourceRoleCategories
Grok (xAI)LLM reasoning over event evidence; structured verdict with confidenceAll standard categories
Tavily AI SearchReal-time web search and event verificationLEGAL, POLITICAL, SCIENTIFIC, GEOPOLITICAL, SPORTS, ESPORTS, EQUITIES, BUILDER
PerplexitySecondary AI consensus validationAll standard categories
Pyth NetworkReal-time on-chain price feeds; sole source for FAST narrativesMARKET (primary)
SwitchboardDecentralized fallback when a primary is unavailable or low-confidenceAll categories
PandaScoreLive esports results (CS:GO, LoL, Dota 2, Valorant, Overwatch, R6, Rocket League, CoD)ESPORTS (60%)
The Odds APIGame odds, spreads, player props (NFL, NBA, MLB, NHL, EPL, UFC, …); 500 req/mo, cachedSPORTS (50%)
NeynarFarcaster cast search, engagement, channel metrics, follower countsCAST (70%), SOCIAL (50%)
Twitter / XMention counts, trending topics, hashtag engagement; 100 searches/mo, cachedSOCIAL (30%)
DeFiLlamaReal-time TVL for 3,000+ protocols across all chains (free, no key)ECOSYSTEM (40%)
Alpha VantageCommodity, equity, and forex data (oil USD/bbl, wheat/corn cents/bushel)COMMODITIES (75%), EQUITIES (50%), FOREX (85%)
Dune AnalyticsOn-chain Solana metrics — TPS, active wallets, DEX volume, whale flowsONCHAIN (70%)
FRED / BLS APIsFederal Reserve and labor data — CPI, GDP, unemployment, policyMACRO, ECONOMICS
Deprecations and pending integrations
  • 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.

CategoryPythGrokTavilyPerplexitySwitchboardSpecialist source
MARKET40%25%15%20% (fallback)
SPORTS20%30%The Odds API 50%
ESPORTS40%PandaScore 60%
LEGAL40%60%
POLITICAL35%65%
SCIENTIFIC40%60%
GEOPOLITICAL35%65%
ECONOMICS35%40%25%FRED / BLS
TECHNOLOGY35%40%25%
SOCIAL20%Neynar 50%, Twitter 30%
CULTURAL30%35%
CONVICTION30%35%
COMMODITIES25%Alpha Vantage 75%
MACRO30%25%FRED / BLS 45%
EQUITIES30%20%Alpha Vantage 50%
FOREX15%Alpha Vantage 85%
ECOSYSTEM30%30%DeFiLlama 40%
ONCHAIN30%Dune Analytics 70%
BUILDER35%40%25%
CAST30%Neynar 70%
HEALTH40%60%
CLIMATE35%65%
BUSINESS35%40%25%
SATIRE50%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:

SignalSource
DiscourseAI reasoning over public text — predominant framing of the claim
CommunityOn-chain Conviction-Score-weighted backing distribution across participants
ResearchWeb-search verification of proxy metrics specified at narrative creation
Time HorizonValidation 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

  1. Oracle M-of-N threshold met — OracleSubmission accounts written on-chain.
  2. 48-hour challenge window opens — anyone can audit and dispute.
  3. No valid challengefinalize_resolution executes and the Forge pool distributes.
  4. Valid challenge → admin scorecard review; resolution confirmed or corrected.
  5. 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 REFUND if 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

LabelDurationOracle mode
FAST5 minutesPyth + Switchboard only
SHORT7 daysFull oracle stack
MEDIUM30 daysFull oracle stack
LONG90 daysFull oracle stack
EXTENDED180 daysFull oracle stack
YEAR365 daysFull oracle stack