Methodology · inside the desk

How your AI hedge fund actually works.

We document every step because verifiable means inspectable. A thesis you type into the desk runs through eight discrete stages — three parallel data fan-outs, a quant tournament, a deterministic allocator (the Overlay), a critic pass, a second-model consensus, and an ed25519 signature. Reproducible from the same inputs. Read this page if you want to know precisely what we do — and what we don't — before you trust a number. Research simulation only; not investment advice.

01 · Ingest

What the Researcher actually sees

When you submit a thesis, three fan-out calls run in parallel before the LLM is invoked:

  • FRED India macro snapshot — India CPI, RBI policy repo rate, INR/USD, real GDP, 10Y G-Sec yield, global crude (Brent/WTI) — latest observation per series.
  • Firecrawl, biased to Indian sources — queries are prefixed with site:nseindia.com OR site:moneycontrol.com OR site:rbi.org.in etc., then top results are scraped and excerpted. Two results, 500-char excerpts — deliberately cheap.
  • Strategy Graph similarity — your thesis is embedded with OpenAI text-embedding-3-small and cosine-similarity searched against every past Attevia run. The top-5 nearest are handed to the Researcher as prior art.

Every span is traced in Langfuse, so every memo has a full audit trail of inputs, outputs, tokens and latency.

02 · Formalise

The Researcher agent

A Claude Haiku 4.5 call translates the free-form thesis into a falsifiable hypothesis, a named India macro regime, and a universe of 3–8 tickers drawn only from the curated list. The list is India-first: NSE ETFs (NIFTYBEES, JUNIORBEES, BANKBEES, GOLDBEES, LIQUIDBEES, ITBEES, PHARMABEES, CPSEETF, etc.), then G-Secs, then US sector ETFs for cross-border theses.

Optional mode ATTEVIA_AUTORESEARCH_STYLE=1: we borrow the research loop framing from Andrej Karpathy's autoresearch — fixed tool budget, explicit success criterion (evidence-backed hypothesis), keep/discard honesty when data contradicts the thesis, and a simplicity bias. That project runs LLM agents on GPU nanochat training; Attevia maps the same discipline onto markets (no train.py, no val_bpb).

03 · Specify

The Quant agent

The Quant picks an allocation method — equal_weight, momentum, risk_parity, or regime_blend — a rebalance cadence, and a benchmark (default NIFTYBEES.NS). It never picks weights directly; weights come from the backtest engine.

Strategy #1 — the regime blend model

A regime-conditioned blend of momentum and volatility signals, built in-house for investors who want more upside than a pure defensive sleeve but cannot tolerate an uncut equity curve. Every step is deterministic, every input is price data, and every parameter is open for inspection in the source.

Schematically:

for each rebalance t:
  momentum_t  ← avg 63-day return across risky assets
  vol_t       ← avg 63-day realised vol across risky assets
  medianVol_t ← median of 22-day rolling vol over past 252 days
  riskOn_t    ← momentum_t > 0 AND vol_t < medianVol_t
  riskyShare  ← 0.80 if riskOn_t else 0.40
  withinRisky ← inverse-volatility weights (risk parity)
  safeSleeve  ← 1 - riskyShare  (gilts / liquid / short bonds)

The full implementation lives at src/lib/backtest/engine.ts computeRegimeBlendWeights. Run it on any universe; it is not hard-coded to a specific basket.

04 · Stress-test

The Critic agent

A Claude Haiku 4.5 call reviews the strategy and lists historical regimes where it would have failed: Mar 2020 COVID, May 2013 taper tantrum, Nov 2016 demonetisation, Feb 2022 energy spike. The Critic's concerns are surfaced on the live trace and in the memo under "Risks".

05 · Backtest

The engine

We fetch up to ~7 years of daily close prices from Yahoo Finance v8 (free, keyless) — whatever liquid overlapping history the universe actually has, with a 60-trading-day minimum. We compute log returns net of a turnover transaction cost, apply the allocation method at each rebalance, and produce: total return, annualised return, annualised volatility, Sharpe (rf = 6.5% for INR, 5% for USD), Sortino, max drawdown, CVaR 95%, win rate. When a universe has no usable price feed, the memo is clearly labelled model-estimated and the chart is an illustrative simulation, not a backtest. The benchmark curve is overlaid for comparison.

06 · Write

The Scribe agent

Claude Opus 4.8 composes an institutional-style memo: executive summary, key findings, risks, citations. It is forbidden from inventing metrics — every number in the memo must appear on the backtest page, and this is checked against the JSON output. The same system prompt is replayed across runs at 10% of input cost via Anthropic prompt caching, so re-runs are cheap.

07 · Sign

Ed25519 cryptographic signature

The finished memo is serialised into a canonical JSON — run id, createdAt, sha256 of the thesis, strategy spec, sorted weights, and all backtest metrics — and signed with an Ed25519 key that never leaves the server. The signature and public-key fingerprint are attached to every public memo. Anyone can re-fetch the memo, reconstruct the canonical message, and verify the signature with the published public key at /api/pubkey. This is how you know a memo was not altered after publication.

Python · Yahoo Finance v8
Claude Sonnet / Haiku 4.5
OpenAI text-embedding-3-small
Firecrawl (India-biased)
FRED (India macro)
Langfuse (audit)
Ed25519 (trust)

All research, all code, all memos. No black boxes. Run a thesis →

Methodology — Attevia