Inspiration
Most people's money is allocated inefficiently. Either cash sits idle "just in case", or everything stays invested until life hits and you're forced to sell at the worst time. Wealthy investors don't have this problem: they borrow against what they own and hedge the risk, with someone watching both their life and their portfolio.
The tools to do that already exist on Solana. Lending, staking and swaps are live today, and prediction markets can hedge almost anything. But DeFi has never broken out of crypto, because normal people don't know how to use it. We asked: what if an agent connected those tools to the things that actually drive your money, like your inbox, your calendar and your portfolio, and did the hard part for you?
What it does
Hunch is a proactive agent that babysits your life and your portfolio and connects them, so every dollar is either working for you or ready for what's coming.
- It watches your life. Hunch reads your Gmail and Google Calendar in real time and turns them into life events: a repair estimate, a trip, a refinance, money coming back.
- It watches your portfolio. Hunch tracks live balances on Solana, idle cash, concentration and loan health.
- It plans the move. When life needs cash, Hunch compares selling, a credit card and borrowing against what you own, and picks the best option with real numbers.
- It hedges the risk. Prediction markets are usually seen as gambling, but they're one of the most capital-efficient hedges there is. Hunch uses Gemini's markets to protect a loan, a concentrated portfolio, or a real-life event.
- It keeps watch. Workflows, written by you or suggested by Hunch, act when something changes: "when my deposit lands, put \$100 into the S&P 500."
- Nothing moves until you approve. Every plan is one approval. Your wallet signs, and every step is a real Solana transaction with a Solscan link.
In the demo, my card is declined for a \$35 car repair while I have about \$16 in cash. Hunch borrows the rest against my Solana instead of selling it, and protects that loan with a Gemini hedge, all in one approval.
The hedge is what makes this capital-efficient. In the demo, Hunch borrows \$18.98 against my SOL. The loan would only be liquidated if SOL fell about 51% (to roughly \$36). Hunch picks a Gemini contract that pays if SOL is under \$55 on November 30, well before liquidation, and sizes it to pay out exactly what's needed to bring the loan back to a safe level if that happens:
$$ \text{payoff multiple} = \frac{\$5.00 \text{ payout}}{\$0.25 \text{ cost}} = 20\times \qquad \text{cost of protection} = \frac{\$0.25}{\$18.98} \approx 1.3\% \text{ of the loan} $$
The market prices that outcome at about 5¢ per \$1, so for about 1.3% of the loan, I keep my SOL invested and have a payout waiting if the market drops sharply, instead of being forced to sell at the bottom.
How we built it
- Frontend: React 19 and Vite, with a React Flow canvas for workflows. Sign-in is Google through Privy, which creates an embedded Solana wallet, so there's no seed phrase and nothing to install.
- Server: TypeScript, Express 5 and SQLite. All money math uses integer cents and raw token units.
- Solana:
- Direct program calls: Hunch builds the instructions for Kamino's lending program, BlazeStake's stake pool and Jupiter's swap program itself, rather than sending users to someone else's app.
- Signing: every move is a v0 transaction, simulated before you see it. Your Privy wallet signs, then Hunch verifies the signature, re-checks the price and co-signs as fee payer, so you never need SOL for gas.
- QuickNode Streams wake Hunch the moment your wallet or your Kamino position changes.
- Gemini Prediction Markets:
- Hunch reads Gemini's live order books, candles and official settlements across every category.
- The relay to Solana: Hedges run through hunch_hedge, Hunch's own Solana program. Your USDC waits in an on-chain escrow, within the price and size you approved, while Hunch places the order through Gemini's trading API. The program mints the contract as its own SPL token only when the order fills, named on-chain with Metaplex metadata and carrying the Gemini order ID in the transaction memo. An order that can't fill comes back to you, and after 90 seconds anyone can send it back. When Gemini settles, the winning token is burned for \$1 in USDC.
- Limits enforced on-chain: at most \$250 and 500 contracts per order, 5,000 open contracts per side of a market, and 2¢ in fees per contract. Separate keys fill orders and post results, and redemption can't be paused.
- Verified on devnet: Gemini filled orders that Hunch relayed through the program, and each fill records its Gemini order ID on-chain. The transactions are linked in the README.
- Workflows can fire on Gemini's official results, for example "if the Fed hikes in December, put \$20 into Treasuries."
The agent: how Hunch thinks
Hunch runs as an agent loop: perceive → understand → plan → verify → act. It runs continuously, and it's woken early by new mail or by a change in your wallet.
- Perceive. Signals come in from four places:
- your Gmail, watched in real time;
- your Google Calendar;
- your on-chain balances, pushed by QuickNode Streams;
- Gemini's live markets. A fast local filter drops the noise (promotions, social, one-time codes) before any model sees it, so only emails about money reach the agent.
- Understand. A language model reads each email and calendar event into a structured life event: what it is, what it costs, when it's due, whether it's already paid, and what could put it at risk, such as the team, the city or the coin. It links related signals, so a repair shop's estimate and a declined-card email attach to the same calendar event. Each batch is read twice, and a third read breaks any disagreement.
- Plan with tools, not guesses. The agent never invents a number. Typed tools compute every figure:
- quotes for borrowing, selling, card and savings;
- a coverage check on whether each upcoming event is funded;
- a hedge matcher that maps a risk to a real Gemini contract and sizes it. The agent ranks what matters and writes each plan in plain words.
- Verify in code. Every plan is checked before you see it, and again when you approve:
- loan safety;
- your pause switch;
- that no other upcoming event is left less covered;
- that the live price hasn't moved. Every number and date in the agent's words must match the tools' output, or the sentence is rejected.
- Act, with you in the loop. Approval builds the transactions. Your wallet signs, and Hunch verifies and sends them. Workflows are standing instructions the agent watches over time, and they end the same way: a plan that waits for your OK.
Guardrails we designed in:
- The model reads, code decides. The model never sets an amount, picks a ticker or moves money.
- Prompt-injection firewall. Emails or event titles that try to instruct an AI ("ignore previous instructions…") are caught and never reach the model.
- No unsolicited debt. Hunch only raises cash with a reason: a declined card, a failed payment, or you asking.
- Grounded or nothing. Every dollar amount must appear in your email or calendar. If it doesn't, Hunch asks instead of guessing.
Measured, not assumed. We tested the agent on events and emails written by seven other models, after the reader was frozen:
- 99.3% of 658 calendar events it had never seen were read correctly;
- 98.8% of emails were read correctly end to end, with 100% of money emails kept and about 85% of the noise dropped locally;
- every sentence the agent wrote passed the code's fact check.
Challenges we ran into
- Trusting an AI with money. A model that misreads "\$5k race" as \$5,000 is a disaster. We wrote held-out test sets of events and emails the reader had never seen, and iterated until it read 99.3% of 658 unseen calendar events correctly. The model also never decides a number on its own.
- Real-time life signals. Gmail push needs a public endpoint, so we built a lightweight mailbox watch that notices new mail within seconds and re-plans.
- Signing safely. Co-signing user transactions as a fee payer means Hunch must never sign something it didn't build. Every transaction is checked against the exact message Hunch created, and prices are re-checked right before sending.
- Matching life to markets. Turning "Car repair · Thursday" or "Cowboys game" into the right Gemini contract, at the right size, took far more care than expected.
- Making it invisible. The hardest part wasn't the DeFi, it was hiding it: plain words on every screen, no wallets, no gas, no jargon.
Accomplishments that we're proud of
- An email arriving becomes a hedged, on-chain plan in seconds, with one approval.
- Gemini prediction markets brought onto Solana as tokens, inside an everyday money app.
- An agent that's measured, not assumed: 99.3% on 658 unseen events, and every sentence it writes is fact-checked by code.
What we learned
- DeFi's problem isn't the protocols, it's the interface between them and real life. Connecting money to what's actually happening in someone's life is what makes it usable.
- Prediction markets are an underrated financial primitive. Used as hedges rather than bets, they're remarkably capital-efficient.
- For AI handling money, the winning pattern is to let the model read and explain, and let code decide.
What's next for Hunch
- More sources to understand your life. Beyond email and calendar, Hunch could learn from what you watch, follow and save, like your Instagram feed, YouTube and Reddit. It would pick up what you care about, what you're planning and where you're headed, without you ever filling in a form.
- From your vision to your investments. If you keep watching electric cars, saving travel content, or following AI, Hunch turns that into a thesis and proposes a portfolio that reflects it. Your interests become your investments, sized to what your life can afford.
- Workflows that follow the people you trust. "When this analyst says buy, put in \$50." "If this founder announces a raise, add to my position." Workflows that act on what people say, not just on prices or dates, always within your limits and with your approval.
- Far richer workflows. Chains of triggers across your life, your portfolio, the news and prediction markets, all written in plain English, like "if I book a trip and oil spikes, hedge my fuel costs."
- From assistant to autopilot. Everyday moves run on their own inside limits you set, and Hunch only asks about the big decisions.
Built With
- ai-agents
- blazestake
- defi
- express.js
- gemini-prediction-markets
- gmail-api
- google-calendar-api
- jupiter
- kamino
- metaplex
- node.js
- openai
- prediction-markets
- privy
- quicknode-streams
- react
- react-flow
- solana
- solana-web3.js
- spl-token
- sqlite
- typescript
- usdc
- vite