Dev.to
7/19/2026

Designing Safe API Boundaries for a Multi-Pair Spot Trading Bot
Short summary
The author details the architecture of NOVA, a Telegram-based system for automating repeatable Spot trading cycles across multiple exchange pairs. Key design decisions include isolating each market pair into its own runtime process for fault tolerance and abstracting exchange-specific behavior behind a Protocol-based runtime bundle so the trading core never touches raw exchange responses. The article covers failure modes like lost HTTP responses, WebSocket disconnects, and credential updates mid-order, explaining how normalized domain concepts enable safer recovery logic.
- •NOVA isolates each trading pair into a separate process with its own API credential context for strong fault isolation
- •Exchange-specific behavior is abstracted behind a Protocol-based runtime bundle, keeping the trading core exchange-agnostic
- •The architecture handles production failure modes including lost HTTP responses, WebSocket disconnects, and mid-cycle credential changes
Generated with AI, which can make mistakes.
Is this a good recommendation for you?



