Inconsistency of websockets since yesterday

Hello, since yesterday, when I connect to websocket, subscription to a stream take more time than usual (sometimes more than 10s), and the stream of data arrives in a very inconsistent manner, It sometimes pauses for 10 or 20s before having a new message.
This behavior is also seen on Binance main site, where I can see going from “stable connection” to “unstable connection” to “reconnecting” very often, and the order book is not updated during that time.

Am I the only one having this issue? I see no information about that anywhere.

I have to add that my connection is not the problem, I have stable ping and bandwith when it occurs

I am writing to bring to your attention certain inconsistencies I’ve observed in the market data received from the WebSocket streams while operating my high-frequency arbitrage bot. My bot operates by continuously receiving data from the WebSocket and executing trades using the SPOT API WebSocket. I’d like to highlight a specific instance, within a timeframe of approximately 71 milliseconds, where my bot executed 4 batches of trades.

During these trades, my bot persists in monitoring the market prices for BNBBTC, BTCUSDT, and BNBUSDT. According to the WebSocket, these prices appeared stable within the 71 ms window:

  • price_BNBBTC_bid=0.006952
  • price_BTCUSDT_bid=35144.17
  • price_BNBUSDT_ask_1231=245.0

However, the stability suggested by the WebSocket data did not match the prices I encountered when executing MARKET orders. Notably, the bid price for BNBBTC that I received for each trade differed from the WebSocket-reported price. It seems implausible that the market price would exactly revert to its previous state after each trade execution, especially within such a short timeframe and across multiple occurrences.

This discrepancy leads me to believe that there are timing inconsistencies in the data provided by the WebSocket. The impact on high-frequency trading strategies, which rely on precision and timeliness, is substantial. To enhance accuracy and enable us to measure latency effectively, I propose that Binance considers including precise timestamps with each piece of data sent through the WebSocket. This addition would significantly aid in synchronizing our trading algorithms with the actual market movements.

I appreciate your attention to this matter and hope that it can be addressed promptly to ensure the reliability and accuracy of the data we depend on for our trading strategies.

Here is the log:

