I am using websocket (wss://fstream.binance.com/ws/{symbol}_perpetual@continuousKline_1m) with threading module which in my case i am looking 50 different coins at same time but after some time the number of the coins that my code check’s decreases and i don’t know why i have looked therading module that i use but i could’nt find any problem I am hoping maybe u can help and is this have to do something with limit information that u mentioned about ?
Websocket connection have two straight-forward limits
- Each connection may only subscribe to a maximum of 1024 streams.
- A connection may send up to 5 messages per second to the server.
From the brief description you provided, it does not seem that you are breaking any of these limits, therefore I do suggest testing your solution on a single thread to confirm it is not an issue with the multi-threading nature.
In addition, you may also send a LIST_SUBSCRIBTIONS message to the server to verify that you are still subscribed to the original streams.
May i ask how am i suppose to send a LIST_SUBSCRIBTIONS message? i don’t know how to do
Just a regular message with a json object as it’s content
{“method”: “LIST_SUBSCRIPTIONS”, “id”: 123}
More info in the documentation here
https://binance-docs.github.io/apidocs/spot/en/#live-subscribing-unsubscribing-to-streams
EDIT: Excuse my typo in the previous message, it’s LIST_SUBSCRIPTIONS not LIST_SUBSCRIBTIONS.