Inspiration

Every year, thousands of SME CFOs watch their margins evaporate because of currency swings or commodity price spikes — not because they don't understand the risk, but because accessing proper hedging tools requires an ISDA agreement, a six-figure minimum, and a team of derivatives lawyers. We built Hedgen to tear down that wall: if a CFO can describe their problem in plain English, they should be able to hedge it in 10 minutes.

What it does

Hedgen is an AI-powered hedge execution platform for SME CFOs. The user describes their financial exposure in a natural conversation — "we buy 9,000 tonnes of wheat a year and prices are killing our margins" — and Hedgen does the rest. A conversational AI agent extracts a structured risk profile from the dialogue, a second agent generates three tailored hedging strategies (conservative, moderate, aggressive) with plain-language explanations and live cost estimates, and a third agent executes the position directly on Hyperliquid's perpetuals market. No ISDA. No broker. No jargon.

How we built it

We designed a three-layer multi-agent pipeline:

  • L1 — Risk Analyst Agent: A Claude-powered conversational agent that collects the CFO's risk exposure through a short dialogue (3–4 questions), extracts a structured JSON risk brief, and tracks its own confidence score in real time.
  • L2 — Hedging Architect Agent: A deterministic sizing engine augmented with an LLM that maps the risk brief to three concrete hedge proposals — position size, leverage, coverage ratio, estimated cost in basis points — each with a one-sentence plain-English explanation.
  • L3 — Lifecycle Manager Agent: Connects to the Hyperliquid testnet via their Python SDK to open, monitor, and settle perpetual futures positions, tracking live P&L and margin in real time.

The backend is FastAPI (Python), the frontend is Next.js 14 with a dark terminal aesthetic, and the entire stack is deployed on Railway and Vercel.

## Challenges we ran into

Getting LLMs to respect structured output contracts in a conversational flow was harder than expected — the agent would report high confidence but forget to emit the JSON block, or emit it with malformed fields. We solved this with explicit delimiter parsing (RISK_BRIEF_START / RISK_BRIEF_END), a [CONFIDENCE:X.XX] tag injected at the end of every response, and prompt rules that forbid the model from tagging confidence ≥ 0.50 without also emitting the full brief.

Hyperliquid's testnet also has a $2M per-order cap and only supports a specific set of perp symbols — commodity exposures like Brent or wheat had to be mapped to available instruments as proxies, which we were transparent about.

##Accomplishments that we're proud of

We got the full pipeline — natural language → structured risk brief → three hedge proposals → live position on Hyperliquid — working end-to-end in under 24 hours. The live confidence gauge in the chat interface, which fills in real time as the agent collects information, makes the AI's reasoning visible and builds trust with the user. We're also proud of how little friction there is: no onboarding form, no account creation, just a conversation.

What we learned

Prompt engineering at the boundary between conversation and structured data extraction is a discipline of its own. Confidence thresholds, output delimiters, and explicit rules about what the model is
and isn't allowed to do in a given state matter enormously. We also learned that showing the AI's internal state to the user — the confidence score, the extracted parameters updating live — dramatically improves the feeling of trust and control.

What's next for Hedgen

  • Real FX and commodity instruments: partner with regulated brokers to offer proper FX forwards and commodity swaps, not just perp proxies.
  • Portfolio view: let CFOs track all their active hedges, P&L, and settlement history in one dashboard.
  • Automated roll and rebalance: the lifecycle agent proactively alerts and rebalances positions as market conditions change.
  • Multi-language support: the risk analyst agent already handles multilingual input; the full product should too.
  • Regulatory wrapper: work toward MiFID II compliance so Hedgen can operate as a regulated hedging advisor across the EU.

Built With

  • agent
  • css
  • fastapi
  • hyperliquid
  • insee
  • llm
  • next.js
  • python
  • skills
Share this project:

Updates