2023-11-05 11:26:47.000606 Arbitrage ID: 0156453a-6c85-4b14-98a4-0dc86a976248, log: Arbitrage opportunity 1->2->3->1 found with ['BNBBTC', 'BNBUSDT', 'BTCUSDT'] price_BNBBTC_bid=0.006952, price_BTCUSDT_bid=35144.17, price_BNBUSDT_ask_1231=245.0 and opportunity 1.0005193693322503
2023-11-05 11:26:47.000606 CHECK!!!! Arbitrage ID: 0156453a-6c85-4b14-98a4-0dc86a976248, log: Arbitrage opportunity 1->2->3->1 found with ['BNBBTC', 'BNBUSDT', 'BTCUSDT'] price_BNBBTC_ask=0.006954, price_BNBBTC_bid=0.006952, price_BTCUSDT_ask=35144.18, price_BTCUSDT_bid=35144.17, price_BNBUSDT_ask_1231=245.0, price_BNBUSDT_bid=244.8 and opportunity 1.0005193693322503
2023-11-05 11:26:47.000607 0156453a-6c85-4b14-98a4-0dc86a976248: Arbitrage opportunity found _ precise log happened at 2023-11-05 11:26:47.606
2023-11-05 11:26:47.000616 Creating order: {'id': '0dfaf897-c760-4837-9873-df69a6331151', 'symbol': 'BNBBTC', 'side': 'SELL', 'order_type': 'MARKET', 'quantity': 0.042}
2023-11-05 11:26:47.000617 Creating order: {'id': 'f1fc96e5-1243-4234-b837-f6dcf5401b85', 'symbol': 'BTCUSDT', 'side': 'SELL', 'order_type': 'MARKET', 'quantity': 0.00029}
2023-11-05 11:26:47.000617 Creating order: {'id': '26fc2767-e8d2-43ee-b5b9-44f472265ade', 'symbol': 'BNBUSDT', 'side': 'BUY', 'order_type': 'MARKET', 'quantity': 0.042}
2023-11-05 11:26:47.000621 Received: {"id":"0dfaf897-c760-4837-9873-df69a6331151","status":200,"result":{"symbol":"BNBBTC","orderId":1749586468,"orderListId":-1,"clientOrderId":"4G9CvxiK3En4047nCUo1h0","transactTime":1699183607622,"price":"0.00000000","origQty":"0.04200000","executedQty":"0.04200000","cummulativeQuoteQty":"0.00029219","status":"FILLED","timeInForce":"GTC","type":"MARKET","side":"SELL","workingTime":1699183607622,"fills":[{"price":"0.00695700","qty":"0.04200000","commission":"0.00003128","commissionAsset":"BNB","tradeId":228480435}],"selfTradePreventionMode":"EXPIRE_MAKER"},"rateLimits":[{"rateLimitType":"ORDERS","interval":"SECOND","intervalNum":10,"limit":50,"count":1},{"rateLimitType":"ORDERS","interval":"DAY","intervalNum":1,"limit":160000,"count":1},{"rateLimitType":"REQUEST_WEIGHT","interval":"MINUTE","intervalNum":1,"limit":6000,"count":3}]}
2023-11-05 11:26:47.000621 ---------------------------------------------------------------------
2023-11-05 11:26:47.000621 1231_1st: Status: FILLED
2023-11-05 11:26:47.000621 1231_1st: At time: 1699183607622
2023-11-05 11:26:47.000621 1231_1st: Sell Price_bid (BNBBTC): 0.00695700
2023-11-05 11:26:47.000621 1231_1st: Volume of BNB Sold: 0.04200000
2023-11-05 11:26:47.000621 1231_1st: Volume of BTC bought: 0.00029219
2023-11-05 11:26:47.000621 1231_1st: Transaction Fees: 0.00003128 BNB
2023-11-05 11:26:47.000621 ---------------------------------------------------------------------
2023-11-05 11:26:47.000623 Received: {"id":"f1fc96e5-1243-4234-b837-f6dcf5401b85","status":200,"result":{"symbol":"BTCUSDT","orderId":23098547092,"orderListId":-1,"clientOrderId":"fIUisIrCbF3Qk5TYNaMZhO","transactTime":1699183607622,"price":"0.00000000","origQty":"0.00029000","executedQty":"0.00029000","cummulativeQuoteQty":"10.19180930","status":"FILLED","timeInForce":"GTC","type":"MARKET","side":"SELL","workingTime":1699183607622,"fills":[{"price":"35144.17000000","qty":"0.00029000","commission":"0.00003127","commissionAsset":"BNB","tradeId":3269132123}],"selfTradePreventionMode":"EXPIRE_MAKER"},"rateLimits":[{"rateLimitType":"ORDERS","interval":"SECOND","intervalNum":10,"limit":50,"count":2},{"rateLimitType":"ORDERS","interval":"DAY","intervalNum":1,"limit":160000,"count":2},{"rateLimitType":"REQUEST_WEIGHT","interval":"MINUTE","intervalNum":1,"limit":6000,"count":4}]}
2023-11-05 11:26:47.000623 ---------------------------------------------------------------------
2023-11-05 11:26:47.000623 1231_2nd: Status: FILLED
2023-11-05 11:26:47.000623 1231_2nd: At time: 1699183607622
2023-11-05 11:26:47.000623 1231_2nd: Sell Price_bid (BTCUSDT): 35144.17000000
2023-11-05 11:26:47.000623 1231_2nd: Volume of BTC Sold: 0.00029000
2023-11-05 11:26:47.000623 1231_2nd: Volume of USDT bought: 10.19180930
2023-11-05 11:26:47.000623 1231_2nd: Transaction Fees: 0.00003127 BNB
2023-11-05 11:26:47.000623 ---------------------------------------------------------------------
2023-11-05 11:26:47.000623 Received: {"id":"26fc2767-e8d2-43ee-b5b9-44f472265ade","status":200,"result":{"symbol":"BNBUSDT","orderId":4865491379,"orderListId":-1,"clientOrderId":"KpyOYvsVAlwbqi4GDLIBWg","transactTime":1699183607622,"price":"0.00000000","origQty":"0.04200000","executedQty":"0.04200000","cummulativeQuoteQty":"10.28160000","status":"FILLED","timeInForce":"GTC","type":"MARKET","side":"BUY","workingTime":1699183607622,"fills":[{"price":"244.80000000","qty":"0.04200000","commission":"0.00003150","commissionAsset":"BNB","tradeId":678654759}],"selfTradePreventionMode":"EXPIRE_MAKER"},"rateLimits":[{"rateLimitType":"ORDERS","interval":"SECOND","intervalNum":10,"limit":50,"count":3},{"rateLimitType":"ORDERS","interval":"DAY","intervalNum":1,"limit":160000,"count":3},{"rateLimitType":"REQUEST_WEIGHT","interval":"MINUTE","intervalNum":1,"limit":6000,"count":5}]}
2023-11-05 11:26:47.000623 Time for the socket to open: 10 milliseconds
2023-11-05 11:26:47.000623 Time taken for the trade to execute: 6 milliseconds
2023-11-05 11:26:47.000623 Total time: 16 milliseconds
2023-11-05 11:26:47.000623 ---------------------------------------------------------------------
2023-11-05 11:26:47.000623 1231_3rd: Status: FILLED
2023-11-05 11:26:47.000623 1231_3rd: At time: 1699183607622
2023-11-05 11:26:47.000623 1231_3rd: Buy Price_ask (BNBUSDT): 244.80000000
2023-11-05 11:26:47.000623 1231_3rd: Volume of USDT Sold: 10.28160000
2023-11-05 11:26:47.000624 1231_3rd: Volume of BNB bought: 0.04200000
2023-11-05 11:26:47.000624 1231_3rd: Transaction Fees: 0.00003150 BNB
2023-11-05 11:26:47.000624 ---------------------------------------------------------------------
2023-11-05 11:26:47.000624 Arbitrage taken opportunity 1231 = 0.99898 compared to 1.00052, difference = -0.00154
2023-11-05 11:26:47.000624 
2023-11-05 11:26:47.000624 WebSocket connection closed. Attempting to reconnect.
2023-11-05 11:26:47.000625 Arbitrage ID: 9a9bcff7-6793-4b0b-bf1c-7a1ae1f2ed22, log: Arbitrage opportunity 1->2->3->1 found with ['BNBBTC', 'BNBUSDT', 'BTCUSDT'] price_BNBBTC_bid=0.006952, price_BTCUSDT_bid=35144.17, price_BNBUSDT_ask_1231=245.0 and opportunity 1.0005193693322503
2023-11-05 11:26:47.000625 CHECK!!!! Arbitrage ID: 9a9bcff7-6793-4b0b-bf1c-7a1ae1f2ed22, log: Arbitrage opportunity 1->2->3->1 found with ['BNBBTC', 'BNBUSDT', 'BTCUSDT'] price_BNBBTC_ask=0.006954, price_BNBBTC_bid=0.006952, price_BTCUSDT_ask=35144.18, price_BTCUSDT_bid=35144.17, price_BNBUSDT_ask_1231=245.0, price_BNBUSDT_bid=244.8 and opportunity 1.0005193693322503
2023-11-05 11:26:47.000625 9a9bcff7-6793-4b0b-bf1c-7a1ae1f2ed22: Arbitrage opportunity found _ precise log happened at 2023-11-05 11:26:47.625
2023-11-05 11:26:47.000633 Creating order: {'id': '916156f9-211a-49a2-b878-6a78fe5d1f52', 'symbol': 'BNBBTC', 'side': 'SELL', 'order_type': 'MARKET', 'quantity': 0.042}
2023-11-05 11:26:47.000634 Creating order: {'id': '2e58388b-cfbf-4585-b232-fc495ce4a532', 'symbol': 'BTCUSDT', 'side': 'SELL', 'order_type': 'MARKET', 'quantity': 0.00029}
2023-11-05 11:26:47.000634 Creating order: {'id': 'b0ec1460-0368-4fb9-8b3f-a14e54f72261', 'symbol': 'BNBUSDT', 'side': 'BUY', 'order_type': 'MARKET', 'quantity': 0.042}
2023-11-05 11:26:47.000636 Received: {"id":"916156f9-211a-49a2-b878-6a78fe5d1f52","status":200,"result":{"symbol":"BNBBTC","orderId":1749586494,"orderListId":-1,"clientOrderId":"FYZ8fAe3nvCbkJgf21WgEn","transactTime":1699183607639,"price":"0.00000000","origQty":"0.04200000","executedQty":"0.04200000","cummulativeQuoteQty":"0.00029223","status":"FILLED","timeInForce":"GTC","type":"MARKET","side":"SELL","workingTime":1699183607639,"fills":[{"price":"0.00695800","qty":"0.04200000","commission":"0.00003128","commissionAsset":"BNB","tradeId":228480440}],"selfTradePreventionMode":"EXPIRE_MAKER"},"rateLimits":[{"rateLimitType":"ORDERS","interval":"SECOND","intervalNum":10,"limit":50,"count":1},{"rateLimitType":"ORDERS","interval":"DAY","intervalNum":1,"limit":160000,"count":1},{"rateLimitType":"REQUEST_WEIGHT","interval":"MINUTE","intervalNum":1,"limit":6000,"count":8}]}
2023-11-05 11:26:47.000636 ---------------------------------------------------------------------
2023-11-05 11:26:47.000636 1231_1st: Status: FILLED
2023-11-05 11:26:47.000636 1231_1st: At time: 1699183607639
2023-11-05 11:26:47.000636 1231_1st: Sell Price_bid (BNBBTC): 0.00695800
2023-11-05 11:26:47.000636 1231_1st: Volume of BNB Sold: 0.04200000
2023-11-05 11:26:47.000636 1231_1st: Volume of BTC bought: 0.00029223
2023-11-05 11:26:47.000636 1231_1st: Transaction Fees: 0.00003128 BNB
2023-11-05 11:26:47.000636 ---------------------------------------------------------------------
2023-11-05 11:26:47.000640 Received: {"id":"2e58388b-cfbf-4585-b232-fc495ce4a532","status":200,"result":{"symbol":"BTCUSDT","orderId":23098547097,"orderListId":-1,"clientOrderId":"opLlbA1zLUHHcCLzKURYIt","transactTime":1699183607639,"price":"0.00000000","origQty":"0.00029000","executedQty":"0.00029000","cummulativeQuoteQty":"10.19180930","status":"FILLED","timeInForce":"GTC","type":"MARKET","side":"SELL","workingTime":1699183607639,"fills":[{"price":"35144.17000000","qty":"0.00029000","commission":"0.00003127","commissionAsset":"BNB","tradeId":3269132125}],"selfTradePreventionMode":"EXPIRE_MAKER"},"rateLimits":[{"rateLimitType":"ORDERS","interval":"SECOND","intervalNum":10,"limit":50,"count":2},{"rateLimitType":"ORDERS","interval":"DAY","intervalNum":1,"limit":160000,"count":2},{"rateLimitType":"REQUEST_WEIGHT","interval":"MINUTE","intervalNum":1,"limit":6000,"count":9}]}
2023-11-05 11:26:47.000640 ---------------------------------------------------------------------
2023-11-05 11:26:47.000640 1231_2nd: Status: FILLED
2023-11-05 11:26:47.000640 1231_2nd: At time: 1699183607639
2023-11-05 11:26:47.000640 1231_2nd: Sell Price_bid (BTCUSDT): 35144.17000000
2023-11-05 11:26:47.000640 1231_2nd: Volume of BTC Sold: 0.00029000
2023-11-05 11:26:47.000640 1231_2nd: Volume of USDT bought: 10.19180930
2023-11-05 11:26:47.000640 1231_2nd: Transaction Fees: 0.00003127 BNB
2023-11-05 11:26:47.000640 ---------------------------------------------------------------------
2023-11-05 11:26:47.000641 Received: {"id":"b0ec1460-0368-4fb9-8b3f-a14e54f72261","status":200,"result":{"symbol":"BNBUSDT","orderId":4865491491,"orderListId":-1,"clientOrderId":"kpxbyVArkWUvODxZyBOaNl","transactTime":1699183607640,"price":"0.00000000","origQty":"0.04200000","executedQty":"0.04200000","cummulativeQuoteQty":"10.28160000","status":"FILLED","timeInForce":"GTC","type":"MARKET","side":"BUY","workingTime":1699183607640,"fills":[{"price":"244.80000000","qty":"0.04200000","commission":"0.00003150","commissionAsset":"BNB","tradeId":678654765}],"selfTradePreventionMode":"EXPIRE_MAKER"},"rateLimits":[{"rateLimitType":"ORDERS","interval":"SECOND","intervalNum":10,"limit":50,"count":3},{"rateLimitType":"ORDERS","interval":"DAY","intervalNum":1,"limit":160000,"count":3},{"rateLimitType":"REQUEST_WEIGHT","interval":"MINUTE","intervalNum":1,"limit":6000,"count":10}]}
2023-11-05 11:26:47.000641 Time for the socket to open: 8 milliseconds
2023-11-05 11:26:47.000641 Time taken for the trade to execute: 7 milliseconds
2023-11-05 11:26:47.000641 Total time: 15 milliseconds
2023-11-05 11:26:47.000641 ---------------------------------------------------------------------
2023-11-05 11:26:47.000641 1231_3rd: Status: FILLED
2023-11-05 11:26:47.000641 1231_3rd: At time: 1699183607640
2023-11-05 11:26:47.000641 1231_3rd: Buy Price_ask (BNBUSDT): 244.80000000
2023-11-05 11:26:47.000641 1231_3rd: Volume of USDT Sold: 10.28160000
2023-11-05 11:26:47.000641 1231_3rd: Volume of BNB bought: 0.04200000
2023-11-05 11:26:47.000641 1231_3rd: Transaction Fees: 0.00003150 BNB
2023-11-05 11:26:47.000641 ---------------------------------------------------------------------
2023-11-05 11:26:47.000641 Arbitrage taken opportunity 1231 = 0.99884 compared to 1.00052, difference = -0.00168
2023-11-05 11:26:47.000641 
2023-11-05 11:26:47.000642 WebSocket connection closed. Attempting to reconnect.
2023-11-05 11:26:47.000643 Arbitrage ID: 36e96a33-5991-40a4-bebc-b04daa7eccb6, log: Arbitrage opportunity 1->2->3->1 found with ['BNBBTC', 'BNBUSDT', 'BTCUSDT'] price_BNBBTC_bid=0.006952, price_BTCUSDT_bid=35144.17, price_BNBUSDT_ask_1231=245.0 and opportunity 1.0005193693322503
2023-11-05 11:26:47.000643 CHECK!!!! Arbitrage ID: 36e96a33-5991-40a4-bebc-b04daa7eccb6, log: Arbitrage opportunity 1->2->3->1 found with ['BNBBTC', 'BNBUSDT', 'BTCUSDT'] price_BNBBTC_ask=0.006954, price_BNBBTC_bid=0.006952, price_BTCUSDT_ask=35144.18, price_BTCUSDT_bid=35144.17, price_BNBUSDT_ask_1231=245.0, price_BNBUSDT_bid=244.8 and opportunity 1.0005193693322503
2023-11-05 11:26:47.000643 36e96a33-5991-40a4-bebc-b04daa7eccb6: Arbitrage opportunity found _ precise log happened at 2023-11-05 11:26:47.643
2023-11-05 11:26:47.000651 Creating order: {'id': '478114e0-8aab-411f-b020-6029da12cd69', 'symbol': 'BNBBTC', 'side': 'SELL', 'order_type': 'MARKET', 'quantity': 0.042}
2023-11-05 11:26:47.000651 Creating order: {'id': '7f90493d-93ee-4851-bc44-5ff69717be72', 'symbol': 'BTCUSDT', 'side': 'SELL', 'order_type': 'MARKET', 'quantity': 0.00029}
2023-11-05 11:26:47.000651 Creating order: {'id': '4bd4e121-2f3d-4e62-a858-4bee8c6d0c6b', 'symbol': 'BNBUSDT', 'side': 'BUY', 'order_type': 'MARKET', 'quantity': 0.042}
2023-11-05 11:26:47.000653 Received: {"id":"478114e0-8aab-411f-b020-6029da12cd69","status":200,"result":{"symbol":"BNBBTC","orderId":1749586518,"orderListId":-1,"clientOrderId":"7ofUgiVzyeey5LUUsxYj2w","transactTime":1699183607656,"price":"0.00000000","origQty":"0.04200000","executedQty":"0.04200000","cummulativeQuoteQty":"0.00029236","status":"FILLED","timeInForce":"GTC","type":"MARKET","side":"SELL","workingTime":1699183607656,"fills":[{"price":"0.00696100","qty":"0.04200000","commission":"0.00003128","commissionAsset":"BNB","tradeId":228480445}],"selfTradePreventionMode":"EXPIRE_MAKER"},"rateLimits":[{"rateLimitType":"ORDERS","interval":"SECOND","intervalNum":10,"limit":50,"count":1},{"rateLimitType":"ORDERS","interval":"DAY","intervalNum":1,"limit":160000,"count":1},{"rateLimitType":"REQUEST_WEIGHT","interval":"MINUTE","intervalNum":1,"limit":6000,"count":12}]}
2023-11-05 11:26:47.000653 ---------------------------------------------------------------------
2023-11-05 11:26:47.000653 1231_1st: Status: FILLED
2023-11-05 11:26:47.000653 1231_1st: At time: 1699183607656
2023-11-05 11:26:47.000653 1231_1st: Sell Price_bid (BNBBTC): 0.00696100
2023-11-05 11:26:47.000653 1231_1st: Volume of BNB Sold: 0.04200000
2023-11-05 11:26:47.000653 1231_1st: Volume of BTC bought: 0.00029236
2023-11-05 11:26:47.000653 1231_1st: Transaction Fees: 0.00003128 BNB
2023-11-05 11:26:47.000653 ---------------------------------------------------------------------
2023-11-05 11:26:47.000658 Received: {"id":"7f90493d-93ee-4851-bc44-5ff69717be72","status":200,"result":{"symbol":"BTCUSDT","orderId":23098547100,"orderListId":-1,"clientOrderId":"YMogLfAX15iPk5quvX7xaA","transactTime":1699183607656,"price":"0.00000000","origQty":"0.00029000","executedQty":"0.00029000","cummulativeQuoteQty":"10.19180930","status":"FILLED","timeInForce":"GTC","type":"MARKET","side":"SELL","workingTime":1699183607656,"fills":[{"price":"35144.17000000","qty":"0.00029000","commission":"0.00003127","commissionAsset":"BNB","tradeId":3269132127}],"selfTradePreventionMode":"EXPIRE_MAKER"},"rateLimits":[{"rateLimitType":"ORDERS","interval":"SECOND","intervalNum":10,"limit":50,"count":2},{"rateLimitType":"ORDERS","interval":"DAY","intervalNum":1,"limit":160000,"count":2},{"rateLimitType":"REQUEST_WEIGHT","interval":"MINUTE","intervalNum":1,"limit":6000,"count":13}]}
2023-11-05 11:26:47.000658 ---------------------------------------------------------------------
2023-11-05 11:26:47.000658 1231_2nd: Status: FILLED
2023-11-05 11:26:47.000658 1231_2nd: At time: 1699183607656
2023-11-05 11:26:47.000658 1231_2nd: Sell Price_bid (BTCUSDT): 35144.17000000
2023-11-05 11:26:47.000658 1231_2nd: Volume of BTC Sold: 0.00029000
2023-11-05 11:26:47.000658 1231_2nd: Volume of USDT bought: 10.19180930
2023-11-05 11:26:47.000658 1231_2nd: Transaction Fees: 0.00003127 BNB
2023-11-05 11:26:47.000658 ---------------------------------------------------------------------
2023-11-05 11:26:47.000659 Received: {"id":"4bd4e121-2f3d-4e62-a858-4bee8c6d0c6b","status":200,"result":{"symbol":"BNBUSDT","orderId":4865491585,"orderListId":-1,"clientOrderId":"ZJwivZtThr5KIXOQTaSpsT","transactTime":1699183607657,"price":"0.00000000","origQty":"0.04200000","executedQty":"0.04200000","cummulativeQuoteQty":"10.28160000","status":"FILLED","timeInForce":"GTC","type":"MARKET","side":"BUY","workingTime":1699183607657,"fills":[{"price":"244.80000000","qty":"0.04200000","commission":"0.00003150","commissionAsset":"BNB","tradeId":678654770}],"selfTradePreventionMode":"EXPIRE_MAKER"},"rateLimits":[{"rateLimitType":"ORDERS","interval":"SECOND","intervalNum":10,"limit":50,"count":3},{"rateLimitType":"ORDERS","interval":"DAY","intervalNum":1,"limit":160000,"count":3},{"rateLimitType":"REQUEST_WEIGHT","interval":"MINUTE","intervalNum":1,"limit":6000,"count":14}]}
2023-11-05 11:26:47.000659 Time for the socket to open: 8 milliseconds
2023-11-05 11:26:47.000659 Time taken for the trade to execute: 7 milliseconds
2023-11-05 11:26:47.000659 Total time: 15 milliseconds
2023-11-05 11:26:47.000659 ---------------------------------------------------------------------
2023-11-05 11:26:47.000659 1231_3rd: Status: FILLED
2023-11-05 11:26:47.000659 1231_3rd: At time: 1699183607657
2023-11-05 11:26:47.000659 1231_3rd: Buy Price_ask (BNBUSDT): 244.80000000
2023-11-05 11:26:47.000659 1231_3rd: Volume of USDT Sold: 10.28160000
2023-11-05 11:26:47.000659 1231_3rd: Volume of BNB bought: 0.04200000
2023-11-05 11:26:47.000659 1231_3rd: Transaction Fees: 0.00003150 BNB
2023-11-05 11:26:47.000659 ---------------------------------------------------------------------
2023-11-05 11:26:47.000659 Arbitrage taken opportunity 1231 = 0.99841 compared to 1.00052, difference = -0.00211
2023-11-05 11:26:47.000659 
2023-11-05 11:26:47.000660 WebSocket connection closed. Attempting to reconnect.
2023-11-05 11:26:47.000661 Arbitrage ID: e6ccb177-2309-45c6-95bc-50c02b7fcb48, log: Arbitrage opportunity 1->2->3->1 found with ['BNBBTC', 'BNBUSDT', 'BTCUSDT'] price_BNBBTC_bid=0.006952, price_BTCUSDT_bid=35144.17, price_BNBUSDT_ask_1231=245.0 and opportunity 1.0005193693322503
2023-11-05 11:26:47.000661 CHECK!!!! Arbitrage ID: e6ccb177-2309-45c6-95bc-50c02b7fcb48, log: Arbitrage opportunity 1->2->3->1 found with ['BNBBTC', 'BNBUSDT', 'BTCUSDT'] price_BNBBTC_ask=0.006954, price_BNBBTC_bid=0.006952, price_BTCUSDT_ask=35144.18, price_BTCUSDT_bid=35144.17, price_BNBUSDT_ask_1231=245.0, price_BNBUSDT_bid=244.8 and opportunity 1.0005193693322503
2023-11-05 11:26:47.000661 e6ccb177-2309-45c6-95bc-50c02b7fcb48: Arbitrage opportunity found _ precise log happened at 2023-11-05 11:26:47.661
2023-11-05 11:26:47.000666 The number of items in self.latest_prices is 3
2023-11-05 11:26:47.000669 Creating order: {'id': '9efb87e3-617f-4dc1-a9aa-41684bf699d6', 'symbol': 'BNBBTC', 'side': 'SELL', 'order_type': 'MARKET', 'quantity': 0.042}
2023-11-05 11:26:47.000669 Creating order: {'id': 'a9c63f78-135a-490c-8a50-06e968d10f5d', 'symbol': 'BTCUSDT', 'side': 'SELL', 'order_type': 'MARKET', 'quantity': 0.00029}
2023-11-05 11:26:47.000670 Creating order: {'id': 'c7ebdf11-284a-4c35-bb31-80e369afc7c6', 'symbol': 'BNBUSDT', 'side': 'BUY', 'order_type': 'MARKET', 'quantity': 0.042}
2023-11-05 11:26:47.000672 Received: {"id":"9efb87e3-617f-4dc1-a9aa-41684bf699d6","status":200,"result":{"symbol":"BNBBTC","orderId":1749586532,"orderListId":-1,"clientOrderId":"zdZsPuKWMyZrDUdKT7ydiZ","transactTime":1699183607675,"price":"0.00000000","origQty":"0.04200000","executedQty":"0.04200000","cummulativeQuoteQty":"0.00029248","status":"FILLED","timeInForce":"GTC","type":"MARKET","side":"SELL","workingTime":1699183607675,"fills":[{"price":"0.00696400","qty":"0.04200000","commission":"0.00003128","commissionAsset":"BNB","tradeId":228480448}],"selfTradePreventionMode":"EXPIRE_MAKER"},"rateLimits":[{"rateLimitType":"ORDERS","interval":"SECOND","intervalNum":10,"limit":50,"count":1},{"rateLimitType":"ORDERS","interval":"DAY","intervalNum":1,"limit":160000,"count":1},{"rateLimitType":"REQUEST_WEIGHT","interval":"MINUTE","intervalNum":1,"limit":6000,"count":16}]}
2023-11-05 11:26:47.000672 ---------------------------------------------------------------------
2023-11-05 11:26:47.000672 1231_1st: Status: FILLED
2023-11-05 11:26:47.000672 1231_1st: At time: 1699183607675
2023-11-05 11:26:47.000672 1231_1st: Sell Price_bid (BNBBTC): 0.00696400
2023-11-05 11:26:47.000672 1231_1st: Volume of BNB Sold: 0.04200000
2023-11-05 11:26:47.000672 1231_1st: Volume of BTC bought: 0.00029248
2023-11-05 11:26:47.000672 1231_1st: Transaction Fees: 0.00003128 BNB
2023-11-05 11:26:47.000672 ---------------------------------------------------------------------
2023-11-05 11:26:47.000676 Received: {"id":"a9c63f78-135a-490c-8a50-06e968d10f5d","status":200,"result":{"symbol":"BTCUSDT","orderId":23098547104,"orderListId":-1,"clientOrderId":"b9EhLNrXNSI2t5CnBa1lHj","transactTime":1699183607675,"price":"0.00000000","origQty":"0.00029000","executedQty":"0.00029000","cummulativeQuoteQty":"10.19180930","status":"FILLED","timeInForce":"GTC","type":"MARKET","side":"SELL","workingTime":1699183607675,"fills":[{"price":"35144.17000000","qty":"0.00029000","commission":"0.00003127","commissionAsset":"BNB","tradeId":3269132128}],"selfTradePreventionMode":"EXPIRE_MAKER"},"rateLimits":[{"rateLimitType":"ORDERS","interval":"SECOND","intervalNum":10,"limit":50,"count":2},{"rateLimitType":"ORDERS","interval":"DAY","intervalNum":1,"limit":160000,"count":2},{"rateLimitType":"REQUEST_WEIGHT","interval":"MINUTE","intervalNum":1,"limit":6000,"count":17}]}
2023-11-05 11:26:47.000676 ---------------------------------------------------------------------
2023-11-05 11:26:47.000676 1231_2nd: Status: FILLED
2023-11-05 11:26:47.000676 1231_2nd: At time: 1699183607675
2023-11-05 11:26:47.000676 1231_2nd: Sell Price_bid (BTCUSDT): 35144.17000000
2023-11-05 11:26:47.000676 1231_2nd: Volume of BTC Sold: 0.00029000
2023-11-05 11:26:47.000676 1231_2nd: Volume of USDT bought: 10.19180930
2023-11-05 11:26:47.000676 1231_2nd: Transaction Fees: 0.00003127 BNB
2023-11-05 11:26:47.000676 ---------------------------------------------------------------------
2023-11-05 11:26:47.000676 Received: {"id":"c7ebdf11-284a-4c35-bb31-80e369afc7c6","status":200,"result":{"symbol":"BNBUSDT","orderId":4865491705,"orderListId":-1,"clientOrderId":"rJOEK906Ku6p5742KXeI0M","transactTime":1699183607676,"price":"0.00000000","origQty":"0.04200000","executedQty":"0.04200000","cummulativeQuoteQty":"10.28160000","status":"FILLED","timeInForce":"GTC","type":"MARKET","side":"BUY","workingTime":1699183607676,"fills":[{"price":"244.80000000","qty":"0.04200000","commission":"0.00003150","commissionAsset":"BNB","tradeId":678654782}],"selfTradePreventionMode":"EXPIRE_MAKER"},"rateLimits":[{"rateLimitType":"ORDERS","interval":"SECOND","intervalNum":10,"limit":50,"count":3},{"rateLimitType":"ORDERS","interval":"DAY","intervalNum":1,"limit":160000,"count":3},{"rateLimitType":"REQUEST_WEIGHT","interval":"MINUTE","intervalNum":1,"limit":6000,"count":18}]}
2023-11-05 11:26:47.000677 Time for the socket to open: 8 milliseconds
2023-11-05 11:26:47.000677 Time taken for the trade to execute: 8 milliseconds
2023-11-05 11:26:47.000677 Total time: 16 milliseconds
2023-11-05 11:26:47.000677 ---------------------------------------------------------------------
2023-11-05 11:26:47.000677 1231_3rd: Status: FILLED
2023-11-05 11:26:47.000677 1231_3rd: At time: 1699183607676
2023-11-05 11:26:47.000677 1231_3rd: Buy Price_ask (BNBUSDT): 244.80000000
2023-11-05 11:26:47.000677 1231_3rd: Volume of USDT Sold: 10.28160000
2023-11-05 11:26:47.000677 1231_3rd: Volume of BNB bought: 0.04200000
2023-11-05 11:26:47.000677 1231_3rd: Transaction Fees: 0.00003150 BNB
2023-11-05 11:26:47.000677 ---------------------------------------------------------------------
2023-11-05 11:26:47.000677 Arbitrage taken opportunity 1231 = 0.99798 compared to 1.00052, difference = -0.00254
1 Like

