Apologies, the second form kept reloading the page for an unknown reason, here is the contents that went there in case it did not actually go through.
Second form
Title and team members
Cushion. Justin Li, Gabriel Ginsberg, Michael Sun.
Main track
Consumer Apps
On-chain award
Best Use of Solana
Bounty submissions
Gemini bounty: Prediction Markets
Project description
Cushion turns prediction markets into everyday protection: tell it what you have riding on tomorrow, and it prices a cushion that pays if things go wrong.
What did you build? A web app with six sections (Today, Portfolio, Live games, Bills, Fantasy, Small business). In each one you say what you have at stake, and Cushion finds the Gemini prediction markets that move against you and prices cover on the live order book: one price, one payout and the market's chance you'll need it. Every purchase is recorded on Solana devnet as a public receipt.
What problem does it solve? People only meet prediction markets as betting, so most never use them. But the same contracts work as insurance for things people already care about: a portfolio, a team, a heating bill, a fantasy lineup, a small business's bad days. Cushion only offers that protective side, in plain language, with no trading jargon.
How does it work? Server routes read Gemini's public prediction market API (events, order books, price history, settlements) and validate it with zod. A pure engine turns each risk into contract legs; for a falling price, a strip of NO contracts down a price ladder, sized so the payout grows with the loss. Legs are priced by walking the real order book, and partial fills are shown as partial. Stocks are mapped to markets by regression on daily returns. When Gemini resolves a contract, the app settles the play-money account. Each purchase is written to Solana devnet through the Memo program, signed and paid for by the app, so users never need a wallet.
What makes it unique? It uses the same markets for the opposite purpose: protection, not speculation. It reads a strike ladder as a payoff curve, so binary contracts behave like an option. It's honest about thin markets and labels every estimate. And the crypto is invisible: on-chain receipts with no wallet, seed phrase or gas for the user.
What would you build next? Real orders through Gemini's trading API, a custom Solana program that holds and settles each cushion on-chain, rolling cover for longer periods, more life events (rain, flight delays, mortgage rates), and accounts that follow you across devices.
Technologies and sponsor tools: Gemini Prediction Markets API, Solana (devnet, Memo program, @solana/kit), Next.js 16, React 19, TypeScript, Tailwind CSS, shadcn/ui, Recharts, three.js, zod, Vitest, Vercel. Also ESPN's public sports API, Yahoo Finance and the YouTube IFrame Player API.
Demo video
GitHub repo link
https://github.com/justinli500/cushion
Technical summary
- Architecture: one Next.js 16 app (App Router, TypeScript) deployed on Vercel. Server routes fetch upstream data, validate it with zod and cache it (in memory, and at the CDN for slow, non-price data). The browser holds each person's profile and play-money account.
- Market data: Gemini's public prediction market endpoints, with no API key:
GET /v1/prediction-markets/events(markets, contracts, quotes),GET /v1/book/{symbol}(live order book),GET /v2/candles/{symbol}/{timeframe}(price history) andGET /v1/prediction-markets/events/{ticker}(settlement viaresolutionSide). It reads price ladders, temperature buckets, game winners, player props and news events. - Pricing engine (pure functions, tested): a cushion is a list of legs (contract, side, quantity), each paying $1 per contract on its side. Legs are filled by walking the book level by level (buying NO at
pis selling YES at1 − pinto the bids), and the market's chance comes from the bid/ask midpoint, with ladder probabilities forced monotonic. - Exposure: stock returns are regressed on each listed market and used only above a fit threshold; bill and heating pass-through are rough models labelled as estimates.
- Account: an append-only event log in localStorage; balance and positions are derived by replaying it, so a settlement recorded twice pays once.
- On-chain receipts:
POST /api/receiptsvalidates the purchase, builds a JSON memo of at most 500 bytes (contract symbols, sides, quantities, cost, maximum payout, plus a SHA-256 of the full receipt when it has to be trimmed; no personal data), signs one transaction with the app's key, sends it to Solana devnet's Memo program and waits for confirmation. Requests are rate-limited and de-duplicated by receipt ID. Receipts are linked from the Account page to Solana Explorer. - Live game replay: ESPN's timestamped play-by-play and Gemini's real trades for one game, synced to a YouTube broadcast.
- Front end: Tailwind and shadcn/ui, Recharts for charts, three.js (React Three Fiber) for the landing page's copula, with a light and dark theme applied before first paint.
- Testing: 390 Vitest tests over the engine, parsing, exposure models and receipts, many using saved real Gemini and ESPN responses.
Smart contract / program addresses
Cushion does not deploy its own program. It uses one existing Solana program on devnet:
| What | Address |
|---|---|
| SPL Memo program (used; not deployed by us) | MemoSq4gqABAXKb96qnH8TysNcWxMyWCqXgDLGmfcHr |
| Cushion receipt wallet (signer and fee payer for every receipt) | 442CDMzrvfKqKkyqSHsLnQgPdzUeuJuYYMWPFQhd4jQm |
Receipt history: https://explorer.solana.com/address/442CDMzrvfKqKkyqSHsLnQgPdzUeuJuYYMWPFQhd4jQm?cluster=devnet