An AI-powered algorithmic trading system — a multi-agent AI cluster generates and iterates on trading strategies, while a deterministic engine validates and executes them.
Proton is split into two primary domains:
- Agentic Layer: A multi-agent cluster consisting of a Researcher, Strategist, and Critic that collaborate to produce structured trading strategies. The agents iterate internally until the Critic approves a proposal, which is then submitted to the engine as a JSON contract via gRPC
- Trading Engine: The deterministic core and "source of truth." It ingests live market data, validates strategy proposals through backtesting, monitors the market for trade signals, and executes orders through broker APIs
More information can be found in the design documentation.
A background daemon maintains a persistent WebSocket connection to the broker, streaming real-time OHLCV bars and indicators. Data is distributed internally via System.Threading.Channels and externally to the Agentic Layer via gRPC streaming.
When a strategy proposal arrives from the agents, the engine runs an automated backtest against locally cached Parquet data. Walk-Forward Analysis (in-sample vs. out-of-sample splits) is used to prevent overfitting, ensuring agents can't simply "game" the backtester with curve-fitted strategies.
Strategies that pass validation enter the live execution flow:
- Strategy Watcher: A stateful monitor that watches the live market stream for the strategy's technical triggers
- Signal Generation: When entry/exit rules are met, a signal is emitted
- Risk Circuit Breaker: Validates position sizing, global drawdown limits, and account equity before allowing execution
- Order Manager: Executes via the
IBrokerinterface
Failed trades and rejected backtests generate Post-Mortem reports stored in PostgreSQL. This context is fed back into the Agentic Layer so future strategy iterations learn from past outcomes.
- Separation of Concerns: The AI agents never touch the broker directly. All execution flows through the deterministic C# engine
- Anti-Overfitting: Walk-forward analysis ensures strategies are validated on unseen data, not just optimized on historical noise.
- Idempotent Indicators: The same technical-analysis library (Skender) is used in both backtesting and live execution to prevent indicator drift
- Risk-First: A circuit breaker sits between signal generation and order execution, enforceable via an admin kill switch over gRPC (this might change..)
- Strategy TTL: Pending strategies expire to prevent accumulation of stale watchers
- Concurrency Safety:
SemaphoreSlimandChannelsmanage simultaneous backtesting and live data processing without deadlocks
A simplified control interface providing:
- Start/Stop engine controls
- Read-only view of open positions and trade history
- Kill switch that triggers the Risk Circuit Breaker to cancel all orders and halt watchers
- Agent instruction updates via the Agentic REST API