
Manoli
get a quote from prediction market for your asset
About
The problem it solves Traditional insurance is slow, opaque, and limited to standardized products. Anyone who wants to hedge a specific real-world risk — a missed flight, a bad harvest, a geopolitical event, a volatile crypto price — has no easy way to do it. Insurance broker solves this by turning Polymarket's deep prediction-market liquidity into an instant, chat-driven hedging desk: - **Describe your risk in plain language.** The LLM finds the right Polymarket market for your event. - **Get a precise quote.** The broker computes the correct YES/NO position size against your dollar exposure, including expected ROI and cost. - **Place the trade in one click.** After explicit confirmation, it submits the on-chain order through the Polymarket CLOB — no trading UI, no manual position sizing. In short: it converts any insurable event into an executed, on-chain hedge in seconds.
How it's made
Challenges we ran into **1. Mapping free-text risk descriptions to Polymarket markets** Users describe risks in natural language (e.g. "I'm worried about a Bitcoin crash"). The hardest part was building a reliable routing layer that maps these descriptions to actual Polymarket market slugs across categories — weather, politics, crypto, sports, entertainment — and gracefully tells the user when no matching market exists. **2. Correct hedge sizing math** Computing the right YES/NO share quantity to fully offset a user's dollar exposure (not just buy an arbitrary amount) required careful `computeHedge` / `quoteFromMarket` logic accounting for current market prices and implied probabilities. **3. Safe on-chain trading flow** The trading flow spans wallet creation, USDC + MATIC funding, one-time CLOB approvals on Polygon, and finally order placement — all while never placing an order without explicit user confirmation in chat. Getting the state machine right and recovering gracefully from partial states (e.g. wallet funded but approvals not run) was tricky. **4. Streaming tool calls with real-time UI state** Integrating the AI SDK's streaming responses with live wallet/trade state updates in the Next.js UI — keeping the chat reactive while tool calls run asynchronously — required careful coordination between server actions and client components.