-
Pick the weather that would hurt tomorrow and see one price.
-
Gemini's odds for the day's high. Tap a bar to set the trigger.
-
Policies in the wallet. The settled ones closed on their own after Gemini resolved.
-
How it works, with the demo video and the contract addresses.
-
The underwriting pool and every policy it has written.
Why I built this
My background is in energy, where everyone hedges the weather. Utilities and trading desks have weather derivatives. A patio bar that loses a Saturday to a cold snap has nothing, and neither does a food truck on a 100 degree afternoon. Ordinary weather moves US output by up to 3.4% a year, about $485 billion (NCAR), and the smallest businesses carry that with no hedge at all.
The hedges that exist were built for someone else. CME weather futures are monthly contracts sold through futures brokers. Parametric insurance is negotiated deal by deal for large companies. Prediction markets come closest. Gemini now lists a market on tomorrow's high temperature in Austin. But what you get is a trading screen with 2°F buckets and an order book, and you need an exchange account.
What it does
Kelvin takes that market price and sells it as a simple policy.
You pick what you are protecting and where, say a patio bar in Austin tomorrow. You tap the temperature where your day starts to hurt, for example 78°F or hotter. Kelvin adds up the Gemini contracts past that line into one trigger, which is a strike the exchange does not list on its own. You choose a payout and see one price, which is the market's odds plus a small spread.
You pay once. On Arc the dollar is the native currency, so the premium is a single transaction with no approval step and no second token for gas. It is final in about a second. When Gemini resolves the market, the policy settles by itself. If your trigger hit, the money is in your wallet. You never file a claim.
On the other side, anyone can deposit USDC into the underwriting pool and earn the premiums. Every payout is locked in the contract from the moment the policy is sold.
You can try it at https://calvinman05-oss.github.io/kelvin/. Press Sign in, then Use the demo wallet. There is nothing to install.
How it is built
There are two Solidity contracts on Arc Testnet. KelvinOracle holds each Gemini contract's odds, the time sales close, and the final result. KelvinVault quotes, sells and settles the cover and keeps the underwriters' accounting. All of the money moves as native USDC.
A keeper script reads the Gemini Prediction Markets API, posts each contract's best ask on-chain as odds, copies the result once Gemini settles, and settles the policies. It runs on a GitHub Actions schedule, so there is no server to keep alive.
The web app is a static React site that reads everything from Arc. It has a demo wallet built in so a judge can buy cover in three clicks, and it works with MetaMask too.
About 110 Gemini markets are mirrored on-chain right now: daily highs for major US cities, weekly natural gas, and 5-minute Bitcoin markets, which are there so you can watch a whole policy from purchase to settlement in a few minutes.
What was hard
The hardest question was when to stop selling. By mid-afternoon anyone can look at a thermometer and know the day's high, so a buyer could know more than my quote. Each market now carries its own sales close time, about 10am Central on the day being measured, and the vault refuses any price more than 15 minutes old.
Gemini's weather markets are quoted tightly but they are thin, so the vault caps exposure at 30% of the pool per event and will not sell anything above 90% odds.
Arc gave me one surprise. Native USDC has 18 decimals and its ERC-20 view has 6. The vault keeps every amount to a whole millionth of a dollar so the two always match.
What I learned
A prediction market turns out to be a good oracle for this kind of cover. It gives you the price and the outcome from the same regulated place. The contract was the easy part. Deciding what the pool should refuse to sell took longer.
What is next
First I would hedge the pool back on Gemini through its trading API. The pool would earn the spread and stop carrying the weather, and Gemini's quietest markets would get real buyers. After that, quotes signed at the moment of sale so the keeper does not have to be trusted, and a "cover tomorrow" button inside the register and ticketing software these owners already use. Selling it for real would also need a licensed insurer behind it.
Built With
- arc
- circle
- foundry
- gemini
- github-actions
- node.js
- react
- solidity
- tailwindcss
- typescript
- usdc
- viem
- vite