All projects

Lien Markets

AI-powered prediction markets with autonomous settlement via Chainlink CRE and Gemini AI.

Prediction Markets World

What it is

Lien Markets is a decentralized prediction market platform where users create multi-outcome markets, place USDC bets, and markets are autonomously settled by AI through Chainlink's Compute Runtime Environment (CRE).
How it works: Users create markets with 2-10 outcomes (e.g., "Will BTC exceed $100K?") and place USDC bets. When a market closes, anyone can request settlement, this emits an on-chain event that triggers a CRE workflow. The workflow fetches real-time data from external APIs (CoinGecko for crypto, ESPN for sports, Open-Meteo for weather, Google Search for general topics), feeds it to Gemini AI for analysis, and submits a cryptographically signed settlement report back on-chain. A dispute window allows bettors to challenge outcomes by posting a 10 USDC bond, triggering a separate dispute resolution workflow. Winners claim proportional payouts (minus 2% platform fee). A third CRE workflow calculates AI-predicted odds on every bet and market creation, writing them to Firestore for the frontend to display alongside on-chain odds. World ID integration gates market creation and betting behind proof-of-humanity verification to prevent sybil attacks.
Problem it solves: Traditional prediction markets rely on centralized oracles or manual resolution, which is slow, biased, and unscalable. Lien Markets automates the entire settlement lifecycle using AI + verifiable external data, with an economic dispute mechanism as a safety net.

How it Works

How is it built?

  • Smart Contracts: Solidity deployed on Sepolia. MarketFactory.sol extends CRE's ReceiverTemplate to receive signed reports. Handles market creation, USDC betting, pari-mutuel payouts, disputes with bonding, and fee collection.
  • CRE Workflows (3): 
    (1) The Settlement workflow is triggered by SettlementRequested event, fetches category-specific data (ESPN/CoinGecko/Open-Meteo), queries Gemini AI, submits signed report on-chain.
    (2) Dispute resolution is triggered by DisputeInitiated event, re-analyzes with fresh data and enhanced scrutiny.
    (3) Odds calculator is triggered by BetPlaced and MarketCreated events, queries Gemini for AI odds predictions, writes to Firestore.
  • Frontend: Next.js 16 with Firebase for real-time AI odds display and settlement audit logs.
  • Identity: World ID for sybil-resistant verification gating market creation and bet placement.
  • AI: Google Gemini 2.5 Flash with Google Search grounding for real-time data.

Links

Created by

  • Alfred Olumide Adenigba