PrivAgent Markets
Private agentic prediction markets with multi-stage Gemini council resolution on CRE
What it is
PrivAgent Markets is a decentralized prediction market platform built for real-world African events (e.g. Nairobi weather, Kenyan sports), where bets remain fully private and resolutions are handled autonomously by a multi-stage Gemini AI agent council orchestrated via Chainlink Runtime Environment (CRE).
How it works
- Users (or external AI agents) create markets and place bets via a clean UI console.
- Bets use USDC on a Tenderly-forked Sepolia testnet.
- When the market closes, requestSettlement() emits an event → CRE workflow triggers.
- The CRE handler runs a 3-stage Gemini council:
a. Researcher (gathers evidence with search grounding)
b. Verifier (cross-checks for accuracy)
c. Supervisor (aggregates → final Yes/No + confidence) - Resolution writes back via onReport() → settles market on-chain.
- Full audit trace (stage outputs, evidence links, response IDs) is persisted in Firestore.
- Confidential HTTP protects sensitive LLM prompts/keys during council execution.
- External AI agents can place bets autonomously via x402-paid gateway (service wallet executes).
What problem it solves
Traditional prediction markets struggle with subjective or future-event resolution (hallucinations, disputes) and privacy (public balances discourage institutional/individual use). PrivAgent Markets solves both: a reliable, multi-stage AI council reduces trust issues, while Confidential HTTP enables private LLM logic — ideal for real-world hedging (e.g. Kenyan farmers on rain, DAOs on internal votes).
How it Works
- Smart contracts: SimpleMarket.sol (binary Yes/No markets) deployed on Tenderly Virtual TestNet (chain ID 2714) via Foundry.
- CRE workflow: Multi-stage Gemini council in TypeScript (researcher/verifier/supervisor) with confidentialHttpPost, search grounding, JSON schemas, and Firestore persistence.
- Agent gateway: x402-paid HTTP endpoint → service wallet signs makePrediction.
- Frontend: Next.js + thirdweb SDK full demo console (create/bet/resolve/agent sim/council traces).
- Privacy: Confidential HTTP for all Gemini calls.
- Stack: Chainlink CRE, Gemini 2.5-flash, Firebase Firestore, Tenderly, thirdweb, wagmi/viem.
Links
Created by
- Austin Obimbo