Summary
BinanceClient manually builds three separate WebSocket streams (kline, depth, trades). Binance supports combined streams via a single connection which reduces overhead and simplifies reconnect logic.
What needs to be done
- Replace individual stream connections with a single combined stream:
wss://stream.binance.com:9443/stream?streams=btcusdt@kline_1m/btcusdt@depth20/btcusdt@trade
- Route each message by
stream field to the correct handler
- Support dynamic stream subscription updates (change symbol/interval without full reconnect)
- Implement
IExchangeClientFactory to create and manage named client instances
Acceptance criteria
References
src/Omnijure.Core/Entities/Exchange/BinanceClient.cs
src/Omnijure.Core/Entities/Exchange/IExchangeClientFactory.cs
- Binance combined stream docs:
wss://stream.binance.com:9443/stream
Summary
BinanceClientmanually builds three separate WebSocket streams (kline, depth, trades). Binance supports combined streams via a single connection which reduces overhead and simplifies reconnect logic.What needs to be done
wss://stream.binance.com:9443/stream?streams=btcusdt@kline_1m/btcusdt@depth20/btcusdt@tradestreamfield to the correct handlerIExchangeClientFactoryto create and manage named client instancesAcceptance criteria
IExchangeClientFactory.Create(clientId)returns an isolated client instanceReferences
src/Omnijure.Core/Entities/Exchange/BinanceClient.cssrc/Omnijure.Core/Entities/Exchange/IExchangeClientFactory.cswss://stream.binance.com:9443/stream