virattt/ai-hedge-fund
53.5
Weak · 26 September 2026
7k
lines of production code
Python
primary language
4
measurements over time
What this system is
This system is a modular quantitative trading platform that manages the full lifecycle of a hedge fund, from alpha generation to execution. It provides a unified engine capable of running backtests, paper trading, and live operations using a consistent code path, ensuring deterministic and point-in-time accurate simulations. The architecture supports pluggable alpha models and a persistent ledger for tracking net asset value and decision history.
Features
Introduce v2 backtesting engine with point-in-time fund replay
The \hedge\_fund\ package now includes a complete v2 backtesting infrastructure that simulates trading alpha models and full fund mandates over historical data. The new \BacktestEngine\ allows users to backtest individual alpha models with configurable holding periods and equal-dollar sizing, while the \backtest\_fund\ function replays the entire fund pipeline (assessment, portfolio construction, risk checks, and execution) on a defined rebalance cadence (daily, weekly, or monthly). This engine enforces point-in-time data integrity by ensuring only data available at the simulation date is used, and it provides detailed performance metrics including NAV curves, Sharpe ratios, and drawdowns against a benchmark. The system is designed to be deterministic and honest by construction, using the same code path for backtests as for live execution.
_hedge\fund · high confidence
Behavioural changes
Complete v2 rewrite: new architecture, CLI, and documentation
The project has been rewritten from the ground up as version 2, replacing the previous monolithic script-based structure (agents.py, backtester.py, tools.py) with a modular, pluggable engine. The new system features a persistent 'fund' object, a unified \run\_cycle\ pipeline supporting backtest, paper, and live modes, and a new CLI (\aihf\) for interactive and non-interactive usage. Key architectural changes include the introduction of an \AlphaModel\ interface for analysts (both LLM-based and quantitative), a strategy/allocator system, and a persistent ledger for tracking decisions and NAV. The old Docker setup and single-file entry points have been removed in favor of a new project structure, with comprehensive documentation (VISION.md, ROADMAP.md) and an MIT license added.
(repo-wide) · high confidence
Dependencies
Dependency upgrade and Python 3.11 requirement
The project now requires Python 3.11 or higher and has upgraded its core dependencies, including bumping aiohttp from 3.11.8 to 3.14.3 and updating the Poetry lock file generator to 1.8.5. The pyproject.toml has been updated to reflect these changes, ensuring compatibility with the new dependency versions and the stricter Python version constraint.
(dependencies) · high confidence
Written by watchdog.canine.dev from the codebase's own history, inside the signed delivery this page is composed from.
How this codebase got here
Score
- CAI 53 → 54 (+0.2)
- Rubric changed (rubric-2026.08.15 → rubric-2026.09.15) — scores are not directly comparable.
Lenses
- Code Health 99 → 95 (-4.5)
- Architecture 95 → 95 (+0.5)
- Maturity 76 → 62 (-14.4)
- Readiness 17 → 26 (+8.7)
- Security 95 → 97 (+1.9)
Resolved (7)
- Coverage not measured — test suite did not build
- Dimension evaluation failed
- No exposed public API
- No tests found
- Rotate the exposed credentials — git history can't be un-committed
- Secret: square-access-token (poetry.lock)
- Test reliability not included
New (22)
- BacktestEngine._trade_ticker (cognitive 21) (hedge_fund/backtesting/engine.py)
- Duplicated block (12 lines × 2) (hedge_fund/tui/shared.py)
- FileTooLong: tui/app.py (hedge_fund/tui/app.py)
- High CVE: [GHSA redacted] (poetry.lock)
- Hotspot: hedge_fund/portfolio/construction.py (hedge_fund/portfolio/construction.py)
- Hotspot: hedge_fund/tui/shared.py (hedge_fund/tui/shared.py)
- Medium CVE: [GHSA redacted] (poetry.lock)
- Medium CVE: [GHSA redacted] (poetry.lock)
- Medium CVE: [GHSA redacted] (poetry.lock)
- Medium CVE: [GHSA redacted] (poetry.lock)
- Medium CVE: PYSEC-2026-76 (poetry.lock)
- Outdated: langchain-anthropic
- Outdated: python-dotenv
- app._fund_detail (cognitive 18) (hedge_fund/tui/app.py)
- client.extract_json (cognitive 19) (hedge_fund/llm/client.py)
- construction.blend_signals (cognitive 36) (hedge_fund/portfolio/construction.py)
- construction.blend_signals (cyclomatic 25) (hedge_fund/portfolio/construction.py)
- limits.apply_limits (cognitive 17) (hedge_fund/risk/limits.py)
- run.main (cognitive 16) (hedge_fund/run.py)
- shared._render_area_chart (cognitive 29) (hedge_fund/tui/shared.py)
- …and 2 more
Changes since last survey
- 25 commits — 23 feature/other, 2 fixes
By area
- (root) — 9 commits
- hedge_fund/llm — 7 commits
- (repo) — 2 commits
- hedge_fund/fund — 2 commits
- hedge_fund/brokers — 1 commit
- hedge_fund/features — 1 commit
- hedge_fund/pipeline — 1 commit
- hedge_fund/signals — 1 commit
- hedge_fund/tui — 1 commit
Notable commits
- fix: Fix selector colors
- fix: Merge pull request #719 from dajiaohuang/fix/issue-718-finite-sim-price
- change: Add --blind to keep the ticker, industry and dates out of LLM agent prompts
- change: Add Jev contract
- change: Add Jev to LLM picker
- change: Add JevLLM
- change: Add Opus 5.5
- change: Add astra and fable 5.1
- change: Add system diagram to README
- change: Add the latest models
- change: Blind the investor agents in every backtest, drop the --blind flag
- change: Bump version to 2.2.0
- change: Bump version to 2.2.1
- change: Bump version to 2.3.0
- change: Bump version to 2.3.1
- change: Bump version to 2.4.0
- change: Bump version to 2.4.1
- change: Derive strategy investment rules from analyst approaches
- change: Enforce analyst investment rules in portfolio construction
- change: Merge pull request #721 from lizhuojunx86/blind-prompts
- …and 5 more
Written by watchdog.canine.dev from the codebase's own history, inside the signed delivery this page is composed from.
Survey your own repository
virattt/ai-hedge-fund was measured the same way every project in this corpus was: the same rubric, at a pinned commit, with the result published in full. Point a surveyor at a repository you know and see whether you agree with it.
About this page
- The score is its most recent published measurement, taken on 26 September 2026 at a pinned commit. It is not a live figure and does not change until the project is measured again.
- Measured at commit 778e6bb3c6608ca2ee491383c9561af1909e3d95 — the exact code this score is about.
- Scored under rubric-2026.09.15 — the same rubric and the same method as every other entry in this index.
- Measured by watchdog.canine.dev using codehealth-analyzer preprod-09659c52afae.