Delphi
A marketplace where predictions earn their reputation.
Inspiration
I've spent a lot of time around prediction markets, and one thing kept bugging me: forecasts are cheap. Anyone can say "70% chance this happens," and if they turn out wrong, nothing happens to them. They delete the tweet, quietly change their call, or just never mention it again.
At the same time, AI agents are starting to make real decisions with real money, and they need good information to do it. So I kept wondering: what if an agent could buy a forecast for a few cents, and the person or bot who made it had to stand behind it on the record?
That's Delphi. Forecasters commit to a prediction before the outcome is known, agents pay per read, and once the market settles everyone can see who was actually right.
What it does
- Forecasters publish locked-in predictions. Each forecast is posted to Solana as a
sha256(prob || salt)commitment, so it can't be edited after the fact. Anyone with a Solana wallet can publish through a signed, permissionless protocol. - Agents pay to read them. Reads cost a small amount of devnet USDC through x402 (
exacttransfers). For agents that read multiple forecasts from the same provider, there's anuptopayment channel so they settle only delivered reads in one claim instead of paying per transaction. - Markets settle against real data. Outcomes come from Gemini Prediction Markets, and settlement requires 2 of 3 independent signers to agree via Ed25519 signatures verified on-chain, so no single party decides the result.
- Being right is what counts. After settlement, forecasters reveal their predictions and receive a Brier score that updates their shrinkage-adjusted reputation. If someone posts a forecast and never reveals it within an hour, anyone can forfeit it at the worst score and slash their USDC bond.
- A buyer agent that thinks before spending (and calls a human on big trades). It enforces strict SQLite-backed daily and per-market budgets, checks liquidity and on-chain reputation, pools purchased forecasts with reputation-weighted log-odds, sizes orders with capped fractional Kelly, and abstains when edge isn't there. For trades above a configurable dollar threshold, it places an outbound phone call through an ElevenLabs Conversational AI voice agent and proceeds only on an explicit spoken "yes".
- A live dashboard shows active Gemini markets, committed/revealed/forfeited forecasts, purchases, settlements, agent decisions, and the forecaster leaderboard.
How I built it
- On-chain (Solana / Anchor / Rust): An Anchor program deployed on Solana devnet (
EVqrBtTWaQiwnrhXzDgqr5TML6oDpHqHs5jjeLLg42Qc) handles forecaster registration, commit-reveal predictions, purchase records, 2-of-3 Ed25519 quorum settlement, Brier scoring, USDC bond escrow/slashing, and reputation. I tested the full lifecycle locally with LiteSVM. - Payments (x402 + SPL USDC):
@x402/express,@x402/fetch, and@x402/svmfor exact USDC per-read paywalls, plusuptopayment channels for bundled reads. - Voice Approval (ElevenLabs): Conversational AI outbound Twilio calls (
POST /v1/convai/twilio/outbound-call) that read the proposed trade details (symbol,side,size,edge) and gate execution on a structured boolean data-collection result. - Services (TypeScript / Node.js / Express): A forecaster service running three personas (including a
quantpersona that prices crypto strike contracts from Gemini spot and realized 1-minute volatility and abstains when there is no strike), a resolver, an independent settlement-signer tool, and the buyer agent. - Indexing (QuickNode Streams + SQLite): QuickNode Streams filters Solana devnet program activity and forecaster USDC transfers into an HMAC-SHA256-verified webhook (with an RPC polling fallback), feeding SQLite and SSE updates.
- Frontend (React / Vite): A market browser, quote charts, activity feed, agent telemetry panel, leaderboard, and built-in docs/architecture pages deployed on Vercel.
Challenges
- Payments that fail in confusing ways. The hardest bug class was a payment that got signed but where I couldn't tell whether it actually went through. I ended up reserving funds in SQLite before signing and reconciling against on-chain state before releasing anything. Boring, but it's the difference between a demo and something that loses money.
- People who don't show up. Commit-reveal only works if forecasters reveal. If someone posts a bad forecast and simply stays quiet, they shouldn't get away with it. That's why the 1-hour forfeiture window, USDC bonds, and slashing for silence exist.
- Counting earnings honestly. At first the indexer could count incoming USDC for a forecaster without a matching purchase. Now it only credits earnings when a matching
purchase_recordedevent appears in the same transaction. - Making the dashboard tell the truth. I wanted it to flag stale quotes and stream freshness honestly instead of looking live when data was old. That honesty took more work than the pretty parts.
- The usual hackathon pain. Pinning Rust versions so the test tooling compiled, staying inside devnet RPC rate limits, and chasing a responsive layout that kept clipping on the right side of the screen at certain widths.
What I learned
- Commit-reveal is a simple idea that gets complicated fast once you account for adversarial behavior.
- Brier scores are a clean way to measure forecasting skill, and reputation needs shrinkage toward a baseline prior so one lucky call doesn't make someone look like a genius.
- Payment code is mostly about the unhappy paths. The happy path took an afternoon; retries, partial failures, and reconciliation took days.
- "I don't know" is a valid answer. The best version of both the
quantforecaster and the buyer agent was the one willing to abstain. - How cleanly Solana, x402, Gemini Prediction Markets, QuickNode Streams, and ElevenLabs fit together for accountable agentic commerce.
What's next for Delphi
- Run independent settlement signers on separate infrastructure publishing attestations to a shared object store.
- Scale required USDC bonds with reputation so unproven forecasters stake more.
- Add long-lived batch-settlement channels so a buyer funds one channel per forecaster across days rather than per scan.
- Build a browser-wallet web form so human forecasters can commit and sell predictions without using the CLI.
Built With
- anchor
- elevenlabs
- express.js
- gemini
- node.js
- quicknode
- react
- rust
- solana
- sqlite
- typescript
- usdc
- vite
- x402