broker-failover-secondary-account-routing · v1.1.0 · 2026-07-25 · sha256 9b6a6dde49730a85
broker-failover-secondary-account-routing v1.1.0A
Immutable. This exact content is served forever at /api/v1/blob/9b6a6dde49730a85.
--- name: Broker Failover & Secondary Account Routing description: Institutional-grade circuit breaker and failover router for high-availability algorithmic trading systems. version: 1.1.0 --- # Broker Failover & Secondary Account Routing This skill provides a rigorously engineered **Broker Failover Router** leveraging the Circuit Breaker design pattern. It ensures robust continuation of algorithmic order flow by dynamically rerouting to a secondary broker account when primary API connections degrade, experience latency spikes, or return critical HTTP 503/429 errors. ## Core Features 1. **Circuit Breaker Pattern (CLOSED, OPEN, HALF_OPEN):** Protects primary connections from cascading failures. 2. **Concurrency Safe:** Built-in threading locks handle concurrent order streams from multiple alpha models without race conditions. 3. **Automated Half-Open Probing:** After a predefined exponential backoff/timeout period, the system probes the primary broker with a single test order. 4. **Symbol Translation Mapping:** Normalizes canonical tickers to broker-specific formats (e.g., `AAPL` -> `AAPL STK SMART` vs `AAPL.S`). ## Integration Checklist Check the `assets/checklist.md` for a comprehensive onboarding guide to integrate this into your institutional quant infrastructure. ## Folder Structure - `scripts/`: Contains the core `failover_router.py` implementation and `test_failover_router.py` unit tests. - `references/`: Documentation on institutional routing standards and sequence workflows. - `assets/`: Integration checklists. *Note: For production deployment, ensure the timeout values and backoff mechanisms are tuned to the specific exchange latency characteristics.*