Inspiration

A couple of weeks ago, I read an article about how small businesses are using prediction markets to hedge against the risk of sports game outcomes. I thought this was an interesting use case for prediction markets and went down the rabbit hole. I found that this is a niche that's starting to gain traction: over 200 small businesses now use prediction markets for some type of hedging.

So I dug deeper to see what tools are available for these businesses. There weren't many that simplified prediction markets for retail consumers. Hedgehog changes that.

What it does

Hedgehog lets crypto holders and small businesses hedge risk using prediction markets. It's powered by Gemini's prediction market odds and has two modes: one for crypto traders and another for small businesses. Each mode gives users the tools to use prediction markets without needing to know how they're settled or priced.

Small business owners can describe their risk in plain English. Hedgehog then finds the matching Gemini markets, checks how each one settles, and shows them as options.

For crypto traders, the tools are built around their portfolio. Hedgehog reads what they hold from their wallets or Gemini account, or lets them enter their assets manually. It then uses Gemini's price threshold markets to show the odds of a drop and what that drop would cost them, and builds a hedge whose payout grows as the price falls.

How we built it

Hedgehog was built using Next.js with TypeScript, with SQLite for storage and Railway for hosting. Gemini prediction markets power the odds shown. For the demo, Hedgehog uses Gemini's sandbox environment to sign users in to a shared test account while the OAuth application awaits Gemini's approval. Hedges are recorded as paper trades at live prices, so no real money moves (at least not yet). Once the OAuth application is approved, each user will be able to connect their own Gemini account, and the flow stays the same.

An AI layer, accessed through OpenRouter, turns natural-language descriptions into a structured task that Hedgehog uses to find and rank markets by how well they match the user's risk. Markets are compared by how they settle rather than by their titles, because a market's title can differ from how its outcome actually pays out. All pricing and sizing is done by deterministic, tested code, and no order is placed without the user's approval. Because Gemini doesn't keep price history, Hedgehog records odds every 5 minutes and seals each hour of odds, each game's odds at kickoff, and every hedge placed on Solana's devnet. This lets anyone verify them from their own browser.

Challenges we ran into

Gemini doesn't currently offer historical data for its prediction markets. This was a hurdle, since one of Hedgehog's tools relies on it. So I started recording snapshots of the markets myself and, at a set interval, sealing a fingerprint of them on Solana. This solution worked and made it possible to build new features on top of it.

Accomplishments that we're proud of

I'm really proud of bringing this product to life. Prediction-market-based hedging has been one of my interests lately, so building around it was something I enjoyed.

UI design isn't one of my strengths, so being pushed to build that skill during this hackathon was a fun challenge, and I've definitely learned a lot.

What we learned

Overall, I learned that consumer applications can be built so the underlying technology is abstracted away from users. It made me think about different approaches to onboarding retail consumers onto new technologies.

What's next for Hedgehog

Hedgehog's Gemini OAuth2 application is still under review. Once it's approved, users will be able to log in with their Gemini accounts and buy prediction market contracts for their hedging positions.

Built With

Share this project:

Updates

Submission history