I noticed huge delays in response times on the REST api the last ~40h. However only from my usual ISP+IP (yes, running my code from a different location and different ISP instantly made the delay vanish).

As of almost 1h the delay has vanished without me doing anything but letting my scraping continue through the “malfunction”.

Didn’t notice anything unusual on websocket endpoint (mainly kline_1m streams).

what is the stream server and stream name?

I tried with
wss://stream.binance.com:443/stream
wss://stream.binance.com:9443/stream
wss://stream.binance.com/stream
wss://data-stream.binance.vision/stream

Same thing for each one. I’m using mostly “!ticker@arr” and “XXX@aggTrade”, but I guess it’s not linked to the channel used, since same thing was happening on binance site for depth stream.

But it seems to work fine now, I suppose it was on Binance end and it is now resolved

See the same here. But in most cases only on the ‘user’ websocket server. The binance app seems to use something else since I do not see the latency in the app - in most cases only in 3rd party apps.

I have the same behavior on my server located in northern Europe. I can notice huge latencies for the trades channel with a clear pattern for the last few days:


Latency is very high during the day (UTC wise, between 8am and 8pm ish), then it’s returning to normal for the night.
I compute the latency by simply making the diff between the trade’s timestamp and the collection timestamp.
Many trading system highly depend on that so it would be nice if the Binance team could start investigating.
Thanks !

