Swarm Oracle Protocol
A decentralized AI committee that automatically resolves prediction markets via multi-model consensus.
What it is
UMA's optimistic oracle has a structural conflict of interest: the token holders who vote on market resolutions can simultaneously hold bets on those markets. When rigging profit exceeds the 0.05% slashing penalty, whales vote against reality, and they have. The $7M Ukraine deal, the $160M Zelensky suit dispute, and the $11M Venezuela case all resolved incorrectly because large UMA holders found it cheaper to buy the vote than accept the outcome. Retail stakers skip voting entirely because gas costs make it irrational, which only makes manipulation cheaper.
Swarm Oracle Protocol (SOP) breaks this cycle. Users delegate UMA tokens to a smart contract vault. When a market needs resolution, the protocol consolidates all voting power into a single on-chain transaction, eliminating gas redundancy. Resolution is handled by an AI committee: independent LLMs from different companies and geographies (OpenAI, Anthropic, Google, DeepSeek). Each model receives identical context, the market rules plus live news from verified outlets, and returns an independent verdict. Consensus requires >50% majority with a minimum quorum of 3. If the models disagree, no vote is cast.
Chainlink is needed because the entire pipeline, from detecting events to fetching news to calling AI APIs to signing transactions, must be tamper-proof. CRE runs AI calls inside a Trusted Execution Environment where API keys are injected via DON Secrets and never exposed. The DON cryptographically signs every verdict before it touches the chain. News is fetched through Chainlink's HTTP capability, ensuring factual context is verifiable and not fabricated.
Fairness is enforced through geographic model diversity (US + China providers), identical prompts, strict quorum + majority rules, and role-based access control on-chain where only the authenticated CRE workflow can write verdicts.
How it Works
SOP is built as a three-layer decentralized application spanning a frontend, an off-chain AI orchestration engine, and on-chain smart contracts.
- Frontend (Next.js + React): A brutalist, black-and-white Staking Hub where users connect their wallet, delegate UMA tokens, and trigger the AI consensus process on live Polymarket events. Built with wagmi and RainbowKit for seamless Web3 wallet integration.
- Smart Contracts (Solidity / Foundry): A single smart contract, SOPVault, serves as both the staking vault and the CRE execution target. It pools delegated UMA tokens, enforces strict role-based access so only the Chainlink DON can trigger votes, and handles the consolidated on-chain UMA vote on behalf of all stakers.
- AI Swarm Orchestration (TypeScript / Node.js): The core intelligence layer orchestrates four geographically and ideologically diverse LLMs (OpenAI, Anthropic, Google, DeepSeek) to independently analyze a market question and produce a deterministic consensus verdict. A Source Weight Algorithm ensures the AI committee prioritizes tier-one journalism over unverified social media when evaluating facts.
- Chainlink Integration — the Security Backbone:
- Standard HTTP: Before voting, the workflow fetches live news articles from verified outlets (Reuters, CNN, BBC) to ground the AI agents in real-world facts and eliminate hallucination risk.
- Confidential HTTP (CRE): All AI API calls are executed inside a Chainlink Confidential Runtime Environment (TEE). API keys never leave the enclave, and every AI response is cryptographically attested as tamper-proof before being processed. The DON then signs the final verdict and submits a single on-chain transaction directly to the vault contract — completing a fully autonomous, verifiable, end-to-end pipeline from market question to on-chain vote.
Links
Created by
- Kerem Eskici