DEV Community

Tapesh Chandra Das
Tapesh Chandra Das

Posted on

I Built a Fully Local, AI-Native Hedge Fund System (Multi-Agent, Auditable, No Paid APIs)

Most “AI trading projects” fall into one of three categories:

notebook experiments
single-model pipelines
or black-box systems with no observability

They don’t resemble real trading systems.

So I built something closer to production reality:

A free, portable, AI-native hedge fund prototype with:

multi-agent decision making
backtesting + paper execution
full audit infrastructure
and zero paid API dependencies

Project:
https://github.com/td-02/ai-native-hedge-fund

What this actually is

This is not just a model.

It’s a complete trading runtime with:

data ingestion
research layer
strategy ensemble
risk management
execution system
audit + tracing

All wired together into a single pipeline.

From the README:

“A production-grade multi-agent trading system with backtesting, paper execution, and full audit infrastructure. No paid APIs required.”

Why I built this

The gap is simple:

Most people optimize models.
Real systems fail on integration, control, and visibility.

This project focuses on:

system design over isolated intelligence
traceability over black-box outputs
reliability over demos
Architecture (high-level)

The system runs as a structured pipeline:

Data Ingest
→ Data Quality Gate
→ Research Agent
→ Strategy Ensemble
→ Overlays (alpha / arbitrage / macro)
→ Fund Manager
→ Risk Manager
→ Execution Controls
→ Broker Router
→ Audit + Tracing

There’s also a more advanced AI-native v2 layer with:

regime-aware routing
AI forecast calibration
benchmark-relative optimization
“no-harm” guards

This is closer to how institutional systems evolve over time.

Multi-agent system (core idea)

Instead of one model making decisions, the system uses:

Research & Data
market data ingestion (yfinance)
deterministic + LLM-based research
multi-agent research council
Strategy Layer
trend following
mean reversion
volatility carry
event-driven strategies
alpha signals (earnings, volume, options proxies, etc.)
Risk & Execution
portfolio aggregation
VaR / ES constraints
drawdown brakes
TWAP/VWAP-style execution
broker failover

Each component is independent but coordinated.

What makes this different

  1. Fully free stack yfinance for data Ollama for local LLMs Alpaca for paper execution

No paid APIs required.

  1. Auditability by design

Every decision is:

logged
traceable
reproducible

Artifacts include:

audit logs in Postgres
decision snapshots
TraceLM execution traces
heartbeat monitoring

This is rarely implemented properly in open projects.

  1. Production-style reliability

The system includes:

circuit breakers per stage
retries and degraded modes
data quality validation
dead-man heartbeat

These are not typical in hobby projects, but essential in real systems.

  1. Runs anywhere

You can deploy it on:

Docker
Oracle Always Free
Render / Railway
GitHub Actions (scheduled execution)

This makes it practical, not just experimental.

Backtest performance (honest view)

The current strategy (momentum + trend, ETF universe):

Sharpe: ~0.61
CAGR: ~7.6%
Max drawdown: ~-25.8%

Comparable to SPY in some regimes, worse in others.

This is intentional.

The goal here is not “alpha marketing” — it’s building the system correctly first.

Observability (critical but ignored in most projects)

This system includes:

TraceLM-based execution tracing
structured audit logs
decision-level introspection

You can answer:

why a trade happened
which agent contributed
what constraints were applied

Without this, scaling any AI system becomes guesswork.

Enterprise-style runtime (beyond toy setups)

The system already includes:

FastAPI service layer
Celery worker queues (research / strategy / execution)
Redis + Postgres/TimescaleDB
feature flags
metrics (Prometheus)

This is closer to a distributed system than a script.

What’s still missing

This is not production-ready.

Key gaps:

stronger portfolio optimization
execution realism (slippage, liquidity impact)
better regime detection (HMM, change-point models)
more robust ML layers (RL, transformers)
real capital deployment safeguards

These are hard problems and intentionally not abstracted away.

Who this is for
ML engineers moving into finance
developers interested in multi-agent systems
early quant developers
people tired of toy AI demos
Key lessons from building this
Systems matter more than models
Observability is non-negotiable
Reliability is harder than intelligence
Finance is a coordination problem, not just prediction
Final note

Most AI projects optimize for:

demos
benchmarks
or isolated components

This project tries to optimize for:

structure
traceability
and real system constraints

If you’re building in AI + systems + finance, this is the direction that actually compounds.

Top comments (0)