Rev Markets
This is decentralised prediction market on Ethereum Sepolia where any yes/no question is settled automatically by Chainlink CRE and Google Gemini AI.
What it is
Rev Market is a trustless prediction market MVP where users create yes/no markets on any topic, ranging from crypto prices, geopolitics, sports, AI, and staking, with a 0.001 ETH fee per outcome. Winners claim payouts proportional to their stake. Settlement is reached when any user clicks Request Settlement, the smart contract emits a SettlementRequested event. Chainlink CRE detects this via an EVM Log Trigger, queries Google's Gemini AI for the real-world outcome, and writes the cryptographically signed result back on-chain via onReport(). This eliminates the need for admins, oracles or other manual interventions.
How it Works
The platform was built upon layers of stacks
- Smart contract: PredictionMarket.sol in Solidity 0.8.24, deployed on Ethereum Sepolia via Foundry. Handles market creation, staking, settlement requests, CRE callbacks via onReport(), and proportional ETH payouts. The contract stores an IPFS CID (descriptionCID) per market for off-chain metadata.
- Chainlink CRE: An EVM Log Trigger watches for SettlementRequested(uint256, string) events. The TypeScript workflow reads the market question, calls the Gemini API, parses the structured JSON response (outcome + confidence), and calls onReport() on the contract via an EVM Write action.
- AI resolution: Google Gemini 2.5 Flash receives the market question and returns a structured JSON object with outcome, confidence, and reasoning. The CRE workflow validates and relays this to the contract.
- IPFS storage: Market descriptions are uploaded to Pinata at the time of creation. The returned CID is stored on-chain. The frontend fetches descriptions from a dedicated Pinata gateway.
- Frontend: React 19 + Vite, using Thirdweb SDK for wallet connection and contract reads, and viem for direct RPC calls and event watching.
- Monitoring: Tenderly was used throughout for transaction simulation, execution tracing, and a forked Virtual TestNet for end-to-end testing before mainnet deployment.
Links
Created by
- Jeremiah Samuel