Inspiration

Every time a GLP-1 headline drops, everyone piles into the same trade — buy Lilly, buy Novo. That reaction is instant and the trade's crowded within minutes. But a GLP-1 catalyst doesn't just move the drugmaker. It moves snack companies, frozen food, alcohol, CPAP makers, healthy food brands, fitness companies — basically anyone whose business depends on how much people eat, drink, and move. Markets price the obvious move fast. They're a lot slower on the second-order stuff. We wanted to build something that catches that gap automatically instead of relying on an analyst to think it through by hand.

What it does

GLP-1 Ripple Engine is an autonomous agent that trades the downstream effects of GLP-1 and weight-loss drug catalysts. It doesn't touch the pharma stock everyone's already watching — instead it figures out who gets hit next (snacks and alcohol down, healthy food and fitness up, that kind of thing) and keeps a simulated long/short portfolio updated as those effects play out.

Under the hood it's a loop that just keeps running:

while not stop_condition:
    sense()
    plan()
    act()
    observe()
    decide()
    persist_state()

Every cycle it reads in new catalysts, checks if anything meaningful actually happened, walks a hand-built impact graph to figure out who's affected, updates positions, calculates P&L, double-checks its own work, and saves state before doing it again. It stops on purpose — either every watched catalyst has resolved, or a risk threshold gets tripped.

On the frontend, you get a live dashboard: catalysts come in, the ripple graph lights up the sectors and tickers affected, and the portfolio and P&L update in real time.

How we built it

Four of us split the work into clean lanes and agreed on shared JSON contracts up front so nobody had to wait on anyone else:

  • Agent lead built the actual loop — agent.py, loop.py, graph.py, verifier.py, state.py — the sense/plan/act/observe/decide cycle, the impact-graph traversal logic, the verification step, and the stop condition, all sitting behind a FastAPI backend (api.py).
  • Data engineering used Nexla to fuse ClinicalTrials.gov, openFDA, news/RSS, and market prices (Yahoo Finance / Finnhub) into one unified context feeding the loop, and built out the impact graph and watchlist data (impact_graph.json, watchlist.json, seed_data.json).
  • Infra got everything running on Akash — the reasoning model, the backend, the loop itself — and set up Pomerium in front of it so the agent could only talk to approved domains.
  • Frontend built the dashboard in React and TailwindCSS, with the ripple graph itself rendered using D3.js / Cytoscape so you can actually watch a catalyst propagate across sectors as it happens.

State lives outside the model the whole time, in a plain JSON blob (watchlist, impact_graph, positions, pnl, seen_catalysts) — since the LLM itself is stateless, this is what makes the loop reproducible, recoverable, and deterministic instead of a black box that forgets everything between calls.

Challenges we ran into

  • Not trusting the model blindly. Before any extracted catalyst gets committed to the portfolio, it goes through a verification step — schema validated, checked against ClinicalTrials.gov fields, and re-extracted if anything doesn't line up. That's what keeps a hallucinated catalyst from turning into a fake trade.
  • Making the loop actually stop. An autonomous loop that never terminates isn't really a feature. We had to nail down exactly what "done" means — everything on the watchlist resolved, or risk threshold exceeded — and build it in as a hard exit condition, not an afterthought.
  • Getting four independent pieces to actually fit together. Backend, data, infra, and frontend were all being built in parallel. Locking the state schema and API contracts early meant everyone could build against a stub and it'd still click together later.
  • Keeping the guardrails real. Pomerium's job was to restrict what the agent could actually reach over the network — not just look good in a slide. Getting that allowlist enforced against real outbound calls (not just documented) took some back and forth.
  • Building a graph, not a guess. The impact graph (GLP-1 approval → weight-loss adoption → snacks/alcohol/medical devices → specific tickers, each edge with a magnitude, confidence, and direction) had to be authored by hand — there's no API for "how much does a GLP-1 approval hurt Hershey's."

Accomplishments that we're proud of

  • A real closed loop — sense, plan, act, observe, decide, persist — with state living outside the model, not a single prompt pretending to be an agent.
  • A verification layer that actually gets in the way of bad data: nothing hits the portfolio without being checked first.
  • A genuinely finite agent — it has a defined stop condition and actually exits when it's done, instead of ticking forever for the sake of the demo.
  • All three sponsor tools doing real, load-bearing work: Nexla fusing four data sources into one context, Akash hosting the actual model and loop, Pomerium enforcing what the agent can talk to.
  • A dashboard that makes an abstract idea (second-order effects) visible — you watch a single catalyst light up an entire graph of downstream tickers in real time.

What we learned

  • Second-order effects are a real, underpriced signal — the market's fast on the obvious trade and slow everywhere else.
  • Keeping state outside the model isn't just good practice, it's what makes an "agent" trustworthy instead of a black box — you can inspect it, replay it, recover it.
  • Verification has to happen before a commit, not after — checking your own output against a source of truth is what separates an agent from a guess generator.
  • A hand-authored knowledge graph can carry more weight than expensive real-time reasoning — traversal is fast, cheap, and explainable in a way that "ask the model again" isn't.
  • Clean interface contracts, decided early, let a four-person team split into fully independent lanes and still merge cleanly at the end.

What's next for GLP-1 Ripple Engine

  • Expand the impact graph beyond the hand-authored edges we started with — ideally sourced from real historical price reactions instead of intuition alone.
  • Extend past GLP-1 — the sense/plan/act/observe/decide loop and graph-traversal pattern isn't drug-specific; it could run on any catalyst-driven macro theme.
  • Real portfolio risk management — position sizing, exposure caps, and a less simplified stop condition than what we shipped for the demo.
  • Backtesting — run the loop against historical GLP-1 catalysts and see whether the ripple thesis would've actually made money.
  • Tighten Pomerium's guardrails further — move from a static allowlist toward behavior-aware monitoring of the agent's outbound activity.
  • Swap in production-grade data — the free-tier price and news feeds were fine for a hackathon; a real version needs licensed, lower-latency sources.

How we used each sponsor tool

  • Nexla — the data fusion layer. It pulls ClinicalTrials.gov, openFDA, news/RSS, and market prices together into one unified context the agent loop reads from, so the loop never has to juggle four separate APIs itself.
  • Akash — the compute layer. It hosts the reasoning model, the backend, and the autonomous loop itself — this is what the live demo actually runs on.
  • Pomerium — the guardrail layer. It sits in front of the agent and restricts outbound requests to a set of approved domains only, so the autonomous system can't reach anywhere we haven't explicitly cleared.

Built With

  • akash
  • claude
  • cursor
  • nexla
  • pomerium
  • python
Share this project:

Updates