The delays are even worse on Futures since binance turned off permessage-deflate
support (which was reported many times but still completely ignored.)
To measure delays, we subscribe to @trade
streams for all USDT pairs on Spot or @aggTrade
on Futures and measure the difference between Event.T and the time the event was received.
Subscription is done either in 2 threads (BTC is always in a separete thread, other altcoins on 2nd thread) or in N threads.
The N and whether to work with Spot or Futures are specified in the config.txt
The asnwer is obvious: If you are a serious trader, you should run it forever. Be sure. the lag will happen exactly when you max your position and don't expect any bad.
If there is a possibility of several things going wrong, the one that will cause the most damage will be the one to go wrong
-- Murphy's laws
data: {"stream":"sxpusdt@trade","data":{"e":"trade","E":1600001556423,"T":1600001556418,"s":"SXPUSDT","t":16207863,"p":"1.7560","q":"0.4","X":"MARKET","m":true}}
data: {"stream":"bnbusdt@trade","data":{"e":"trade","E":1600012010422,"T":1600012010416,"s":"BNBUSDT","t":24304526,"p":"30.126","q":"5.02","X":"MARKET","m":true}}
For those who has the misfortune of living not in Asia and who wants to use the API for manual trading, Frankfurt AWS:
data: {"stream":"ontusdt@trade","data":{"e":"trade","E":1600004682694,"T":1600004682688,"s":"ONTUSDT","t":13294672,"p":"0.7548","q":"2.5","X":"MARKET","m":false}}
data: {"stream":"xtzusdt@trade","data":{"e":"trade","E":1600004685713,"T":1600004685705,"s":"XTZUSDT","t":32607370,"p":"2.610","q":"44.6","X":"MARKET","m":true}}
data: {"stream":"bandusdt@trade","data":{"e":"trade","E":1600004687377,"T":1600004687372,"s":"BANDUSDT","t":11119309,"p":"8.6255","q":"34.0","X":"MARKET","m":true}}
data: {"stream":"btcusdt@trade","data":{"e":"trade","E":1600089182477,"T":1600089182471,"s":"BTCUSDT","t":208017356,"p":"10571.15","q":"0.101","X":"MARKET","m":true}}
data: {"stream":"btcusdt@trade","data":{"e":"trade","E":1600089182599,"T":1600089182593,"s":"BTCUSDT","t":208017441,"p":"10565.19","q":"0.709","X":"MARKET","m":true}}