Technical Architecture
PerpDesk's 5-layer technical architecture — from liquidity infrastructure to user interface.
Overview
PerpDesk is built on a 5-layer technical architecture designed for reliability, performance, and extensibility. Each layer has a distinct responsibility and communicates with adjacent layers through well-defined interfaces.
Layer 1: Liquidity Infrastructure
The foundation layer handles all exchange connectivity and data ingestion.
Responsibilities
- Maintaining WebSocket connections to all supported exchanges
- Normalizing market data into a common format
- Managing API rate limits and connection health
- Order routing and execution relay
- Exchange-specific protocol handling
Key Properties
- Multi-exchange — Simultaneous connections to all major perpetual futures venues
- Fault-tolerant — Automatic reconnection and failover
- Low-latency — Optimized data paths for time-sensitive operations
- Normalized — All exchanges present a uniform interface to upper layers
Layer 2: Data Layer
The data layer processes raw market data into structured, queryable formats.
Responsibilities
- Real-time OHLCV candle construction at multiple timeframes
- Order book aggregation and depth analysis
- Trade flow classification and analysis
- Historical data storage and retrieval
- Derived metric computation (ATR, volume profiles, etc.)
Key Properties
- Multi-timeframe — Simultaneous data at seconds, minutes, hours, and days
- Cross-exchange — Aggregated views across all connected venues
- Streaming — Real-time updates pushed to consuming layers
- Historical — Full history available for backtesting and analysis
Layer 3: Agent Layer
The agent layer is where PerpDesk's 8 AI agents operate.
Responsibilities
- Agent lifecycle management (start, stop, configure, monitor)
- Inter-agent communication and coordination pipeline
- Shared context management
- Agent state persistence and recovery
- Autonomy level enforcement
Key Properties
- Coordinated — Agents communicate through the structured pipeline
- Isolated — Agent failures don't cascade to other agents
- Configurable — Each agent's behavior is independently tunable
- Observable — Full visibility into every agent decision and action
Layer 4: Application Layer
The application layer handles business logic, user management, and system orchestration.
Responsibilities
- User authentication and authorization
- Portfolio and position management
- Risk limit configuration and enforcement
- Notification and alerting
- Team management and collaboration features
- Strategy persistence and versioning
Key Properties
- Multi-tenant — Isolated environments for each user/team
- Secure — End-to-end encryption for sensitive data
- Auditable — Complete audit trail of all actions
- Extensible — Plugin architecture for custom functionality
Layer 5: UI Layer
The user interface layer presents all PerpDesk functionality in an intuitive, responsive interface.
Responsibilities
- Real-time dashboard rendering
- Agent monitoring and configuration UI
- Trading interface with advanced order entry
- Performance analytics visualization
- Team collaboration features
- Mobile and desktop experiences
Key Properties
- Real-time — Sub-second updates for all market data and agent activity
- Responsive — Optimized for desktop, tablet, and mobile
- Customizable — Drag-and-drop layout with configurable panels
- Accessible — Designed for extended use without fatigue
Cross-Layer Concerns
Several concerns span multiple layers:
- Security — Encryption at rest and in transit, API key management, access control
- Observability — Logging, metrics, and tracing across all layers
- Performance — Latency budgets enforced at each layer boundary
- Resilience — Graceful degradation when individual components fail