All notable changes to QuantStack will be documented in this file.
The format is based on Keep a Changelog, and this project adheres to Semantic Versioning.
Complete architectural migration from CrewAI crews to LangGraph StateGraphs. This is a breaking change — the entire orchestration layer has been replaced.
Three LangGraph StateGraphs replace the old prompt-based Claude loops:
- Trading Graph (12 nodes) — safety check, daily planning, parallel position review + entry scanning, mandatory risk gate (SafetyGate), portfolio review, options analysis, execution, reflection
- Research Graph (8 nodes) — context loading, domain selection, hypothesis generation, signal validation, backtesting, ML experiments, strategy registration, knowledge update
- Supervisor Graph (5 nodes) — health checks, issue diagnosis, recovery execution, strategy lifecycle, scheduled tasks
Docker-first deployment — all services (PostgreSQL + pgvector, LangFuse, Ollama, 3 graph runners) orchestrated via docker-compose.yml. Replaces tmux-based loop management.
New tool layer architecture:
- LLM-facing tools in
tools/langchain/(19@tooldecorated functions) - Deterministic functions in
tools/functions/(called directly by graph nodes) - Central
TOOL_REGISTRYintools/registry.pywith YAML-driven agent binding - Agent configs in
graphs/*/config/agents.yamlwith hot-reload support
New LLM provider abstraction (src/quantstack/llm/):
- Tier system (heavy/medium/light/embedding) with per-agent assignment
- Provider fallback chain: bedrock → anthropic → openai → ollama
- Supports Bedrock, Anthropic, OpenAI, Gemini, Ollama
New subsystems:
src/quantstack/runners/— Docker entrypoints for each graph servicesrc/quantstack/health/— heartbeat, retry with backoff, graceful shutdown, watchdogsrc/quantstack/rag/— pgvector-based knowledge retrieval (replaces ChromaDB)src/quantstack/graphs/— state schemas, config loader, config watcher
- MCP bridge dead subtree —
_factories.py,_schemas.py,tools_data.py,tools_analysis.py,tools_risk.py,tools_etrade.py,tools_market.py(7 files, never imported) - Research agent classes —
ml_scientist.py,execution_researcher.py,alpha_researcher.py(replaced by inline LangGraph nodes) - Dead core modules —
feature_scaler.py,cross_asset.py,cost_model.py,tuning.py,ic_output_validator.py,param_optimizer.py(zero imports) - CrewAI framework —
crews/,crewai_compat.py, all CrewAI docs (100+ files) - Old agent definitions —
.claude/agents/*.md(14 files),prompts/directory - Dead enum —
GROQ_SYNTHESISinDecisionPath(never routed to since v1.1) - Completed migration script —
scripts/migrate_chromadb_to_pgvector.py - Archived one-off scripts — 6 research scripts moved to
scripts/archive/
Five new architecture docs so any LLM session can understand the repo:
docs/architecture/graphs.md— StateGraph structure, state schemas, agent config systemdocs/architecture/tools.md— two-tier tool architecture, TOOL_REGISTRY catalogdocs/architecture/signal_engine.md— 18 concurrent collectors, SignalBrief, synthesisdocs/architecture/llm_routing.md— tier system, provider fallback, model instantiationdocs/architecture/database_schema.md— 60+ PostgreSQL tables by subsystem
Updated:
CLAUDE.md— added Module Reference table pointing to all subsystem docsdocs/architecture/README.md— updated for LangGraph, new system diagramREADME.md— replaced ASCII architecture diagram with high-res Mermaid PNG- Deleted stale
docs/architecture/quant_pod.md(CrewAI architecture)
New test coverage for the LangGraph architecture:
- Unit tests: agent config, agent definitions, state schemas, tool contracts, graph structure, health, observability, runners, risk safety, scripts, watchdog
- Integration tests: e2e smoke, graceful shutdown, provider fallback, RAG degradation
planning/removed from git tracking, added to.gitignore.dockerignoreadded for cleaner Docker builds- Observability instrumentation refactored
Research loop now selects model based on market hours instead of always using haiku:
- Market hours (09:30–16:00 ET):
claude-haiku-4-5-20251001at 5 min intervals — lightweight data refresh, signal checks, watchlist updates. Context is short; expensive model is wasteful. - After hours:
claude-sonnet-4-6at 30 min intervals — full research cycles (evidence gathering, strategy design, walk-forward validation). Deep work requires a capable model.
Trading loop adaptive sleep replaces fixed 5-min polling:
- Market hours: 60s polling for responsive entry scanning
- After hours: 30 min sleep (market is closed; no reason to burn tokens)
Subagent model downgrade (opus → sonnet):
quant-researcher,strategy-rd,ml-scientistagents changed frommodel: opustomodel: sonnet- Opus was spawned for every BLITZ iteration (6–9 agents per symbol). Sonnet produces equivalent strategy research quality at significantly lower cost.
One-shot DB repair utility. Cleans accumulated bad state:
- Removes paper strategies with plain-text
entry_rules(never evaluatable by the rule engine) - Fixes forward_testing strategies with
{"mechanism": "..."}dicts (demotes to draft, sets structured JSON rules) - Clears zombie
research_queuetasks with null topics - Promotes
validatedstrategies toforward_testing - Seeds
regime_statestable via live signal engine for SPY, QQQ, IWM
Added validation blocks to prompts/research_loop.md and prompts/research_shared.md requiring all strategies to have structured JSON arrays as entry_rules before calling register_strategy(). Plain-text strings and mechanism-dict formats are explicitly documented as invalid with inline validation script.
scripts/heartbeat.sh rewritten to fix a race condition where orphaned running rows from killed sessions were included in MAX(iteration), inflating the counter and causing false duplicate iterations:
runningcall: marks stale orphans (>30 min withoutfinished_at) asorphanedbefore reading MAX; only counts rows withfinished_at IS NOT NULL- Prints
HEARTBEAT_ITERATION=Nto stdout for the shell wrapper to export completedcall: reads iteration fromHEARTBEAT_ITERATIONenv var (set by therunningcall in the same shell loop), avoiding a second MAX() query that could target the wrong row
start.sh loop wrappers updated to capture and export HEARTBEAT_ITERATION between the two heartbeat calls.
src/quantstack/coordination/supervisor.py health query excludes status='orphaned' rows.
src/quantstack/db.py backfill migration marks existing stale running rows as orphaned on startup.
1.0.0 - 2026-03-22
- Breaking: Consolidated 6 packages (
quantcore,quantstack,quant_arena,alpaca_mcp,ibkr_mcp,etrade_mcp) into singlequantstackpackage atsrc/quantstack/ - All imports changed:
quantcore.*→quantstack.core.*,quantstack.*→quantstack.* - Broker adapters remain at
adapters/foralpaca_mcp,ibkr_mcp,etrade_mcp - Single MCP server (
quantstack-mcp) replaces separatequantcore-mcp+quantstack-mcp - CLI entry points renamed:
quantstack-api→quantstack-api,quantstack-mcp→quantstack-mcp,quantstack-monitor→quantstack-monitor - Python version requirement bumped from 3.10+ to 3.11+
- CLAUDE.md trimmed from ~50KB to ~32KB for context efficiency
- All test imports updated to
quantstack.* - Agent prompts and skill files updated with new paths and enhanced pre-trade intelligence
execute_options_trade()MCP tool — Black-Scholes paper fills with Greeks snapshot, Alpaca REST API for live options orders, premium-at-risk risk gate check, DTE bounds enforcement- Trading Operator prompt (
prompts/trading_operator.md) — unified Ralph loop for autonomous strategy discovery, execution, position management, review, and ML research - Production preflight gate (
src/quantstack/coordination/preflight.py) — 11-point readiness check
SlackClient— Bot Token API client with Block Kit formatting for 7 channelsConversationLogger— dual-write to DuckDB + Slack for desk agent reports, trades, alerts- 2 new DuckDB tables:
agent_conversations,signal_snapshots - 3 new MCP tools:
log_agent_conversation,log_signal_snapshot,post_slack_message
ReflexionMemory— classifies trade loss root causes, injects lessons into debate filterCreditAssigner— attributes losses to signal/regime/strategy/sizing stepHypothesisJudge— gates hypotheses against lookahead bias, known failures, data snoopingTextGradOptimizer— critiques losing trades, proposes prompt updates
packages/directory — all code moved tosrc/quantstack/packages/quant_arena/— historical simulation engine (userun_backtestMCP tool)examples/historical_quant_arena_ui/— Streamlit UI for quant_arena- Separate broker MCP packages from
packages/(kept inadapters/)
Note: Entries prior to v1.0.0 reference the old
packages/layout.
0.8.0 - 2026-03-18
The coordination layer enables the three Ralph loops (Strategy Factory, Live Trader, ML Research) to operate across ~700 symbols without human-in-the-loop intervention.
UniverseRegistry(packages/quantstack/coordination/universe_registry.py) — DuckDB-backed universe of SP500 + NASDAQ-100 + 50 liquid ETFs, weekly refresh via FD.aistock_screenerendpointCacheWarmer(packages/quantcore/data/cache_warmer.py) — nightly batch OHLCV delta-fetch for the full universe with configurable concurrency (default 10 parallel, within 1000 req/min rate limit)AutonomousScreener(packages/quantstack/autonomous/screener.py) — daily scoring of all universe symbols using 5-dimension weighted scoring (momentum 25%, volatility 20%, catalyst 20%, regime fit 20%, volume 15%), outputs tiered watchlist: Tier 1 (15 symbols, full treatment), Tier 2 (20, SignalEngine only), Tier 3 (15, monitored)WatchlistLoaderv2 — tiered loading fromscreener_resultstable, gated behindUSE_TIERED_WATCHLISTenv var
EventBus(packages/quantstack/coordination/event_bus.py) — DuckDB append-only event log with per-consumer cursors, 7-day TTL pruning; event types:strategy_promoted,strategy_retired,model_trained,degradation_detected,screener_completed,loop_heartbeat,loop_errorStrategyStatusLock(packages/quantstack/coordination/strategy_lock.py) — atomic compare-and-swap strategy status transitions preventing TOCTOU race conditions between concurrent loops- MCP tools:
publish_event,poll_events,record_heartbeat,get_loop_health,auto_promote_eligible,generate_daily_digest
AutoPromoter(packages/quantstack/coordination/auto_promoter.py) — evidence-basedforward_testing → livepromotion with configurable criteria (21d min age, 15 trades, Sharpe ≥ 0.5, DD ≤ 8%, win rate ≥ 40%), 4-week graduated position ramp (25% → 50% → 75% → 100%), max 8 concurrent live strategies cap; gated behindAUTO_PROMOTE_ENABLEDDegradationEnforcer(packages/quantstack/coordination/degradation_enforcer.py) — bridges DegradationDetector (advisory) to StrategyBreaker (enforced): CRITICAL →force_trip(), WARNING →force_scale()StrategyBreakerextensions:force_trip(strategy_id, reason)andforce_scale(strategy_id, scale_factor, reason)for external degradation enforcement
LoopSupervisor(packages/quantstack/coordination/supervisor.py) — monitors loop heartbeats, detects stale (3× expected interval) and dead (10×) loops, auto-restarts via tmux with exponential backoff (max 5 attempts)DailyDigest(packages/quantstack/coordination/daily_digest.py) — aggregated daily report (positions, P&L, strategy lifecycle, loop health, ML models, risk events) → Discord embed + markdownPortfolioOrchestrator(packages/quantstack/coordination/portfolio_orchestrator.py) — portfolio-level entry gating: no doubling, confidence ranking, correlation check (> 0.85 rejected), sector concentration cap (30%), position count capscripts/start_supervised_loops.sh— 5-pane tmux: Factory + Trader + ML + Supervisor + git auto-commit (every 5 min)
- 6 new DuckDB tables:
universe,screener_results,loop_events,loop_cursors,loop_heartbeats,strategy_outcomes - Total: 18 tables (up from 12)
scripts/bootstrap_rl_training.py— RL is experimental/shadow-mode only, bootstrap script was unusedscripts/check_ollama_health.py— system uses Groq, not Ollamascripts/run_trading_pipeline.py— superseded by SignalEngine + AutonomousRunner in v0.6.0scripts/run_intraday.py— referenced non-existentLiveIntradayLoopclassscripts/run_historical_quant_arena.sh— standalone shell script; userun_backtestMCP tool instead
WatchlistLoader— now reads fromscreener_resultstable (tiered) whenUSE_TIERED_WATCHLIST=true, falls back to existing behavior when offStrategyBreaker— addedforce_trip()andforce_scale()methods for external degradation enforcement (only escalates, never de-escalates)db.py— 3 new migration functions (_migrate_universe,_migrate_screener,_migrate_coordination); all idempotent
0.7.0 - 2026-03-18
- Three perpetual Ralph loops: Strategy Factory, Live Trader, ML Research
prompts/strategy_factory.md— autonomous strategy R&D loopprompts/live_trader.md— autonomous position monitoring + execution loopprompts/ml_research.md— autoresearch-inspired ML experimentation loop (Karpathy)scripts/start_loops.sh— tmux launcher (all|factory|trader|ml|trading)
train_ml_model— LightGBM/XGBoost/CatBoost with CausalFilter + FeatureEnrichertune_hyperparameters— Optuna Bayesian HPO with TimeSeriesSplit CVreview_model_quality— automated QA gate (accept/reject/retrain with feedback)train_stacking_ensemble— meta-learner on base model predictionstrain_cross_sectional_model— panel regression across stock universetrain_deep_model— TFT multi-horizon return predictor (1d/5d/20d)predict_ml_signal— live ML inference as MCP toolregister_model,get_model_history,rollback_model,compare_models— versioned model registrycheck_concept_drift— KS test per feature vs training distributionupdate_model_incremental— LightGBM warm-start retrainingcompute_and_store_features,get_feature_lineage— feature store with lineage
optimize_portfolio— HRP, min-variance, risk parity, max Sharpe, equal weightcompute_hrp_weights— López de Prado HRP with cluster tree + risk decompositionfit_garch_model— GARCH/EGARCH/GJR-GARCH volatility modeling (arch library)forecast_volatility— forward-looking conditional vol forecast + VaR
compute_deflated_sharpe_ratio— Bailey & López de Prado (2014) DSRrun_combinatorial_purged_cv— CPCV with purging + embargocompute_probability_of_overfitting— matched IS/OOS rank analysis (PBO)
get_strategy_gaps— regime coverage gap analysis from strategy DBpromote_draft_strategies— automated draft → forward_testing promotion + stale pruningcheck_strategy_rules— evaluate strategy entry/exit rules against live market data- Grammar-Guided GP (
grammar_gp.py) — evolutionary alpha template discovery with crossover/mutation
get_price_snapshot,list_sec_filings,get_company_facts,search_financial_statements— 100% FD.ai endpoint coverageanalyze_text_sentiment— dual-backend NLP (Groq LLM + optional FinBERT)
FeatureEnricher— unified feature computation for backtest + live + ML (4 tiers: fundamentals, earnings, macro, flow)- Flow features: insider net flow (90-day rolling), institutional accumulation/distribution
- Backtest engine enriched: strategy rules now support
fund_pe_ratio,yield_curve_10y2y,earn_days_to, etc.
- Data Scientist desk — ML training decisions, feature engineering, QA gate, SHAP interpretation, autoresearch workflow
- Watchlist desk — systematic universe screening, candidate scoring, rotation rules
TFTReturnPredictor— multi-horizon return forecasting via Temporal Fusion TransformerRegimeAugmenter— bootstrap-based synthetic data for rare regime augmentationrl_promotion_check()— RL shadow mode → live promotion gatecompute_optimal_schedule()— Almgren-Chriss optimal execution schedule- Memory files:
ml_experiment_log.md,ml_research_program.md - DuckDB tables:
model_registry,feature_store
0.6.0 - 2026-03-17
- CrewAI dependency —
crewai[anthropic]removed frompyproject.toml. The system no longer depends on CrewAI at runtime. TradingCrew(crews/trading_crew.py) — 13 IC agents + 6 pod managers + trading assistant. Replaced by SignalEngine (7 pure-Python collectors, 2–6 sec, no LLM).run_analysisMCP tool — deprecated since v0.3.0; useget_signal_briefinstead.run_multi_analysisMCP tool — userun_multi_signal_briefinstead.- IC-level MCP tools:
list_ics,run_ic,run_pod,run_crew_subset,get_last_ic_output— these instantiated TradingCrew internally. crews/tools.py,crews/assembler.py,crews/regime_config.py— crew-only modules.crews/config/tasks.yaml,crews/prompts/— CrewAI task/agent prompt configs.populate_ic_cache_from_resultfrom_state.py— depended onIC_AGENT_ORDERfrom deletedtrading_crew.py.- Deprecated wrappers in
agents/__init__.py:SuperTrader,create_all_pods,get_super_trader.
crewai_compat.py— rewritten as pure-Python stubs (notry: import crewaiblock). OnlyBaseTool,Flow,start,listen,routerretained for downstream tool/flow compatibility.TradingDayFlow—run_crew_analysisreplaced withrun_signal_analysisusingSignalEngine.run(). All crew references removed.TradingDayFlowAdapter— rewired to useSignalEngineinstead ofTradingCrew.llm_config.py—_build_ollama_llmno longer attemptsfrom crewai import LLM; returns plain model string.crews/__init__.py— now exports only Pydantic schemas (noTradingCrewre-export).flows/__init__.py— docstring updated to reflect SignalEngine usage.quantstack/__init__— version bumped to0.6.0.- MCP server instructions updated to reference
get_signal_briefas primary analysis tool. - QuantStack MCP tool count reduced from 43 to 34 (9 tools removed).
- Total MCP tool count reduced from 97 to 88.
SignalEngine(v0.5.0) remains the primary analysis path — no changes needed.AutonomousRunner,AlphaDiscovery,CausalFilter,Almgren-Chriss,DriftDetector,OutcomeTracker— added in v0.5.0, all pure Python.
0.2.1 - 2026-03-16
- Split
packages/quantcore/mcp/server.py(4500+ lines) intotools/sub-modules,_helpers.py, andresources.py - Split
packages/quantcore/data/storage.py(1400+ lines) into_ohlcv.py,_options_news.py,_schema.py, and_fundamentals_schema.py - Split
packages/quantstack/mcp/server.py(3300+ lines) intotools/sub-modules and_state.py - Split
packages/quantstack/knowledge/store.py(1900+ lines) into_learning.py,_messages.py,_performance.py,_schema.py,_trades.py,_waves_regime.py - Replaced monolithic
packages/quantstack/tools/mcp_bridge.pywithmcp_bridge/package
- Decomposed monolithic MCP test files into per-module test directories:
tests/quantstack/mcp/,tests/quantstack/tools/,tests/unit/quantcore_mcp/ - Added shared test fixtures in
tests/_fixtures/andtests/shared/
packages/shared/— shared utilities across packagespackages/quantcore/data/adapters/financial_datasets.py— Financial Datasets API adapter withfinancial_datasets_client.pyHTTP clientpackages/quantcore/data/fundamentals.py— fundamentals data modulehttpxcore dependency;financial-datasetsoptional extrapackages/quantcore/mcp/resources.py— MCP resource definitions (extracted from server)
- DuckDB lock guard improvements in
packages/quantstack/db.py - Updated coverage omit list in
pyproject.tomlfor new module paths
0.2.0 - 2026-03-15
alpaca_mcp— FastMCP server for Alpaca brokerage (11 tools: account queries, market data, order management, option chains; paper + live mode viaALPACA_PAPER)ibkr_mcp— FastMCP server for Interactive Brokers via IB Gateway (11 tools; degraded-startup design — server starts even if gateway is offline, tools return errors until reconnected)
BrokerInterface— abstract base with typed exceptions (BrokerConnectionError,BrokerOrderError,BrokerAuthError)UnifiedModels— broker-agnostic data model layer (UnifiedBalance,UnifiedOrder,UnifiedOrderResult,UnifiedPosition,UnifiedQuote)PreTradeRiskGate— 6 sequential pre-trade checks: kill switch, order size, position size, open positions cap, orders-per-minute rate limiter, daily drawdown haltKillSwitch— file-sentinel emergency halt (/tmp/KILL_TRADINGby default); survives process restarts; shell-activatable withtouchFillTracker— thread-safe in-memory position and P&L tracker with daily ledger and mark-to-market;reset_daily_pnl()called at market openSmartOrderRouter— best-execution routing: equities → Alpaca primary / IBKR fallback; futures/FX → IBKR only; paper mode forces Alpaca paper; per-broker health-check cache (5-min TTL)TCAEngine— Perold (1988) implementation shortfall with Almgren-Chriss square-root market impact; pre-trade cost forecast and algo recommendation (IMMEDIATE / TWAP / VWAP / POV / LIMIT); post-trade IS measurement vs arrival price, VWAP, and TWAPAsyncExecutionLoop— async event loop for non-blocking order processing
MicrostructureFeatureEngine— real-time tick-data signals: Order Flow Imbalance (OFI), Kyle's Lambda (price impact via OLS), bid-ask spread stats, VPIN (Volume-Synchronized Probability of Informed Trading), trade intensity, Roll (1984) effective spread estimator; pluggableon_trade/on_quotecallbacks for streaming ingestionOrderBookReconstructor— reconstructs limit order book state fromTradeTick+QuoteTickstreams
MeanVarianceOptimizer— Markowitz mean-variance with Ledoit-Wolf covariance shrinkage; objectives:MAX_SHARPE,MIN_VARIANCE,RISK_PARITY,MAX_DIVERSIFICATION; scipy SLSQP solver; per-position weight bounds; sector-level constraints; turnover cost penalty; automatic fallback to equal-weight on infeasible constraints
RLProductionConfig— versioned, env-driven config (QUANTRL_prefix); per-tier feature flags; shadow mode on by default; promotion thresholds (63-day shadow minimum for execution/sizing, 126-day for meta)KnowledgeStoreRLBridge— maps backtest results and trade history into RL training datasets- State vector modules for execution (8 features), sizing (10 features), and meta (36 features) agent tiers
OnlineAdapter— live trade outcome → real-time weight update with catastrophic forgetting guard and convergence checkPromotionGate— shadow → live validation: walk-forward folds (≥60% positive), Monte Carlo significance (p < 0.05), max drawdown (≤12%), Sharpe threshold (≥0.5)ShadowMode— RL recommendations tagged[SHADOW]; observations collected for future promotion validation without affecting executionRLTools— MCP tool implementations backing Phase 6 endpoints (get_rl_recommendation,promote_strategy, etc.)
backtesting/stats.py— extended backtest performance statistics (Calmar, Sortino, tail ratio)research/overfitting.py— overfitting detection and deflated Sharpe ratio utilities
- 12-module execution layer:
PaperBroker,EtradeBroker,OrderLifecycle(state machine: submitted → open → filled/cancelled),RiskGate(QuantStack wrapper),RiskState(hot-path in-memory mirror),BrokerFactory,MicrostructurePipeline,TickExecutor,SignalCache(DuckDB-backed with configurable TTL)
api/— FastAPI REST interface for trading operations (quantstack-apiCLI entry point, port 8420)audit/— immutableDecisionLogevent store logging every agent decision, execution event, and risk checkguardrails/— runtime sanity checks: signal plausibility validation, market halt detectionmonitoring/—AlphaMonitor(signal quality degradation alerts),DegradationDetector(IS vs OOS Sharpe divergence),Metrics(Sharpe, drawdown, consistency tracking)db.py— DuckDB schema and migrations; 12 tables shared via a single connection injected throughTradingContextcontext.py—TradingContextdependency injection container; all services share one DuckDB connection for ACID cross-service transactionsllm_config.py— multi-provider LLM routing (Bedrock, Anthropic, OpenAI, Vertex AI, Gemini, plus tier-2/3 providers); per-tier model overrides (LLM_MODEL_IC,LLM_MODEL_POD, etc.); automatic credential detection with fallback chain
portfolio_optimizer_agent.py— converts pod manager signals into mean-variance optimal capital weights subject to risk gate position limitsmicrostructure_signal_agent.py— generates trading signals from OFI, VPIN, and Kyle's Lambda tick-data featuresIntraDayMonitorFlow— real-time position monitoring loop that triggers stop-loss exits and partial reductions when thresholds are breached (quantstack-monitorCLI)StrategyValidationFlow— out-of-sample validation gate before strategy promotion fromforward_testingtoliveDecoderCrew— Phase 4 crew for reverse-engineering strategy rules from trade signal history
news_sentiment_ic— Alpha Vantage news ingestion + sentiment scoringoptions_flow_ic— unusual options activity (UOA) detectionfundamentals_ic— P/E ratio, debt metrics, earnings quality assessmentalpha_signals_pod_manager— synthesizes all three alpha signal ICsOptionsFlowTool,PutCallRatioTool— singleton tools registered inTOOL_REGISTRY
- 12 supported providers across three tiers:
- Tier 1 (recommended):
bedrock,anthropic,openai,vertex_ai,gemini - Tier 2:
azure,groq,together_ai,fireworks_ai,mistral - Tier 3:
ollama,custom_openai
- Tier 1 (recommended):
LLM_PROVIDERenv var selects the primary provider (default:bedrock)LLM_FALLBACK_CHAIN— comma-separated fallback providers tried in order if primary credentials are unavailable- Per-tier model overrides:
LLM_MODEL_IC,LLM_MODEL_POD,LLM_MODEL_ASSISTANT - Automatic per-provider credential detection (cached); agents degrade gracefully when a provider is unconfigured
- Nested provider settings with isolated env prefixes (prevents field name collisions):
AlpacaSettings(ALPACA_prefix):api_key,secret_key,paperPolygonSettings(POLYGON_prefix):api_keyIBKRSettings(IBKR_prefix):host,port,client_id,timeout
data_provider_priorityfield (default:alpaca,polygon,alpha_vantage); registry skips providers with missing credentials automaticallydata_end_datedefaults to today (was hardcoded2024-12-31); validator warns early whenALPHA_VANTAGE_API_KEYis unset
- Intraday timeframes added to
Timeframeenum andTIMEFRAME_HIERARCHY:M30(30-min),M15,M5,M1(order flow),S5(5-second HFT bars) - Per-timeframe
TimeframeParamstuned for intraday scales (EMA 9/21, RSI/ATR 9 at M5 and below)
CPCVEvaluator— Combinatorial Purged CV evaluator; feeds OOS returns into DSR (Deflated Sharpe Ratio) and PBO (Probability of Backtest Overfitting) for formal overfitting detectionOverfittingReportwith verdict:GENUINE | SUSPECT | OVERFIT
AlphaSelectionEnvironment:production_mode=TrueraisesValueErrorinstead of generating synthetic returns;from_knowledge_store()factory populates real IC signal historySizingEnvironment: sameproduction_modeguard andfrom_knowledge_store()factoryRLOrchestrator: acceptsknowledge_storekwarg; environments seeded with real trade history when provided; graceful warning (not error) when no store is supplied
SimulationResultextended with institutional reporting fields:- Sharpe ratio 95% CI (Lo 2002 method), Calmar ratio, sample size adequacy flag
- Benchmark comparison:
alpha,beta,information_ratiovsbenchmark_symbol(default: SPY) overfitting_verdictand summary fromCPCVEvaluatortca_report— aggregate TCA fromTCAEnginerecorded throughout simulationwalk_forward_summary— per-fold IS/OOS results whenwalk_forward_mode=True
HistoricalConfigadditions:benchmark_symbolfor alpha/beta/IR reportingmax_portfolio_correlation— correlation-concentration filter rejecting BUY orders that push avg pairwise portfolio correlation above threshold (default: 1.0 = disabled)walk_forward_mode,walk_forward_n_folds,walk_forward_test_days
SimBrokerenhancements:max_daily_loss_pctnow enforced in broker (was in config but not wired)update_prices()acceptsvolumes/volatilitiesenabling Almgren-Chriss impact-based slippage (replaces flat bps model when volume data is available)- Immutable
_order_audittrail separate from_orders(never filtered or modified post-hoc) - Intraday daily loss tracking:
_day_open_equityreset on each new trading day
Blackboardmigrated from markdown file to DuckDB (agent_memorytable): O(log n) SQL reads replace O(n) full-file scans; JSON content prevents prompt injection; concurrent writes are ACID-safe; public API unchanged — no callers needed to changeSkillTrackermigrated to DuckDB; adds IC (Information Coefficient) and ICIR (IC Information Ratio) metrics alongside win-rate — separates signal quality from position sizing and execution noise
- Full overhaul: all 12 LLM providers documented with example values
- Data provider section with
DATA_PROVIDER_PRIORITY, Alpaca, Polygon, Alpha Vantage, IBKR blocks - AWS Bedrock credential chain documented;
AWS_PROFILEexample for SSO - All previously undocumented env vars added (broker credentials, risk limits, Discord, RL config)
historical/risk_metrics.py— comprehensive backtesting risk metrics (Calmar ratio, Sortino ratio, drawdown distribution)
Dockerfile— Python 3.11-slim production image built withuv; health check on port 8420; volume mount for DuckDB persistencedocker-compose.yml— local development stack with volume persistence and source hot-reload.github/workflows/ci.yml— CI/CD pipeline: lint (ruff) → type check (mypy) → unit tests → integration tests
scripts/scheduler.py— APScheduler-based daily session triggers: 09:15 morning routine (review → meta → trade), 12:30 mid-day check, 15:45 pre-close check, 17:00 Friday weekly reflectscripts/bootstrap_rl_training.py— RL model initialization from historical OHLCV datascripts/log_decision.py— manual decision logging to the audit trail (for human-in-the-loop overrides)scripts/notify_discord.py— Discord webhook notification helper (used byAlphaMonitorfor degradation alerts)scripts/validate_brief_quality.py—DailyBriefquality checks (missing fields, low-confidence signals, empty pod notes)scripts/docker-entrypoint.sh— container entrypoint with command dispatch (api, etc.)
- Restructured to
packages/monorepo layout withquantcore,quant_arena,quantstack,etrade_mcp,alpaca_mcp,ibkr_mcp - Renamed package from
tradertoquantcore - Consolidated
math_models,microstructure,research,signalsinto mainquantcorepackage - eTrade OAuth layer moved from
packages/etrade_mcp/intopackages/quantstack/tools/etrade/;etrade_mcpis now a thin FastMCP wrapper delegating to the quantstack tools TradingDayFlowupdated: regime-adaptive crew config viaregime_config.py, signal cache handoff toTickExecutor, TCA arrival-price recording, RL online adapter shadow feedback loop
0.1.0 - 2024-12-04
- Multi-timeframe hierarchical trading system
- Event-driven backtesting engine with realistic costs
- Configurable position sizing and risk management
- DuckDB-based data storage and retrieval
- 200+ technical indicators across categories:
- Trend: EMA, SMA, MACD, ADX, Aroon
- Momentum: RSI, Stochastic, Williams %R, CCI
- Volatility: ATR, Bollinger Bands, Keltner Channels
- Volume: OBV, VWAP, Volume Profile
- Market Structure: Support/Resistance, Swing Points
- Gann Analysis: Swing points, retracements
- Wave Analysis: Elliott Wave detection
- Multi-timeframe feature factory
- Feature scaling and normalization utilities
- LightGBM, XGBoost, CatBoost model training
- Ensemble model with weighted averaging
- SHAP-based feature importance
- Hyperparameter tuning with Optuna
- PPO and DQN agents for trading
- Custom Gymnasium environments
- Multi-objective reward shaping
- Experience replay and prioritized sampling
- Statistical tests (ADF, Granger causality)
- Alpha decay analysis
- Walk-forward validation
- Harvey-Liu multiple testing correction
- Leakage detection utilities
- Limit order book simulation
- Price impact models (Almgren-Chriss, Bouchaud)
- Execution algorithms (TWAP, VWAP, IS)
- Market making simulation (Avellaneda-Stoikov)
- Geometric Brownian Motion
- Stochastic volatility (Heston, SABR)
- Kalman and particle filters
- Portfolio optimization utilities
- Mean reversion (z-score based)
- Momentum (multi-timeframe)
- Composite strategy framework
- Options strategies (covered calls, spreads)
- Alpha Vantage integration
- FRED economic data
- Earnings calendar
- News sentiment (extensible)
- Pydantic-based configuration
- Loguru structured logging
- Comprehensive test suite
- Type hints throughout
0.1.0- Initial release