How It Works
A high-level overview of the plutarc architecture — from strategy configuration to live trade execution.
Overview
plutarc is split into three layers: the dashboard (where you configure strategies and monitor performance), the backend (which stores your data, manages billing, and coordinates deployments), and the bot (a dedicated compute instance that connects to your exchange and executes trades).
When you deploy a bot, the backend provisions a dedicated instance in your chosen region. The bot process starts, decrypts your API key, connects to the exchange via WebSocket and REST, and begins evaluating your strategy on every new candle.
Data Flow
The platform follows a continuous loop from market data to trade execution to performance tracking:
- Market data ingestion — The bot subscribes to real-time candlestick, orderbook, and trade streams from the exchange via WebSocket. It also polls REST endpoints for account state (balances, positions, open orders).
- Signal evaluation — On each new candle close, the bot evaluates all enabled strategy components. Indicators are computed from the candle history, and each component produces its output (signal score, filter pass/fail, guard check, or exit trigger).
- Combination & decision — Signal scores are combined according to the template's combination mode. Filters and entry guards must pass. If the combined score exceeds the threshold and the current time falls within an active trading session, the bot proceeds to entry.
- Order execution — The bot places orders on the exchange via REST API. It tracks fills, manages position state, and applies exit rules on every subsequent candle until the position is closed.
- Reporting — Completed trades, equity snapshots, signal states, and bot events are written back to the backend. The dashboard queries this data in real time to display KPIs, analytics, and activity feeds.
Exchange Connectivity
Each bot maintains two types of connections to the exchange:
WebSocket (real-time)
Public streams provide live candlestick data, orderbook updates, and recent trades. Private streams deliver real-time notifications about order fills, position changes, and wallet balance updates. WebSocket connections are persistent and automatically reconnect on interruption.
REST (on-demand)
REST endpoints are used for placing, amending, and cancelling orders, as well as querying account balances, fee rates, and historical data. REST calls include rate limiting and automatic retry with backoff to respect exchange limits.
When an API key has testnet mode enabled, the bot connects to the exchange's testnet endpoint instead of the production API. All connectivity patterns — WebSocket streams, REST calls, rate limiting, and reconnection logic — operate identically. The only difference is the target URL.
Position Tracking & Sync
The bot maintains an internal model of all open positions, synchronised with the exchange through both WebSocket updates and periodic REST reconciliation. This dual approach ensures accuracy even if individual WebSocket messages are missed during network interruptions.
Position data — including side, size, entry price, unrealised PnL, and leverage — is written to the backend and displayed in the dashboard's Open Positions table. When a position is closed, the bot records the complete trade with entry/exit prices, fees, hold duration, signal state at entry, and MFE/MAE excursion metrics.
Region Selection & Latency
When deploying a bot, you choose a deployment region and provider. Regions closer to the exchange's matching engine result in lower order latency, which can affect fill quality on shorter timeframes (1m, 5m). For longer timeframes, region choice has minimal impact.
See Compute Providers & Regions for exchange matching engine locations, live latency measurements, and guidance on choosing the best region for your strategy.
Bot Lifecycle
Bots follow a defined lifecycle from deployment to teardown:
- Provisioning — A dedicated compute instance is created in the selected region.
- Deploying — The bot process is installed and configured with your strategy template and encrypted API key.
- Online — The bot connects to the exchange and begins evaluating your strategy. It sends periodic heartbeats to confirm it is operational.
- Paused (optional) — The bot stops opening new positions but continues receiving market data and managing existing positions. Exit rules remain active.
- Stopped — The compute instance has been deprovisioned. No residual data remains on the instance. Your configuration, trades, and analytics are preserved in the backend.
The dashboard shows the current lifecycle state for each bot along with connection status, uptime, and the full deployment history. See Bots for the full lifecycle states and transitions.
Stateless Architecture & Configuration
Bots are inherently stateless. They hold no persistent local state and cannot function without a configuration supplied by the backend. All strategy templates, risk limits, API key references, and runtime parameters live exclusively in the plutarc backend — the bot is a pure execution layer.
Real-Time Configuration Subscription
On startup, each bot subscribes to its own configuration via a real-time reactive query over a persistent WebSocket connection to the backend. When you change a setting in the dashboard — pause the bot, adjust a risk limit, or swap the strategy template — the update propagates to the running bot within milliseconds, with no restart or redeployment required.
Local Cache for Resilience
The bot maintains a local cache of its last-known configuration. If the WebSocket connection to the backend is briefly interrupted — due to a network hiccup or transient backend maintenance — the bot continues operating against the cached configuration until connectivity is restored and the subscription resumes.
What This Means in Practice
- No orphaned state — stopping a bot leaves nothing behind on the instance. Your configuration, trade history, and analytics are safe in the backend.
- Instant config updates — changes made in the dashboard reach the bot in real time without downtime.
- Network resilience — transient connectivity issues do not halt trading; the bot falls back to its cached configuration until the connection recovers.