Hi foobar,

that it an awesome report and great description of what is going on. This is exactly the problem I see here on my side (EU as well), but I have not made this deep analysis of the problem.
I hope that Binance will at least let us know if they plan to look into that and fix it or not so that we can spend our time useful.

I can confirm the post from @ntsili - the discrepancy is clearly seen if you open a bookTicker ws and maintain a top-of-book quote for a symbol. Then, use the REST bookTicker endpoint to fetch the current best quote- they’re not just different, they’re vastly dissimilar. I haven’t spent the time writing a check over an extended duration, but I’ve tried to debug my usecase for 8+ hours and the websocket seems to provide quotes at prices which haven’t been seen in the market for 1+ hours. This is a serious data quality/consistency issue which needs to be addressed by the exchange. It would be easier to provide more details about the issue itself if, as @ntsili suggested, there was a timestamp on the streamed updates.

I would like to express my sincere gratitude to blaney83 for validating the concerns I previously raised regarding the inconsistencies in the WebSocket stream data. Your confirmation and additional insights bring significant weight to the issue, emphasizing the urgency and severity of the matter.

The discrepancies between the WebSocket stream quotes and the REST bookTicker endpoint, as highlighted by blaney83, are not just alarming due to their magnitude but also due to the time lag in market prices being reflected. Such discrepancies severely impair the functionality and reliability of high-frequency trading strategies, which are the cornerstone of many of our trading operations.

