ai-odds-maker

AI-powered prediction markets with real-time odds generation on 0G infrastructure.

Repo

About

## Wave 2 submission

AI Odds Maker - Wave 2 Update

This wave, we built the complete foundation for AI Odds Maker, an autonomous prediction market protocol powered by 0G infrastructure.

Smart Contracts (Solidity):

- MarketContract: Binary YES/NO AMM with constant product pricing, 1% trading fees, and slippage protection - LiquidityPool: Protocol-owned liquidity management for autonomous market-making - OddsOracle: AI odds submission and market resolution with authorized agent system - OddsMakerFactory: Market deployment, registry, and lifecycle management - 232+ contract tests passing via Foundry

Agent (TypeScript):

- 0G Compute integration for AI odds generation from real-time data analysis - 0G Storage client for market metadata, odds history, and audit trails - Odds Maker Agent: Monitors markets every 30s, generates odds via AI, stores results on-chain - Oracle Agent: Resolves expired markets using AI analysis with verifiable reasoning

Frontend (Next.js 14):

- Dashboard with live market grid and AI odds visualization - Create Market modal with deadline selection - Trade panel for YES/NO share purchasing with profit calculations - Market detail view with tabs (trade, details, odds history) - Wallet connect integration for 0G Galileo testnet

0G Integration:

- 0G Chain: All contracts deployed for Galileo testnet - 0G Compute: AI inference for odds generation and resolution - 0G Storage: Decentralized market memory and audit trails

GitHub: https://github.com/HushLuxe/ai-odds-maker

## Wave 3 submission

# AI Odds Maker — Wave 3 Updates

AI-powered prediction markets on 0G: an autonomous agent generates + updates odds via 0G Compute (TEE-verified), settles on 0G Chain, writes audit trails to 0G Storage. Wave 2 judges flagged four gaps; Wave 3 closes all four with live proof on Galileo testnet (chain 16602).

**1. Real 0G Compute — LIVE (was Math.random() mock)** Deleted `getMockResponse()`. Wired real `@0gfoundation/0g-compute-ts-sdk`: `createZGComputeNetworkBroker` → `ledger.depositFund(3 0G)` → `transferFund` (auto-acks TEE signer) → `getServiceMetadata` (returns `qwen/qwen2.5-omni-7b` at `compute-network-6.integratenetwork.work/v1/proxy`) → `fetch /chat/completions` → `processResponse` verifies the TEE signature via the `ZG-Res-Key` header. `npm run test:compute` ran 5 real inferences on Galileo, all TEE-verified; each call returns a `TeeProofEnvelope{chatId, verified, model}`. Ledger-fund tx: https://chainscan-galileo.0g.ai/tx/0xaa16d6cb0ce7ad2cd27965c8d7034e8dd9ef07eb6b13dc449c03975cc5e25eda

**2. Real 0G Storage — LIVE (was local temp dir)** Replaced `simulateUpload()` (wrote to `agent/temp/`) with real `Indexer.upload(MemData)` + `downloadToBlob(proof=true)` from `@0gfoundation/0g-storage-ts-sdk`. `npm run test:storage` on Galileo: 4 real uploads + 3 Merkle-verified downloads. Real rootHashes `0xb1adca25…08f1`, `0xefe72c8b…5c42` (verifiable on https://storagescan.0g.ai).

**3. Live Galileo deployment (was missing)** Four contracts deployed via `forge script` broadcast, deployer `0x6e73DEC7ac977F111bC4a6a67354998FB3184c4f`: - MockUSDT `0xfF425c18b983A4A211890058b50F9c579ae711Bc` - LiquidityPool `0x81DdE96A5d12711f23f842d9eB4738fc8AEf0034` - OddsOracle `0x4f15817BF0A17688344CB3B670E67Fcb5164D04A` - OddsMakerFactory `0x9c5a983Fa9C9cbF2CE862545337b05AF2514d017`

Explorer https://chainscan-galileo.0g.ai — oracle agent authorized, LP funded 50k USDT, marketMaker wired. Addresses in `contracts/deployments.json`.

**4. Test count aligned with reality (was inflated)** 85 Foundry tests, all green, doc count matches `forge test --summary` exactly: MarketContract(32) + OddsOracle(19) + OddsMakerFactory(20) + LiquidityPool(14).

**5. Agent settles on-chain (was stubbed)** Replaced `"// For now, we just log"` with real `oracle.submitOdds()` + `oracle.resolveMarket()` on-chain txs. Audit-trail blob now captures the 0G Storage rootHash + on-chain settle tx hash + TEE proof envelope.

**6. Frontend TEE proof UI (new)**

Wired real wagmi v2 + RainbowKit wallet connection with the custom 0G Galileo viem chain (16602). New `TEEProofBadge` component renders ✅ "0G Compute TEE Verified" vs ⚠️ "Fallback" per odds update, reading the agent's attestation envelope. New `useOddsHistory` hook reads real on-chain `OddsOracle.getOddsHistory(market)` — the detail-view history tab reads live contract data instead of mock data.

From the public Akindo product page. Votes, swipes and the judge score are hackfeed's own.

AI judge

Not judged yet. A free model reads this page, compares it with similar projects and this event's winners, then scores it and says what would make it win.

Still being built?

Not checked yet.

Swipe stats

0upvotes
0skips
0saves

Discussion 0

No comments yet. Ask the team something, or say what you'd use it for.

Posting as a guest. Plain text, 1,000 characters max.

Already built nearby

Closest projects by meaning and shared words. Similar isn't the same as copied: read them.