System Architecture

Built for Speed, Scale, and Reliability

A modern microservices architecture designed for real-time algorithmic trading across multiple venues.

Modern Foundation

React 19
Frontend UI framework
TypeScript 5.9
Strict type safety
.NET 10
Backend API & engine
SignalR
Real-time hubs (MessagePack)
React Flow v12
Visual canvas editor
Zustand 5
Client state management
TimescaleDB
Time-series market data
Redis 7
Event bus (Streams)
TigerBeetle
Double-entry ledger
gRPC
Venue connector protocol
Docker
Container orchestration
Tailwind CSS 4
Utility-first styling

System Overview

SynthTrader High-Level Architecture

Dual-Path Market Data Pipeline

Two paths optimised for different requirements: minimal latency for the engine, and durable recording for history.

Direct Path

Venue WebSocket → StreamManager → PatchEngineService

Purpose: Minimal latency for live strategy execution. Sub-100ms from exchange to module processing.

Decoupled Path

All Venues → gRPC → Redis Streams → 3 parallel consumers

Consumers: MarketDataBridge (fan-out), MarketDataRecorder (TimescaleDB), BarAggregator (OHLCV)

Dual-Path Data Flow

10Hz Tick Loop

CapabilitySpecification
Tick rate10 ticks/second (100ms interval)
Processing orderTopological sort via Kahn's algorithm
Cycle preventionRejected at cable-connection time
Probe systemReal-time signal inspection, throttled to 30 updates/sec
Transport protocolSignalR with MessagePack binary encoding
Thread safetyLock-based mutation, async probe broadcast

8 Exchange Connectors

Each venue runs as an independent Docker container with gRPC MarketData, TradeFlow, and Admin services.

VenueSymbol FormatTypegRPC Port
BinanceBTCUSDTSpot5060
BybitBTCUSDTSpot5061
KrakenBTC/USDTSpot5062
OKXBTC-USDTSpot5063
CoinbaseBTC-USDSpot5064
DeribitBTC-PERPETUALDerivatives5081
Binance FuturesBTCUSDTUSD-M Perps5065
OKX FuturesBTC-USDT-SWAPPerp Swaps5068

12 SignalR Hubs

Bidirectional real-time communication via SignalR with MessagePack binary protocol.

HubEndpointPurpose
PatchHub/hubs/patchModule/cable CRUD, parameter updates, patch state
ProbeHub/hubs/probeReal-time signal data streaming
StateHub/hubs/statePatch lifecycle and activation
LogHub/hubs/logsStructured log broadcasting
TradeHub/hubs/tradesTrade fill notifications
StrategyHub/hubs/strategyStrategy lifecycle and status
MarketHub/hubs/marketLive market ticker data (4Hz, multi-venue)
RiskHub/hubs/riskRisk events, dead-man switch heartbeat
BacktestHub/hubs/backtestBacktest progress and results streaming
OverwatchHub/hubs/overwatchOverwatch regime + strategy status (1Hz)
ScreenerHub/hubs/screenerMulti-symbol screener scan results
SupervisorHub/hubs/supervisorAI supervisor decisions and audit trail

Docker Compose Multi-Container

Infrastructure Layer

TimescaleDB (PostgreSQL 16), Redis 7, TigerBeetle — persistent data stores with bind-mounted volumes.

Application Layer

API server, Ledger gRPC service, MarketData poller, Python sidecar, React client — independently scalable services.

Venue Layer

8 exchange connectors as independent containers. Each provides gRPC MarketData, TradeFlow, and Admin services.

TigerBeetle Double-Entry Ledger

Every financial event is recorded as a double-entry transaction. No balance can be lost or miscounted.

LedgerIDPurpose
Cash1Available capital and margin
Position2Open position accounting
Fees3Trading fees and commissions
Realised PnL4Closed trade profit/loss
Margin5Locked margin for leveraged positions
Funding PnL6Perpetual swap funding payments