Case study · Expert Advisors & Integrations
Unified Broker API Gateway
A unified API gateway aggregating connectivity across multiple major retail brokers (Interactive Brokers, OANDA, Tradier, Alpaca). Features WebSocket-based order streams, failover routing, and account synchronization.
- Primary Tech
- TypeScript / Node
- Caching Engine
- Redis Cache
- Target Platform
- Multi-Broker
Client work under NDA. Client names, trading data, performance figures and live screens are not shown. This page describes the problem, what we built and the technology used.
The client
A trading software provider whose product needed to work with several retail brokers.
The problem
A trading software provider needed unified execution architecture across several major retail brokers.
- Interactive Brokers, OANDA, Tradier and Alpaca each have different APIs, authentication, order types and symbols.
- Each new broker meant new code throughout the product.
- Dropped connections left orders and positions out of sync with the broker.
Our approach
We built one API gateway in TypeScript and Node.js. The product talks to one normalised API, and an adapter for each broker handles the differences.
How we built it
- 1
Normalised model and broker adapters
Orders, positions and accounts use one internal format. Each broker has an adapter that translates to and from its own API.
- 2
WebSocket order streamer
Order updates, fills and account changes from every broker arrive at the product as one WebSocket stream.
- 3
State sync cache
Positions, orders and balances are cached in Redis and regularly reconciled with each broker, so the product always shows the broker's real state.
- 4
Automatic failover
Connections run with redundant instances. If one drops, another takes over, reconnects and resynchronises the account state.
How we tested it
- Each broker's paper or sandbox environment.
- Forced disconnections during open orders, to confirm state is restored correctly.
- The same order flow run through every adapter to confirm consistent results.
What we delivered
- The gateway deployed on the provider's infrastructure.
- API documentation for the product team and a guide for adding a broker.
- Support after launch.
The result
The provider's product works with four brokers through one API, and adding a broker means writing one adapter instead of changing the product.
Features
- Aggregated API connectivity
- WebSocket order streamer
- Automatic failover routing
- State sync cache
Technology
- TypeScript
- Node.js
- Redis
- WebSockets
Start here