At the moment, a complete order book snapshot is maintained by xchange-stream or fetched directly using XChange, then sent down the web socket every time something changes. Where we have streaming order books (binance, bitfinex, coinbase pro, possibly Bitmex) we should let the assembly be managed by the JS client so we only send changes down the wire.
The problem here is that all the different exchanges manage their updates using different protocols. For example, with Binance we have repeated resync attempts to manage, with API calls, when something gets out of sync. This can totally be done in JS (and in fact, having all those resync attempts running from the client rather than the server helps us in terms of rate limits) but probably means managing those things using ccxt instead of XChange... which is itself something I've been pondering for a while.
At the moment, a complete order book snapshot is maintained by xchange-stream or fetched directly using XChange, then sent down the web socket every time something changes. Where we have streaming order books (binance, bitfinex, coinbase pro, possibly Bitmex) we should let the assembly be managed by the JS client so we only send changes down the wire.
The problem here is that all the different exchanges manage their updates using different protocols. For example, with Binance we have repeated resync attempts to manage, with API calls, when something gets out of sync. This can totally be done in JS (and in fact, having all those resync attempts running from the client rather than the server helps us in terms of rate limits) but probably means managing those things using ccxt instead of XChange... which is itself something I've been pondering for a while.