Search projects, hackathons, sponsors and tech

    ← All projects

    Re-Solver

    Self-resolving prediction market where AI agents price questions no oracle can settle

    Demo

    About

    Prediction markets and oracles only work when someone can eventually report the true answer. A huge class of useful questions never gets that moment: "Is this protocol's TVL growth organic or incentive farming?", "Do these wallets belong to one actor?", "Will this DAO proposal actually help the treasury?". The evidence is public on chain, but no oracle will ever settle them, so no market can pay anyone for being right. Re-solver is a working implementation of "Self-Resolving Prediction Markets for Unverifiable Outcomes" by Srinivasan, Karger and Chen (Yiling Chen, Harvard). The market resolves against itself. AI agents report a probability one at a time, and each one sees every earlier report. After every report the market closes with probability alpha, and the last agent becomes the reference. Everyone before it is paid with a cross-entropy market scoring rule against that reference: moving the price toward where it closed earns money, moving it away loses part of your bond. Because nobody knows when the market will stop, reporting your honest belief is the best strategy. Copying the previous agent earns exactly zero (Theorem 7), and the asker's total cost is provably capped by the deposit. How a market works: 1. An asker opens a market from a browser wallet and pays a deposit over x402 on Hedera. The deposit is the paper's cost bound (b·log2 + k·R), and whatever the market does not spend is refunded. 2. Registered agents discover the market and each pays its own bond over x402 from its own Hedera key. No API keys, no accounts. 3. Each round, an agent is drawn, buys its evidence from Messari standardized subgraphs on The Graph, reasons over it with an LLM and signs a probability. 4. Every report is written to Hedera Consensus Service. The stopping dice come from the running hash of the report just written, so nobody, including the operator, can predict when the market closes, and anyone can recompute it from a public mirror node. 5. Settlement is recorded on HCS, then paid out in HBAR. Books close to the tinybar. 6. Each agent's track record is written to its own ENSv2 name. Per-record permissions let an agent edit its profile but never its own score. Everything runs on Hedera testnet and Ethereum Sepolia with real payments: 20 agents, full markets with x402 deposits and bonds, HCS audit trail and on-chain settlement, all independently verified from the mirror node. The repo includes 760 offline tests and a README that maps every claim to on-chain evidence. How it's made TypeScript monorepo (pnpm): a pure mechanism package, Hedera, Graph and ENS packages, an Express API with orchestrator and settlement engine, an agent runtime, and a Vite + React frontend. 760 unit tests run offline in about 10 seconds. Mechanism. The scoring rule, market state machine and settlement were written straight from the paper and enforce its hard constraints in code: recompute it from a public mirror node. 5. Settlement is recorded on HCS, then paid out in HBAR. Books close to the tinybar. 6. Each agent's track record is written to its own ENSv2 name. Per-record permissions let an agent edit its profile but never its own score. Everything runs on Hedera testnet and Ethereum Sepolia with real payments: 20 agents, full markets with x402 deposits and bonds, HCS audit trail and on-chain settlement, all independently verified from the mirror node. The repo includes 760 offline tests and a README that maps every claim to on-chain evidence.

    How it's made

    TypeScript monorepo (pnpm): a pure mechanism package, Hedera, Graph and ENS packages, an Express API with orchestrator and settlement engine, an agent runtime, and a Vite + React frontend. 760 unit tests run offline in about 10 seconds. Mechanism. The scoring rule, market state machine and settlement were written straight from the paper and enforce its hard constraints in code: the reference is always the terminal agent (a rolling reference creates unbounded payouts, Theorem 8), reports are clipped to [0.01, 0.99], each agent joins a market once, the order is drawn lazily and never published, and a timeout is slashed but never counts as a round. Settlement asserts the telescoping budget bound and that money in equals money out. We hit one real design problem: capping losses at the bond during settlement breaks telescoping and the asker's guarantee. So the bond became a position limit instead: an agent can only move the price as far as its bond can cover, clipped when the report arrives. A small calculator also implements Theorems 1 and 4 to show how large k should be. Hedera. Three paid routes (open a market, post a bond, buy a resolved answer) use @x402/express with the Hedera exact scheme through the Blocky402 facilitator on testnet. The deposit is priced per request by the same function settlement checks against. Agents pay their own bonds with @x402/fetch and their own keys. The browser pays through Hedera WalletConnect: we reimplemented the x402 signer so the wallet signs a partially signed transfer without submitting it. HCS is both the ordered report ledger and the randomness source: the stop roll reads bytes 0-7 and the agent draw reads bytes 8-15 of the SHA-384 running hash (reusing the same bytes would make part of the pool unreachable), keeping the top 53 bits so the value never rounds to 1.0. Settlement is written to HCS before any transfer, chunked because of Hedera's per-transaction account limit, and resumable without paying a chunk twice. Hacky but important: @x402/express runs the handler before settling payment, and in a live run two agents joined without paying. We now undo a paid route's effect before the 402 response is written. The Graph. Agents read Messari standardized subgraphs through the Graph gateway (Curve as subject, SushiSwap, Bancor V3, Saddle and Uniswap V2 as peers, the Arbitrum bridge). Five data slices (liquidity, holders, activity, bridge, comparative) turn raw rows into derived statistics. The standard schema is what makes the comparative slice possible: one query string sent unchanged to five protocols built by different teams. No two agents hold the same subset of slices, because the paper requires agents' signals to be conditionally independent, and a test enforces it. The gateway client treats any GraphQL error array as a failure (the gateway returns auth errors with HTTP 200) and includes an x402 client that decodes the 402 challenge from the payment-required header. ENSv2 (Sepolia). We deployed our own UserRegistry and PermissionedResolver proxies from ENSv2's VerifiableFactory under unverifiable.eth and minted agent-01 to agent-20. Agent Hedera accounts use ECDSA secp256k1 keys, so the same key pays bonds, signs reports and owns the ENS name. Names are minted with roleBitmap = 0, so an agent cannot swap its resolver, transfer or delete its name. Resolver permissions are granted per text key, so the agent can write description or endpoint but not score.*. We proved every rule on Sepolia with one test name before minting twenty. Registration checks on chain that an agent owns the ENS name it claims, and after every settlement the orchestrator writes each agent's record in one multicall. Contract addresses came from the contracts-v2 deployment artifacts, because the docs addresses did not match Sepolia. Agents use OpenAI gpt-4o-mini with strict JSON output behind a one-function interface. Development was assisted by Claude Code, and the spec, roadmap and step log are in the repo.