Most trading bots demo the trade that worked. Our demo opens with the trade that didn't happen: Gemini proposed it, a second Gemini red-teamed it, and our deterministic risk gate killed it — with a machine-readable reason code in an append-only journal. NorthStar is what an AI trading agent looks like when honesty is the architecture, not the disclaimer.

You don't pick stocks. You set a destination — "grow $1M to $1.1M in 12 months" — and it answers with honest odds from walk-forward backtests + Monte Carlo. Unrealistic goals get a red light and one-tap alternatives that would actually work.

Inspiration

Every "AI trader" pitch has the same silent failure mode: the LLM is judge, jury, and executioner. We built the opposite: LLMs propose and explain, but only unit-tested code can touch money — and every claim in the UI maps to a journaled fact.

What it does

  • Goal-first onboarding with honest odds, including a red "this is unrealistic" path.
  • Google ADK 2.x Workflow (perceive → prefilter → triage → signals → compile/gate/execute → explain → record) every 15 minutes on an Alpaca paper account. The cockpit lights the DAG live — nodes badged GEMINI vs CODE.
  • Bull-vs-bear debate before any AI trade. Strong objection = dropped. The judge is deterministic code.
  • A risk gate that cannot be sweet-talked. Pure-function checks (max loss, concentration, sleeve budgets, circuit breakers, naked-call ban, weather floor, kill switch). Every rejection is a first-class journal event.
  • Options done properly: defined-risk spreads as one atomic multi-leg order; mechanical exits (50% profit / DTE≤7).
  • Self-evolution with scientific hygiene: walk-forward, Deflated Sharpe, human approval, 3-day paper trial. With a goal set, evolution optimizes the probability of reaching your target.
  • A2A weather agent + TimesFM quantile bands (advice, never an order trigger).
  • Nightly scout that retargets the universe while you sleep.

How we built it

Stack: Google ADK 2.x · Gemini 3.7 Flash (fallback chain) · A2A · TimesFM · Cloud Run + Firestore · Secret Manager · FastAPI · Next.js 16 · Alpaca paper API.

Money-path engineering: one global pass mutex; atomic approval flips; idempotent client_order_ids; fill reconciler for weekend-queued orders; sleeve budgets enforced twice (sizer + gate); 300+ tests including a copy-honesty lint that fails the build if UI text promises returns.

Research flywheel: every loop shares walk-forward + deflated Sharpe/IC + minimum-sample refusals + human approval. LLMs write hypotheses and narration; they never emit a number that decides anything.

Challenges

  • Gemini free-tier reality. We built a model fallback chain and honest template fallbacks that journal llm: false — the system degrades visibly, never silently.
  • Sync LLM calls froze the API. Each ADK pass now runs on a private event loop in a worker thread.
  • Honest P&L. Expiry/assignment produce no fill; we book those as labeled estimates.

What we learned

Agentic UX is not chat. It's a live workflow graph, a debate you can replay, reason codes on every no, and an append-only journal — trust through audit, not vibes.

Try it (60 seconds)

  1. Open https://northstar-web-251608445238.us-central1.run.app
  2. Activity → Run one pass now — watch GEMINI vs CODE nodes light up.
  3. Proof page: proposal → verdict (reason codes) → digest.
  4. curl https://northstar-web-251608445238.us-central1.run.app/a2a/weather/.well-known/agent-card.json

Built With

Share this project:

Updates

Submission history