Technical Architecture
PerpDesk's 4-layer architecture, from market data ingestion to real-time trading interface.
Overview
PerpDesk is built on a 4-layer architecture designed for reliability and real-time performance. Each layer has a distinct responsibility and communicates with adjacent layers through well-defined interfaces. The entire system is event-driven, with a central message bus connecting 30+ containerized services.
Layer 1: Data
The foundation layer handles market data ingestion and processing.
What It Does
- Maintains connections to multiple exchanges for real-time market data (currently ingesting from 5 exchanges)
- Normalizes data into a common format across venues
- Computes technical indicators, tracks open interest, funding rates, and volume
- Stores time-series data (candles, indicators, OI, funding, volume) for historical analysis
- Monitors macro events that may impact markets
Key Properties
- Multi-exchange — Simultaneous data from all major perpetual futures venues
- Normalized — All exchanges present a uniform interface to upper layers
- Time-series optimized — Purpose-built storage for market data at multiple timeframes
- Streaming — Real-time updates pushed to consuming layers as events occur
Layer 2: Intelligence
The intelligence layer is where PerpDesk's AI agents analyze markets and coordinate decisions.
What It Does
- 7 AI agents analyze market conditions across crypto perps and prediction markets, plus an orchestrator that routes requests
- Agents use LLM-based analysis (except Brix, which is deterministic) to reason about market context
- Consensus debate (War Room) surfaces agreement and disagreement across agents
- Risk filtering ensures every recommendation passes through Brix before execution
- Analysis results are cached for performance (hot cache + persistent storage)
Key Properties
- Coordinated — Agents communicate through a structured pipeline; each agent's output informs the next
- Isolated — Agent failures don't cascade; fallback logic preserves system stability
- Configurable — Each agent's behavior is independently tunable via autonomy levels and parameters
- Observable — Full visibility into every agent decision, reasoning, and confidence level
Layer 3: Execution
The execution layer handles order placement and position lifecycle management.
What It Does
- Routes orders to the appropriate exchange via exchange adapters (Hyperliquid, Lighter, and others)
- Manages the full trade execution lifecycle through a workflow engine
- Monitors open positions with stop-loss and take-profit management
- Enforces risk limits on every order before submission
Key Properties
- Multi-venue — Orders route to the best available exchange
- Lifecycle managed — Positions are tracked from entry to exit with automated SL/TP
- Risk-gated — Every order passes through Brix's risk checks before execution
Layer 4: Interface
The interface layer delivers everything to you in real time.
What It Does
- Real-time dashboard with market data, agent activity, and portfolio tracking
- Agent chat — message your agents directly, with the Orchestrator routing to the right specialist
- War Room visualization showing consensus debates between agents
- Trading UI with order entry, position management, and shortcut widgets
- In-app notifications streamed in real time via SSE (server-sent events)
Key Properties
- Real-time — Live updates for all market data, agent activity, and positions
- Interactive — Chat with agents, approve recommendations, configure strategies
- Customizable — Layout and widgets adapt to your trading style
Cross-Layer Concerns
Security
- Non-custodial — funds stay on exchanges, PerpDesk sends orders via exchange APIs
- Encrypted credential storage for exchange API keys
- Per-user session isolation — agents don't share context between users
- Audit logging of all trades, configurations, and approvals
Observability
- Structured JSON logging across all services
- Metrics collection and dashboards for system health monitoring
- Full decision tracing from market data through agent analysis to execution
The Coordination Architecture Advantage
Making multiple AI agents work together without conflicting is one of the hardest problems in agentic systems. PerpDesk's inter-agent communication protocol ensures structured consensus, not compromise.
The result: higher conviction outputs, trade plans that are peer-reviewed by domain specialists before reaching you. No single agent's blind spot becomes your portfolio's risk.