AI-powered cross-platform prediction market resolution on Chainlink CRE
Quantish Oracle aggregates data from Polymarket, Kalshi, and Limitless to create, monitor, and resolve prediction markets using Chainlink's decentralized oracle network with AI-assisted settlement.
┌─────────────────────────────────────────────┐
│ Chainlink DON (CRE) │
│ │
HTTP Request ───► │ ┌──────────────────┐ │
"Create market" │ │ Market Creator │ ─── DON Report ───► │ ──► QuantishOracle.sol
│ │ (HTTP Trigger) │ (create market) │ on Sepolia
│ └──────────────────┘ │
│ │
Every 5 min ────► │ ┌──────────────────┐ │
(Cron) │ │ Price Aggregator │ ─── DON Report ───► │ ──► _updatePriceFeed()
│ │ (Cron Trigger) │ (0x02 prefix) │ Cross-platform prices
│ └──────────────────┘ │
│ │
SettlementReq ──► │ ┌──────────────────┐ ┌──────────┐ │
(on-chain event) │ │ Market Resolver │──►│ Gemini AI │ │
│ │ (Log Trigger) │◄──│ + Search │ │ ──► _settleMarket()
│ └──────────────────┘ └──────────┘ │ AI-powered resolution
└─────────────────────────────────────────────┘
│
┌──────────────────────┼──────────────────────┐
▼ ▼ ▼
Polymarket Kalshi Limitless
(CLOB API) (DFlow/Solana) (Base L2)
- Terminal demo (mp4) - All 3 workflows compiling + simulating
- Terminal demo (asciinema) - Interactive playback
-
Market Creator (HTTP Trigger) - Creates on-chain prediction markets from any question. Encodes the question, generates a DON-signed report, and writes it to the QuantishOracle contract.
-
Price Aggregator (Cron Trigger) - Every 5 minutes, reads on-chain market data and aggregates YES prices from Polymarket, Kalshi, and Limitless. Detects cross-platform arbitrage opportunities (>5% spread). Writes price feeds via DON consensus.
-
Market Resolver (Log Trigger) - Listens for
SettlementRequestedevents. Reads the market question from the contract, fetches cross-platform price data, queries Gemini AI with Google Search grounding for real-world verification, and writes the settlement outcome (YES/NO + confidence score) via DON-signed report.
Existing prediction market oracles use single-source price feeds. Quantish Oracle is the first to:
- Aggregate across 3 platforms (Polymarket, Kalshi, Limitless) for cross-platform consensus
- Use AI with real-time search (Gemini + Google Search) for event verification before settlement
- Detect arbitrage between platforms as a signal for market health
- Store cross-platform price feeds on-chain for transparency and composability
QuantishOracle.sol extends a base prediction market with:
- Report routing via prefix bytes: no prefix = create market,
0x01= settle,0x02= update price feed - PriceFeed struct storing per-market prices from each platform with timestamps
- Cross-platform settlement requiring both AI confidence and platform price consensus
- Chainlink CRE (Runtime Environment) - TypeScript workflows compiled to WASM, running on Chainlink DONs
- Solidity (0.8.24) - Smart contracts with OpenZeppelin, compiled via Foundry
- Gemini AI (2.0 Flash via OpenRouter) - AI-powered market resolution
- Quantish Discovery API - Cross-platform market data aggregation
- Sepolia Testnet - Ethereum testnet deployment
quantish-oracle/
├── contracts/
│ └── src/
│ ├── QuantishOracle.sol # Main contract
│ └── interfaces/
│ ├── IReceiver.sol # CRE receiver interface
│ └── ReceiverTemplate.sol # CRE receiver base
├── market-creator/ # Workflow 1: HTTP → Create Market
│ ├── main.ts # Entry point (HTTP trigger)
│ ├── httpCallback.ts # Handler logic
│ ├── workflow.yaml # CRE workflow config
│ └── config.staging.json # Staging chain config
├── price-aggregator/ # Workflow 2: Cron → Price Feed
│ ├── main.ts # Entry point (Cron trigger)
│ ├── cronCallback.ts # Handler logic
│ ├── workflow.yaml # CRE workflow config
│ └── config.staging.json # Staging chain config
├── market-resolver/ # Workflow 3: Log → AI Settlement
│ ├── main.ts # Entry point (Log trigger)
│ ├── logCallback.ts # Handler logic
│ ├── gemini.ts # AI integration (OpenRouter)
│ ├── workflow.yaml # CRE workflow config
│ └── config.staging.json # Staging chain config
├── project.yaml # CRE project settings
├── secrets.yaml # Secret mappings
└── .env.example # Environment template
- Bun (runtime)
- CRE CLI v1.1.0+
- Foundry (Solidity toolchain)
- OpenRouter API key (from openrouter.ai)
- Sepolia testnet ETH
# Clone
git clone https://github.com/joinQuantish/quantish-oracle.git
cd quantish-oracle
# Configure
cp .env.example .env
# Edit .env with your private key and OpenRouter API key
# Install dependencies
cd market-creator && bun install && cd ..
cd price-aggregator && bun install && cd ..
cd market-resolver && bun install && cd ..
# Authenticate CRE
cre login
# Compile contracts
cd contracts && forge build && cd ..cd contracts
forge create --rpc-url <YOUR_RPC_URL> \
--private-key <YOUR_KEY> \
--broadcast \
src/QuantishOracle.sol:QuantishOracle \
--constructor-args <FORWARDER_ADDRESS>Update config.staging.json in each workflow with the deployed contract address.
# Market Creator - create a new prediction market
cre workflow simulate ./market-creator \
--non-interactive --trigger-index 0 \
--http-payload '{"question":"Will Bitcoin reach 150k by end of 2026?"}'
# Price Aggregator - fetch cross-platform prices
cre workflow simulate ./price-aggregator \
--non-interactive --trigger-index 0
# Market Resolver - requires a SettlementRequested event tx hash
cre workflow simulate ./market-resolver \
--non-interactive --trigger-index 0 \
--evm-tx-hash <TX_HASH> --evm-event-index 0- Prediction Markets ($16K / $10K / $6K) - Cross-platform aggregation oracle
- CRE & AI ($17K / $10.5K / $6.5K) - Gemini AI-powered market resolution
- Tenderly ($2K / $1K / $500) - Virtual TestNet deployment
Quantish is an AI-powered prediction market infrastructure platform. We build MCP servers, trading agents, and aggregation tools for Polymarket, Kalshi, and Limitless.
- 800+ wallets connected
- 188K+ orders processed
- $327K+ trading volume
- Open source: github.com/joinQuantish
MIT