Published Last updated Reviewed by Signal Desk editorial (systems & risk)
A production AI trading agent is not a single model call. It is a composed system: data planes, decision services, risk gates, execution adapters, and observability — wired so that failure is local and recoverable.
This article outlines a practical blueprint used by serious desks building autonomous or semi-autonomous crypto systems. Treat it as a reference architecture you can thin down for research or harden for live capital.
Design principles
- Separate cognition from control — models propose; risk services dispose.
- Make state explicit — inventory, limits, regime, and open orders live in typed stores, not chat history.
- Prefer idempotent actions — retries must not double-spend or double-order.
- Observe everything — if you cannot reconstruct why a trade happened, you cannot improve the agent.
- Degrade gracefully — stale data or model outages should force flat or human mode, not improvisation.
Core invariant
Models propose · risk disposes
-
Cognition Decision core Signals · planner · tools
-
Output Order intent Propose only
-
Control Risk gate Allow · reduce · reject
-
Action Execution Venue adapters
If the model can talk the risk system out of a limit, you do not have a risk system.
Reference layers
System schema
Full agent stack (logical boundaries)
- 1 · Data Ingress & market data — normalize venues; dual clocks; quality flags.
- 2 · Features Feature & context assembly — online features + structured context for planners.
- 3 · Policy Decision core — signals, planner, tools, policy compiler → order intents.
- 4 · Risk Risk gate (mandatory) — independent allow/reduce/reject; keys never on model path.
- 5 · Exec Execution adapters — venue auth, types, SOR, reconciliation.
- 6 · Memory Ledger & memory — positions, intents, fills, episodic notes.
- 7 · Ops Control plane — modes, kill switches, alerts, human-in-the-loop.
Keep logical boundaries even in a monolith. Split later along failure domains—not marketing modules.
1. Ingress & market data plane
Expanded treatment: Data Stack for AI Trading Agents.
WebSocket and REST collectors normalize venue feeds into a canonical event schema. Include sequence numbers, receive timestamps, and quality flags. A dedicated data quality service marks feeds as healthy, delayed, or dead — downstream modules must refuse to trade on dead data.
Venue WS/REST → Normalizer → Event bus
↓
Feature store (online)
Historical lake (offline)
2. Feature & context assembly
Online features power low-latency decisions (book imbalance, short-horizon volatility, inventory skew). Offline/batch features capture slower structure (regime clusters, funding cycles, narrative scores). Context for LLM planners is assembled as structured tool outputs — never as raw firehose dumps.
3. Decision core (the “agent”)
Implement as modules that can be mixed:
- Signal models — scores, forecasts, classifiers
- Planner — LLM or rules engine selecting a playbook
- Tool layer — portfolio query, risk preview, simulators, venue health
- Policy compiler — converts high-level intent into order intents with size caps
For crypto, multi-agent designs (research agent, risk agent, execution agent) are popular, but start with a single orchestrator and hard interfaces. Coordination tax is real.
The planner can be smart. The order path must be boring.
4. Risk gate (mandatory)
Independent process or service that validates every order intent against: max position, max notional, max daily loss, symbol allowlist, leverage caps, concentration, and venue status. The risk gate is not optional middleware — it is the product boundary between “research toy” and “capital system.”
The model must not be able to bypass the risk gate by prompting, configuration, or direct venue credentials. Keys and signing live behind the execution/risk path only.
5. Execution adapters
Per-venue adapters handle auth, rate limits, order types, and reconciliation. A smart order router (SOR) may split flow, but keep the agent’s mental model at the intent level: target exposure, urgency, max slippage. Microstructure tactics belong in execution, not in the LLM prompt.
6. Memory & ledger
- Operational memory — positions, balances, open orders, last decision IDs
- Episodic memory — trade rationales, incident notes, regime tags
- Ledger — immutable record of intents, approvals, fills, cancels
Vector stores are optional for narrative recall. A reliable relational or time-series store for money state is not optional.
7. Control plane & human loop
Dashboards, kill switches, mode toggles (shadow / paper / live), and alert routing. Human-in-the-loop should be a first-class mode: agent proposes, human approves above a notional threshold.
Latency tiers
Not every decision needs the same speed:
Latency schema
Hot · warm · cold paths
- Hot · ms–s Market making, skew, cancel/replace — deterministic microcontrollers only; no LLM in the loop.
- Warm · s–min Tactical entries, funding, alert hedges — models OK if risk gate and latency budget hold.
- Cold · min–h Research, rebalance, narrative review — natural home for LLM planners and heavy tools.
Hybrid systems win because they respect physics and fees—not because every layer is “AI.”
Put LLMs on warm/cold paths. Put deterministic microcontrollers on hot paths.
Recommended service split
services/
marketdata/ # ingest + normalize
features/ # online feature compute
agent-core/ # policy + tools + planner
risk/ # limits + kill switch
execution/ # venue adapters + SOR
ledger/ # intents & fills
ops-api/ # UI, auth, mode control
observability/ # metrics, traces, logs
Monoliths are fine early. Keep logical boundaries even if processes are co-located. When you scale, split along failure domains: market data crashes should not take risk offline without a safe default.
Security surfaces
- API keys in HSM/KMS with least privilege (trade vs withdraw separation)
- Prompt injection resistance when tools can read web/social content
- Signed config for risk parameters; no silent remote edits
- Network isolation between research notebooks and live order path
Evolution path
Maturity ladder
Widen autonomy only after measurement wins
-
Rules + risk + execution + logs Boring path that can halt and reconstruct every decision.
-
ML signals offline · shadow live Score without authority; compare shadow vs would-have-traded.
-
Agent planner for research & playbooks Tool use and narrative on cold/warm paths only.
-
Limited autonomy Tight notional + symbol scope; human or hard gates above threshold.
-
Expand after evaluation gates See evaluation ladder—no skip rungs.
Architecture is a product of risk appetite. Start narrow. Widen only when measurement is stronger than marketing.
How to apply this
How to design a modern AI trading agent architecture.
- Lock design principles. Keep risk independent of alpha, fail closed on bad data, and keep non-deterministic models off the order hot path unless explicitly gated.
- Draw the reference layers. Split market data, features, decision core, risk gate, execution adapters, ledger/memory, and control plane.
- Make risk a separate service. Risk must dispose (allow/block/reduce) independently of the policy that proposes trades.
- Assign latency tiers. Place only critical path components on ultra-low latency; keep research, LLM narrative, and heavy analytics off hot path.
- Plan the evolution path. Start with rules + risk, then ML signals, then selective agentic tooling—promote only after evaluation and ops gates.
Frequently asked questions
What is a good architecture for an AI trading agent?
A composed system with market data ingress, feature assembly, a decision core, a mandatory independent risk gate, venue execution adapters, ledger/memory, and a human control plane with kill switches.
Why must risk be a separate service?
So models cannot bypass position, loss, or venue limits. Risk is a product boundary between research demos and systems allowed to risk capital.
Should LLMs run on the order hot path?
Usually no. Use deterministic logic for millisecond-to-second execution and reserve LLMs for research, playbook selection, and lower-frequency decisions.
What is the recommended evolution path for trading agents?
Start with rules + risk + execution + logs; add offline ML shadow scores; introduce planners for research; promote limited autonomy only after evaluation gates pass.
Related: Data Stack · Types of AI Trading Agents · How to Build an AI Trading Agent · What Is an AI Trading Agent? · Backtesting & Evaluating Trading Agents