Given the critical nature of this issue, I earnestly request the Binance Development Team to prioritize its resolution. High-frequency trading, by its very nature, demands the highest level of precision and timeliness in data feeds. The current inconsistencies not only undermine our trading strategies but also erode our confidence in the reliability of the platform’s data streams.

To reiterate, the addition of precise timestamps to each data piece transmitted through the WebSocket would be an invaluable step towards resolving this issue. This enhancement would greatly assist in aligning our trading algorithms with real-time market dynamics, thus enabling us to operate more effectively and confidently.

Understanding the complexities involved in such technical undertakings, we appreciate the efforts of the Binance team in maintaining and improving the platform. However, due to the critical impact of this issue on our trading operations, we kindly urge you to address this as swiftly as possible. Moreover, we request to be kept informed about the progress of this issue’s resolution, as it directly affects our trading decisions and strategies.

We trust in Binance’s commitment to providing a robust and reliable trading platform and look forward to a prompt and effective resolution of this issue.

Thank you for your attention and prompt action on this matter.

1 Like

@ntsili I ended up porting my dataservice entirely to polling after spending the time developing the necessary ws support. I guess they prefer to have a ton of REST traffic which is really unfortunate because the ws API is much cleaner.

Hello, still no update on this one from the binance team ?

Hey,

Exactly the same issue on my end! Thanks for detailed issue.
Can you please advise Binance team?