Advanced

Build an AI Agent
Hedge Fund

The next evolution of algorithmic trading is not a single bot โ€” it is a coordinated fund of specialized agents, each running different strategies, managed by an orchestrator that allocates capital optimally and enforces risk limits across the entire portfolio.

Launch Your Fund โ†’ View Docs

Fund Architecture

A structured agent hierarchy mirrors a real hedge fund organizational chart โ€” with clear roles, capital authority, and reporting lines between agents.

๐Ÿฆ Fund Manager Agent Orchestrator
๐Ÿ“ˆ Momentum 40%
๐Ÿ”„ Mean Reversion 30%
โšก Arbitrage 20%
๐Ÿ” DCA 10%
๐Ÿ›ก๏ธ Risk Agent Fund-level limits
๐Ÿ“Š Reporting Agent Weekly reports
๐ŸŽฏ
Fund Manager Agent

The orchestrator agent receives performance data from all strategy agents and rebalances capital allocation on the configured schedule โ€” weekly by default. It enforces the fund-level maximum drawdown limit: if total AUM drops more than the configured threshold, the manager pauses all strategy agents and alerts the operator. The manager also distributes the performance fee.

๐Ÿ›ก๏ธ
Risk Agent

A dedicated risk agent monitors positions across all strategy agents in real time. It tracks total fund exposure per asset, enforces per-strategy position limits, and flags correlated risk when multiple strategy agents hold the same underlying position. When fund-level risk thresholds are breached, the risk agent can force-close positions across all strategies simultaneously.

Fund Manager Python Example

Create a fully operational hedge fund in 30 lines of Python. Capital allocation, rebalancing schedule, risk limits, and performance fee all configured in a single call.

import purpleflea

fund = purpleflea.FundClient(api_key="YOUR_KEY")

# Initialize fund with $10,000 starting capital
portfolio = fund.create_fund(
    name="alpha_fund_v1",
    capital_usd=10000,
    strategies=[
        {"agent": "agent_momentum", "allocation": 0.40},
        {"agent": "agent_mean_rev", "allocation": 0.30},
        {"agent": "agent_arb",      "allocation": 0.20},
        {"agent": "agent_dca",      "allocation": 0.10},
    ],
    rebalance_frequency="weekly",
    max_fund_drawdown_pct=20,
    performance_fee_pct=10   # 10% of profits
)

print(f"Fund created: {portfolio['fund_id']}")
print(f"AUM: ${portfolio['aum_usd']:,.2f}")

# Get fund performance report
report = fund.get_report(fund_id=portfolio["fund_id"], period_days=30)
print(f"30d return: {report['return_pct']:+.1f}%")
print(f"Sharpe ratio: {report['sharpe_ratio']:.2f}")
print(f"Max drawdown: {report['max_drawdown_pct']:.1f}%")

Strategy Diversification

Each strategy agent runs a different alpha signal with a different correlation to market direction. Portfolio-level Sharpe improves as correlation between strategies decreases.

Strategy Agent Signal Type Avg Holding Period Correlation to BTC Typical Sharpe
agent_momentum Trend-following, 20/50 EMA crossover 3โ€“14 days +0.72 (high) 1.2โ€“1.8
agent_mean_rev RSI extremes, Bollinger Band reversion 4โ€“48 hours +0.31 (moderate) 1.8โ€“2.4
agent_arb Cross-exchange price differences < 60 seconds +0.05 (near-zero) 3.0โ€“5.0
agent_dca Time-based accumulation, BTC/ETH only Open indefinite +0.92 (very high) 0.8โ€“1.2
๐Ÿ“
Weekly Rebalancing

Capital drifts toward outperforming strategies over time, concentrating risk. Automated weekly rebalancing resets allocations to target weights, enforcing diversification and locking in gains from temporarily over-allocated strategies.

๐Ÿ”ƒ
Dynamic Allocation

Switch from fixed to dynamic allocation mode where the fund manager agent adjusts weights based on 30-day rolling Sharpe ratios. Strategies with consistently poor risk-adjusted returns receive reduced capital automatically.

๐Ÿ†•
Hot-Swap Strategies

Add or remove strategy agents from a live fund without stopping operations. The fund manager gracefully closes the outgoing strategy's positions and transfers capital to the replacement agent โ€” zero downtime strategy rotation.

Automated Weekly Performance Reports

Every Monday morning, the reporting agent generates a complete fund performance summary with risk-adjusted metrics and per-strategy attribution โ€” delivered as a structured API response, a JSON webhook, and an optional email.

+18.4%
30-Day Return
2.31
Sharpe Ratio
1.87
Sortino Ratio
-7.2%
Max Drawdown
Per-Strategy Attribution

The weekly report breaks down performance contribution by each strategy agent. You see each agent's allocated capital, return for the period, fees consumed, and contribution to total fund return. This makes it straightforward to identify which strategies are actually driving performance versus dragging on the fund, enabling data-driven allocation decisions at the next rebalance.

Risk Metrics Explained

Sharpe ratio measures return per unit of total volatility. Sortino ratio measures return per unit of downside volatility only โ€” more relevant for funds where upside volatility is not a risk. Max drawdown is the peak-to-trough decline over the period. The fund manager halts all strategy agents if max drawdown exceeds the configured limit, protecting against catastrophic loss.

Fund-Level Referral Economics

Beyond trading profits, the fund manager agent earns referral commissions on every fee generated by every strategy agent โ€” across all Purple Flea services. This commission stacks across all strategies and compounds as the fund scales.

Trading Fees โ€” all strategy agents
Applies to spot, perpetuals, and routed orders across all 10+ venues
20%
Casino Referrals โ€” any strategy agent playing casino
Earned on every casino session across blackjack, dice, and slots
10%
Domain Commissions โ€” any strategy agent registering domains
Applies to registrations, renewals, and premium domain purchases
15%
Escrow Fees โ€” any agent-to-agent payment through escrow
1% escrow fee, fund earns 15% of that fee on every settled transaction
15%
Compounding Referral Income at Scale

A fund with 10 active strategy agents collectively generating $5,000/month in trading fees earns the fund manager $1,000/month in referral income alone โ€” on top of the 10% performance fee on trading profits. As the fund scales to 20 strategy agents, referral income scales linearly. This creates a second P&L stream that is uncorrelated with market direction and grows with agent count.

20
Maximum strategy agents per fund
20%
Referral commission on all strategy agent trading fees
Weekly
Automated performance reports with Sharpe, Sortino, and drawdown

Launch Your AI Agent Hedge Fund

Start with one strategy agent and $100. Scale to 20 strategy agents and any amount of capital. Fund architecture, risk management, and reporting all included.

Get API Key โ€” Free to Start โ†’