All projects

GeoChain

Autonomous prediction markets powered by Chainlink CRE + Gemini AI with cross-chain sync and agent trading.

CRE & AI Prediction Markets DeFi & Tokenization

What it is

What is GeoChain?

GeoChain is an end-to-end prediction market infrastructure that removes humans from every operational bottleneck — market creation, settlement, price synchronization, liquidity management, and even trade execution are all handled autonomously through Chainlink CRE workflows and Google Gemini AI.

How does it work?

At the protocol level, users trade binary YES/NO outcome tokens backed by USDC through a constant-product AMM. But the real innovation lives in the layers above and around the market contracts:

  • AI-Driven Resolution: When an event's resolution time arrives, a CRE cron workflow triggers Gemini AI (with Google Search grounding) to evaluate the real-world outcome. The AI is prompt-engineered to be adversarial-resistant — it requires source URLs, handles edge cases like cancellations or contradictory evidence, and returns INCONCLUSIVE rather than forcing a bad outcome. The result is packaged as a signed CRE report and delivered on-chain, where a dispute window opens before finalization.

  • Hub-Spoke Cross-Chain Architecture: A hub factory on Arbitrum Sepolia acts as the source of truth. It broadcasts canonical prices and resolution outcomes to spoke factories (e.g., Base Sepolia) via Chainlink CCIP. Spoke markets enforce multi-tier deviation bands — direction restrictions, fee surcharges, output caps, and circuit breakers activate progressively if local prices drift from the hub canonical price.

  • Full Lifecycle Automation: Beyond resolution, CRE workflows create new markets (Gemini generates unique event ideas), top up factory USDC balances, sync prices across chains, arbitrage unsafe price deviations, adjudicate expired dispute windows, process pending LP withdrawals, credit fiat payments, and detect ETH deposits via log triggers — nine distinct automated operations running without human intervention.

  • Agent-Native Trading: Users grant scoped on-chain permissions (action mask, amount cap, expiry) to AI agents through the router contract. A dedicated CRE workflow (agents-workflow) exposes HTTP handlers for plan → sponsor → execute → revoke. Six layers of defense-in-depth protect users: CRE authorized keys, sponsor policy with EIP-712 session signatures, Firestore one-time approvals with nonce replay protection, execute policy action allowlists, on-chain _authorizeAgent() checks, and router balance limits. Funds never leave the router — the agent is a scoped executor, not a custodian.

  • Cross-Chain Claim Bridge: A dedicated bridge contract lets users lock resolved outcome tokens on one chain and mint wrapped claim tokens on another via CCIP, enabling position portability after settlement.

  • Gasless UX: Users sign EIP-712 typed data off-chain. CRE validates the signature, creates an approval, and submits the transaction — no gas required for minting, swapping, redeeming, LP operations, or disputes.

What problem does it solve?

Today's prediction markets suffer from exploitable single-oracle resolution (as seen with UMA-based disputes on Polymarket), single-chain liquidity fragmentation, manual operations at every lifecycle step, zero infrastructure for AI agent participation, and no cross-chain position portability. GeoChain addresses all five of these problems in a single protocol stack built on Chainlink's decentralized infrastructure..

How it Works

GeoChain is built across three layers:

Smart Contracts (Solidity 0.8.33 / Foundry)

  • PredictionMarket — modular contract split into Base, Liquidity, and Resolution modules for AMM trading, LP operations, dispute windows, and CRE report processing
  • MarketFactory — UUPS upgradeable factory with Base, CCIP, and Operations modules for market registry, hub-spoke CCIP sync, and CRE report dispatch
  • PredictionMarketRouterVault — user credit management, gasless sponsored execution, and on-chain agent permission enforcement with actionMask, maxAmountPerAction, and expiresAt
  • PredictionMarketBridge — CCIP-powered cross-chain lock/mint/burn/unlock for outcome token portability
  • Libraries: AMMLib (constant-product math), FeeLib (fee calculation), MarketTypes (shared types), CanonicalPricingModule (deviation band enforcement)
  • OpenZeppelin: UUPS proxy, ReentrancyGuard, Pausable, ERC-20

CRE Workflows (TypeScript / @chainlink/cre-sdk)

  • market-workflow — 9 cron handlers (market creation, resolution, liquidity top-up, price sync, arbitrage, dispute adjudication, withdrawal processing, manual review sync), 4 HTTP handlers (sponsor, execute, revoke session, fiat credit), and 1 EVM log handler (ETH deposit credit)
  • agents-workflow — dedicated CRE deployment with 4 HTTP handlers for AI agent trading (plan, sponsor, execute, revoke)
  • Gemini AI integration for market creation, resolution evaluation, and dispute adjudication with Google Search grounding
  • Firebase Firestore for workflow state management and audit trails

Frontend (React + TypeScript + ethers.js)

  • App.tsx — user-facing market trading UI (view events, trade, deposit, redeem)
  • AgentApp.tsx — agent delegation UI (set permissions, plan/sponsor/execute trades, session revocation)
  • Browser-local session key generation for gasless operation

Deployed on: Arbitrum Sepolia (hub) and Base Sepolia (spoke)

Links

Created by

  • Himxa