-
-
Notifications
You must be signed in to change notification settings - Fork 49
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
SymbolOrderBook connection unstable when subscribing to many Symbols #134
Comments
I found an issue with the checksum calculation. When calculating our local checksum a small decimal like 0.0000012 is written as 1.2E-06, which makes the checksum string invalid. I'm looking into a solution for this, decimal handling in Json.Net and json in general is a bit of a pain |
If I follow you, the checksum issue makes that it thinks the order book is unsynced, and forces to resync. That would explain the lack of stability, but not why it can't resync. Or is it then on the broker's side that the high amount of request bans my ip? |
@JKorf I understand that the values used in the checksum comes from the OrderBookEntryConverter class. When you Else, maybe using something like |
Hi, I've done a fair amount of testing and released a new version with various fixes for the checksum validation, and also improved stability/speed on the socket connections. Can you have another go with the latest version? |
I updated and run, the result is great. I'll test more in depth later but running it shows as expected results. 96 out of 100 are connected and synced, remaining 4 stay disconnected. But that's not an issue, I'll have to check them specifically (as it's always the same that remain disconnected), it can be due to many things. Also I see great improvement in the time it takes to go from disconnected --> connecting --> synced. It used to take a while for 100 symbol before, now it's a matter of seconds. |
Describe the bug
OrderBookStatus.Reconnecting
<>OrderBookStatus.Synced
). On the other hand some Symbol are synced and stableMoreover, when trying to connect, the Symbols goes from "Disconnected" to "Connecting" one after another, and hangs at "Connecting" until they are all under this state (which takes a while for 100)
To Reproduce
Client : Client = new BitfinexClient(new BitfinexClientOptions() { LogLevel = LogLevel.Debug, ApiCredentials = new ApiCredentials("key", "secret") });
Socket : SocketClient = new BitfinexSocketClient();
OrderBookOptions : Options = new BitfinexOrderBookOptions(SocketClient);
OrderBook
I monitor the behavior by bindgin a custom class to a ListBox having 3 properties bound: Name (name of the Symbol) Status (connection status) and Count (number of time OnOrderBookUpdate was triggered).
See the attached Project for the complete implementation
ProjectTester.zip
Expected behavior
Lack of stability may not come from your code but from the API, though it should be checked
Socket should be able to resync
If using the default SocketClient is not recommended, defaulting it should not be possible
Debug logging
The log (Trace) with 100 symbols and a single SocketClient shared is attached as .txt.
Some stats on the log:
Out of 814 log lines :
No apparent errors
logs.txt
The text was updated successfully, but these errors were encountered: