I'm encountering an issue with the Bitget WebSocket API when trying to fetch real-time data on various cryptocurrencies. The API is supposed to push data every 500 ms. On my end, I process these data and, at the end of each candlestick (every 3 minutes), I acknowledge their receipt by printing a message and updating the timestamp of the last candle for each cryptocurrency.
The problem I'm facing seems independent of the number of assets I'm monitoring. The last 2-3 assets in my list always take an additional 2 to 10 seconds to update, whereas the first ones update in less than a second (here are the logs). This delay doesn't seem to be associated with any specific assets because the delayed assets vary with each 3-minute interval.
Here are some additional observations:
- If I monitor a list of 20 assets, the first 15 update in less than a second, while the last ones take longer.
- If I reduce my list to 15 assets, the first 10-11 update quickly, and the last ones still experience delays.
- This behavior persists regardless of the programming language or library used, as I have the same issue using Node.js with the ws library and Python with websocket.
- I've tried executing the requests in parallel, but it didn't solve the issue.
I'm looking for suggestions or potential solutions to address this unexpected delay in data updates.
I expected that regardless of the list size of the assets I'm tracking, each asset would be updated within 1-2 seconds maximum, similar to the update times observed for the first few assets in every instance.