{"repo": "atom-1106/trade-with-claude", "files": {"trading-agent/.env.example": {"57439a17644af11104b39c84df991513895a8ee7": {"t": 1785747089.3466275, "n": 4684, "h": "f7635e8920a2d27f", "c": "# ─── trading-agent .env (example) ───────────────────────────────────────\n# Copy this file to `.env` and fill in real values. The schema lives in\n# `src/config/env.ts` (zod-validated at process start).\n\n# ── Infra ───────────────────────────────────────────────────────────────\nTIMESCALE_URL=postgres://trading:trading@localhost:5432/trading\nREDIS_URL=redis://localhost:6379\n\n# ── Upstream market data (TwelveData) ───────────────────────────────────\n# REQUIRED. Free tier works for a single symbol; paid tier for the full\n# watchlist. Rate-limit defaults to 8 req/min — bump on paid plans.\nTWELVEDATA_API_KEY=\nTWELVEDATA_BASE_URL=https://api.twelvedata.com\nTWELVEDATA_RATE_PER_MIN=8\n\n# ── Watchlist + profile ─────────────────────────────────────────────────\n# Comma-separated symbols. Profile is the strategy preset (see\n# src/profiles/*.ts).\nSYMBOLS=EUR/USD,GBP/USD,USD/JPY\nPROFILE=intraday_15min\n\n# ── Loop ────────────────────────────────────────────────────────────────\nTICK_INTERVAL_MS=300000\nMAX_CONCURRENCY=3\nBACKFILL_DAYS=30\n\n# ── Notifications (all optional) ────────────────────────────────────────\n# WEBHOOK_URL receives a JSON POST per qualifying setup.\n# Telegram / Discord receive the rendered envelope (`telegramText` field\n# from the Claude reasoner when present, else the deterministic narrative).\nWEBHOOK_URL=\nWEBHOOK_MIN_GRADE=A\nTELEGRAM_BOT_TOKEN=\nTELEGRAM_CHAT_ID=\nDISCORD_WEBHOOK_URL=\n\n# ── Agent (Claude Code CLI in headless -p mode) ─────────────────────────\n# \"claude_code\" runs the agent via the Claude Code CLI. \"disabled\" skips\n# the agent entirely; the worker uses the deterministic verdict only and\n# no envelope is produced.\nAGENT_MODE=claude_code\n# Model id passed through to the Claude Code CLI.\nCLAUDE_CODE_MODEL=claude-opus-4-5\n# Hard per-process daily USD spend cap. Once exceeded for the current UTC\n# day, the agent returns `{ kind: \"skipped\", reason: \"daily_cap_reached\" }`\n# and the worker falls back to deterministic output until UTC midnight.\nCLAUDE_CODE_DAILY_USD_CAP=2.0\n# Per-tick turn cap and overall timeout.\nCLAUDE_CODE_TURN_CAP=20\nCLAUDE_CODE_TIMEOUT_MS=120000\n# Optional CLI / MCP overrides — leave blank to use defaults.\n# CLAUDE_CODE_CLI_PATH=claude\n# CLAUDE_CODE_MCP_CONFIG=\n\n# ── Misc ────────────────────────────────────────────────────────────────\nLOG_LEVEL=info\nNODE_ENV=development\n\n# ════════════════════════════════════════════════════════════════════════\n# CRITIC sidecar (separate process — `src/critic/*`)\n# ════════════════════════════════════════════════════════════════════════\n# The critic is a sidecar that audits the trading agent. It runs in its\n# own process and uses its OWN Postgres database (H2 isolation: a critic\n# migration bug cannot touch trading data). Schema lives in\n# `src/critic/config.ts` (zod-validated).\n\n# ── Storage isolation (H2) ──────────────────────────────────────────────\n# Separate logical DB on the same Postgres instance. Create with:\n# CREATE DATABASE critic_db OWNER trading;\nCRITIC_DB_URL=postgres://trading:trading@localhost:5432/critic_db\n\n# ── WAL (write-ahead log of pipeline events) ────────────────────────────\n# Bounded async queue + batched gzip flush. Overflow → drop-oldest +\n# alarm event. Sub-millisecond emit() at p99 by design.\nCRITIC_WAL_DIR=./.critic/wal\nCRITIC_WAL_QUEUE_MAX=10000\nCRITIC_WAL_FLUSH_EVERY_N=50\nCRITIC_WAL_FLUSH_EVERY_MS=2000\n\n# ── Snapshots (every pipeline run, lightweight) ─────────────────────────\nCRITIC_SNAPSHOT_DIR=./.critic/snapshots\n\n# ── Evidence bundles (per-finding artifact directory) ───────────────────\nCRITIC_EVIDENCE_DIR=./.critic/evidence\n# Warn at this disk-usage fraction (0..1).\nCRITIC_DISK_WARN_FRAC=0.7\n# Auto-archive resolved findings older than N days.\nCRITIC_EVIDENCE_ARCHIVE_DAYS=7\n\n# ── ts-morph code-index cache (H7) ──────────────────────────────────────\nCRITIC_INDEX_CACHE_DIR=./.critic/cache\n# Path to the trading agent source tree (RO mount in docker).\nCRITIC_SOURCE_ROOT=./src\n\n# ── LLM enricher (DeepSeek/Ollama for finding triage; cheap + local) ────\n# This is the BOOTSTRAP default cap. The runtime cap lives in the DB and\n# is UI-configurable.\nCRITIC_LLM_DAILY_USD_CAP_DEFAULT=0.5\nCRITIC_LLM_PROVIDER=disabled\nCRITIC_LLM_API_KEY=\nCRITIC_LLM_BASE_URL=\nCRITIC_LLM_MODEL=deepseek-reasoner\n\n# ── Layer C replay budget (H6) ──────────────────────────────────────────\n# Wall-clock cap for a single replay batch. Default 30 min.\nCRITIC_REPLAY_WALL_CLOCK_MAX_MS=1800000\nCRITIC_REPLAY_PARALLEL=2\n\n# ── Health endpoint (P4) ────────────────────────────────────────────────\n# Critic process exposes /health on this port (separate from the trading\n# operator UI; see src/critic/health/server.ts).\nCRITIC_HEALTH_PORT=9100\n"}, "10d5ce7be5c8c2e2a9984d861a76e9d9e3a3c2b8": {"t": 1785770347.4929252, "n": 4684, "h": "f7635e8920a2d27f", "c": "# ─── trading-agent .env (example) ───────────────────────────────────────\n# Copy this file to `.env` and fill in real values. The schema lives in\n# `src/config/env.ts` (zod-validated at process start).\n\n# ── Infra ───────────────────────────────────────────────────────────────\nTIMESCALE_URL=postgres://trading:trading@localhost:5432/trading\nREDIS_URL=redis://localhost:6379\n\n# ── Upstream market data (TwelveData) ───────────────────────────────────\n# REQUIRED. Free tier works for a single symbol; paid tier for the full\n# watchlist. Rate-limit defaults to 8 req/min — bump on paid plans.\nTWELVEDATA_API_KEY=\nTWELVEDATA_BASE_URL=https://api.twelvedata.com\nTWELVEDATA_RATE_PER_MIN=8\n\n# ── Watchlist + profile ─────────────────────────────────────────────────\n# Comma-separated symbols. Profile is the strategy preset (see\n# src/profiles/*.ts).\nSYMBOLS=EUR/USD,GBP/USD,USD/JPY\nPROFILE=intraday_15min\n\n# ── Loop ────────────────────────────────────────────────────────────────\nTICK_INTERVAL_MS=300000\nMAX_CONCURRENCY=3\nBACKFILL_DAYS=30\n\n# ── Notifications (all optional) ────────────────────────────────────────\n# WEBHOOK_URL receives a JSON POST per qualifying setup.\n# Telegram / Discord receive the rendered envelope (`telegramText` field\n# from the Claude reasoner when present, else the deterministic narrative).\nWEBHOOK_URL=\nWEBHOOK_MIN_GRADE=A\nTELEGRAM_BOT_TOKEN=\nTELEGRAM_CHAT_ID=\nDISCORD_WEBHOOK_URL=\n\n# ── Agent (Claude Code CLI in headless -p mode) ─────────────────────────\n# \"claude_code\" runs the agent via the Claude Code CLI. \"disabled\" skips\n# the agent entirely; the worker uses the deterministic verdict only and\n# no envelope is produced.\nAGENT_MODE=claude_code\n# Model id passed through to the Claude Code CLI.\nCLAUDE_CODE_MODEL=claude-opus-4-5\n# Hard per-process daily USD spend cap. Once exceeded for the current UTC\n# day, the agent returns `{ kind: \"skipped\", reason: \"daily_cap_reached\" }`\n# and the worker falls back to deterministic output until UTC midnight.\nCLAUDE_CODE_DAILY_USD_CAP=2.0\n# Per-tick turn cap and overall timeout.\nCLAUDE_CODE_TURN_CAP=20\nCLAUDE_CODE_TIMEOUT_MS=120000\n# Optional CLI / MCP overrides — leave blank to use defaults.\n# CLAUDE_CODE_CLI_PATH=claude\n# CLAUDE_CODE_MCP_CONFIG=\n\n# ── Misc ────────────────────────────────────────────────────────────────\nLOG_LEVEL=info\nNODE_ENV=development\n\n# ════════════════════════════════════════════════════════════════════════\n# CRITIC sidecar (separate process — `src/critic/*`)\n# ════════════════════════════════════════════════════════════════════════\n# The critic is a sidecar that audits the trading agent. It runs in its\n# own process and uses its OWN Postgres database (H2 isolation: a critic\n# migration bug cannot touch trading data). Schema lives in\n# `src/critic/config.ts` (zod-validated).\n\n# ── Storage isolation (H2) ──────────────────────────────────────────────\n# Separate logical DB on the same Postgres instance. Create with:\n# CREATE DATABASE critic_db OWNER trading;\nCRITIC_DB_URL=postgres://trading:trading@localhost:5432/critic_db\n\n# ── WAL (write-ahead log of pipeline events) ────────────────────────────\n# Bounded async queue + batched gzip flush. Overflow → drop-oldest +\n# alarm event. Sub-millisecond emit() at p99 by design.\nCRITIC_WAL_DIR=./.critic/wal\nCRITIC_WAL_QUEUE_MAX=10000\nCRITIC_WAL_FLUSH_EVERY_N=50\nCRITIC_WAL_FLUSH_EVERY_MS=2000\n\n# ── Snapshots (every pipeline run, lightweight) ─────────────────────────\nCRITIC_SNAPSHOT_DIR=./.critic/snapshots\n\n# ── Evidence bundles (per-finding artifact directory) ───────────────────\nCRITIC_EVIDENCE_DIR=./.critic/evidence\n# Warn at this disk-usage fraction (0..1).\nCRITIC_DISK_WARN_FRAC=0.7\n# Auto-archive resolved findings older than N days.\nCRITIC_EVIDENCE_ARCHIVE_DAYS=7\n\n# ── ts-morph code-index cache (H7) ──────────────────────────────────────\nCRITIC_INDEX_CACHE_DIR=./.critic/cache\n# Path to the trading agent source tree (RO mount in docker).\nCRITIC_SOURCE_ROOT=./src\n\n# ── LLM enricher (DeepSeek/Ollama for finding triage; cheap + local) ────\n# This is the BOOTSTRAP default cap. The runtime cap lives in the DB and\n# is UI-configurable.\nCRITIC_LLM_DAILY_USD_CAP_DEFAULT=0.5\nCRITIC_LLM_PROVIDER=disabled\nCRITIC_LLM_API_KEY=\nCRITIC_LLM_BASE_URL=\nCRITIC_LLM_MODEL=deepseek-reasoner\n\n# ── Layer C replay budget (H6) ──────────────────────────────────────────\n# Wall-clock cap for a single replay batch. Default 30 min.\nCRITIC_REPLAY_WALL_CLOCK_MAX_MS=1800000\nCRITIC_REPLAY_PARALLEL=2\n\n# ── Health endpoint (P4) ────────────────────────────────────────────────\n# Critic process exposes /health on this port (separate from the trading\n# operator UI; see src/critic/health/server.ts).\nCRITIC_HEALTH_PORT=9100\n"}}}}