⚙️ The Machine — piece-by-piece flow

Every box is a real module; every arrow is a real data path. Verified 2026-07-05 · layered view · audit · reference

TRADING MACHINE — real money PARAMETER GOVERNANCE — validated writes ATLAS RESEARCH — zero capital access 1 · MARKET DATA Coinbase WS/REST · IBKR feed · 3-tier price fallback derivatives-agg (pm2): OKX funding / OI / liqs / L-S ratio → partitioned Supabase tables (pg_cron auto-roll) staleness flags · hermes freshness check (30-min) candles + indicators 2 · STRATEGY MANAGER (base & stocks, shared lib) 5 strategies · multi-timeframe confluence engine emits TradeProposal — strategies can never place orders base/src/strategy/manager.ts TradeProposal 3 · SIZING & RISK GATES R/R sizing (confidence × volatility × confluence) CAPITAL_CEILING_USD clamp · daily-loss + drawdown blocks sub-$5 signals floored UP, not dropped strategy/risk-reward.ts · loop.ts:2307 sized proposal · dedup · cooldowns 4 · EXECUTION ENGINE — the one gate per venue circuit breaker (3 losses → 10 min) · BalanceGuard (2-min age) idempotency keys · 5% slippage auto-exit · product whitelist futures SL: retry ×2 → FLATTEN → fatal if flatten fails phantom breaker: 3 fails → evict + fatal exit base/src/execution/engine.ts · stocks: bracket orders, dryRun flag approved orders only COINBASE spot + CFM futures LIVE · FUTURES_ENABLED=false IBKR :4002 paper · weekly re-login ika ×3: HALTED_BOTS fills · pnl · exits 5 · TRADE JOURNAL (Supabase) every trade tagged with active_experiment_ids (GIN) rejections: killed/paused + research-only recorded; dedup/cooldown/balance/breaker still log-only (gap N3) ⚠ DIP-BOOSTER (pm2, DIP_LIVE=false — dry-run) target-aware DCA: 25/15/7% dip tiers · tiered cooldowns · $5K/run bypasses the engine: direct createMarketOrder() — no breaker, guard, or journal. Route through engine before live (finding N1) POSITION RECONCILER — advisory only (gap N2) boot + 5-min: detects untracked / orphan / mismatch → alerts, never corrects; ghost positions end in phantom-breaker fatal RESTART DURABILITY base + stocks: stop-cooldowns persisted to disk, TTL-pruned restore at boot — only ever blocks re-entry (N8 closed both bots) 6 · CONDUCTOR LOOPS (Charlie) 01:00 Karpathy experiments — 4 phases, hypotheses vs journal 03:00 live-outcomes — aggregate real trades per experiment 4-hourly reflection — memory + 7d stats → ≤8 proposals daily digest — per-bot activity + anomaly detection LLM proposes · deterministic code disposes · prompts unlogged (N7) candidate promotions 7 · F2 STATISTICAL GATES (deterministic) holdout window → Welch t-test → Benjamini-Hochberg α=0.10 → max 3 promotions/night → 3-day TTL live shadow: renew +3d (≤21d cap) or REVOKE on Sharpe≤0 with ≥10 live trades — only TTL is ever mutated statistics.ts · runner.ts:772 · live-outcomes.ts:203 · old gate 56→2 survivors only 8 · PARAM CATALOG (canonical, shared) 46 gate ranges + global bounds + TP/SL aliases REJECT at write (writers.ts:41) → dedup alert #ops-room CLAMP at read (param-store.ts ×3 paths) — defense in depth shared/src/strategy/param-catalog.ts validated rows 9 · strategy_params (Supabase) source (agent/manual/backtest) · TTL · experiment provenance ecosystem-monitor may write risk-off 0.5× / 24h TTL (risk-reducing only — the "automatic" template) sync: 5s timeout · 5-min cache 10 · BOT-LOCAL PARAM READ param-store re-clamps against catalog on every read, then feeds sizing / thresholds in the Strategy Manager validated params → live sizing journaled outcomes → nightly evaluation deterioration → revoke TTL GOVERNANCE GAPS (audit v2) N5: no human lane — risk-raising & risk-cutting changes take the same automatic path (planned: risk_direction + button) N3: no intents/intent_decisions ledger · N7: no LLM transcripts N9: breaker/risk constants inline, policy unversioned FUTURES VIA CFM — F2 SHADOW LIVE (since Jul 5) F0 ✓ re-probed: $3K funded, 35 contracts, perp-style 24/7 F1 ✓ rails: notional ≤ wallet equity (never buying power) · 2× leverage clamp · buffer ladder warn50/block30/flatten15 · Herman futures-faults · F2 ✓ shadow: orders → futures-shadow.jsonl live = BOTH flags · F3 next: bracket-TP test → tiny flip · Atlas: zero access PLANNED — LIVE DASHBOARD REWORK read-only /api/state JSON (trades + clamped equity + positions + shadow book + DSL pipeline + pm2 health) → one dark page current dash = docs only (flowchart / machine / audit / architecture) 11 · SCOUT (02:30 cron, ATLAS_ENABLED) RSS quant feeds · Reddit · Serper · X via TwitterAPI.io (explore→score→exploit author scoreboard) · Hyperliquid liq levels · internal-data anomaly scout · fair source capping $0.15/night cap · verified: 20 items/night, both nights since deploy raw theories 12 · BRIDGE (the ONLY LLM in the pipeline — economy tier) theory → strict {dsl | event-study | data-requirement | discard} validateDSLConfig · atlas_ prefix · LLM never scores anything verified: ~$0.002/night live · 5 bridged/night dsl configs 13 · GAUNTLET (fully deterministic — the checker) min-sample (30 / 2×10) → purged walk-forward folds → BH-FDR α=0.10 + PSR ≥0.90 vs deflated Sharpe → 200-seed Monte Carlo (p95 DD ≤35%, fee/slippage stress) → SEALED VAULT: final 20% OOS, one-shot, spend-before-read gauntlet.ts · vault.ts · vault-spends.json only grows on FDR pass (correctly absent so far — nightly growth would be a red flag) pass → candidate · fail → killed + ledgered 14 · dsl_strategies: 'candidate' D1 fixed (91bb894): paginated fetch, book pruning, absolute 45d TTL, 7d proposal re-ping — every candidate now auditions pending operator: bulk-triage 468 pre-gauntlet legacy rows, or let TTL clear them self-discovered nightly 15 · PAPER SHADOW (03:45 — Phase D, NEW, verified live) nightly: SAME BacktestEngine re-run over post-candidacy window — walk-forward OOS from public candles; no virtual book to drift verdicts (pre-registered): ≥14d & ≥5 trades · demote pnl<0 or WR<30 · TTL 45d · propose on +pnl & WR≥45 execution-isolated: build-failing static tests forbid any execution/treasury/wallet import or trading-table touch shadow proof 16 · HUMAN GATE (#research-lab buttons) ✅ Stage it → status 'staging' — a LABEL, nothing more 🗑 Kill it → killed · demote/expire happen without asking F3 tombstone: NO live DSL executor exists anywhere. Wiring capital = a separate, future, human decision 17 · WALRUS LEDGER (append-only) hypotheses ns: every oracle / gauntlet / shadow / operator verdict — including failures · brain-v2: curated learnings x-scoreboard: author credit from realized outcomes ORACLE (inside 02:30 slice — zero LLM) pre-registered liquidation-fade event study on Hyperliquid levels · verified: "no pulse — n=143, t=-1.26" (correctly no draft) every verdict → ledger SUPERVISION & HUMAN CONTROL — wraps everything above 18 · HERMAN (hermes — 15-min sweeps) 10 checks: bot-health · pm2+memory · heartbeat · base-bot-faults (HALT.flag / port-aware orphan / WASM) · tunnel · derivatives freshness · wallet · conductor · data-quality · ibkr-session pm2-daemon-as-precondition · single snapshot/sweep · 3-strike bounded auto-fix: pm2_restart w/ cooldowns + crash-loop breaker 19 · DISCORD (the human interface) 3 ops channels + #research-lab · tag-on-critical escalation fingerprint dedup (1/hr) · chronic-collapse 3-strike silencing nightly Atlas digest: oracle · pipeline · X scoreboard · shadow book off-machine: CF-worker heartbeat monitor → Discord webhook Charlie in ops: annotate + request only — never mutate 20 · HUMAN CONTROLS (never gated, never automated) HALT.flag + exit 42 · HALTED_BOTS boot gate (ika) · Bearer /kill flatten · shadow stage/kill buttons · IBKR weekly login env-only switches: DIP_LIVE=false · FUTURES_ENABLED=false · ATLAS_ENABLED=true · capital moves boot refuses: LIVE_TRADING with secret <16 chars RUNTIME VERIFICATION — 2026-07-05 (this diagram is tested, not aspirational) ✓ 02:30 slice ran Jul 4 + Jul 5 (oracle no-pulse n=140/143 · scout 20 items → 5 bridged → 0 candidates · llm $0.0023/$0.0022 · 144s/104s) ✓ 03:45 shadow ran Jul 4 (+100 enrolled) + Jul 5 (+5, 100 evaluated) · atlas-shadow.json + x-scout-log.jsonl growing · vault-spends.json correctly absent ✓ vitest 56/56 (incl. 10 shadow + isolation-contract tests) · ✓ zero Atlas errors in conductor logs · ✓ DIP_LIVE=false confirmed in pm2 env ⚠ open: N1 dip-booster bypass · N2 advisory reconciler · N3 intent ledger · N5 param human-lane · N6 resting futures TP · legacy-triage decision (D1) LEGEND live component validation / human gate deterministic research gate planned (not wired) known gap / bypass data / control flow read-only / advisory Models propose · math validates · one engine executes · the ledger remembers · a human holds every promotion key