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.
Architecture
A structured agent hierarchy mirrors a real hedge fund organizational chart โ with clear roles, capital authority, and reporting lines between agents.
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.
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.
Developer API
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 Library
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) | |
| agent_mean_rev | RSI extremes, Bollinger Band reversion | 4โ48 hours | +0.31 (moderate) | |
| agent_arb | Cross-exchange price differences | < 60 seconds | +0.05 (near-zero) | |
| agent_dca | Time-based accumulation, BTC/ETH only | Open indefinite | +0.92 (very high) |
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.
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.
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.
Performance Reporting
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.
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.
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.
Referral Income
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.
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.
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 โ