-
-
Notifications
You must be signed in to change notification settings - Fork 7.4k
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
FTX close WebSocket connection with status code 1006 (CCXT Pro) #14557
Comments
Hello @Kinzowa We're following the specs described in their docs (https://docs.ftx.com/#websocket-api) regarding ping-pong messages, so every 15 seconds we send a ping JSON message with this format: You can always tweak this interval by doing this: exchange.streaming['keepAlive'] = 10000 # changing it from 15s to 10s |
Hi Carlos, thanks for your answer I will try this. |
Hi Carlos, I did several test with the FTX client in order to solve the 1006 disconnections, but without success. I modified the I notice that the |
Could you support please or point me to the right direction @carlosmiei ? Actually I can't use the Pro version of the library with FTX. I contacted their support and they replied to see with CCXT teams. Thanks |
@Kinzowa you can't use it at all, or fails intermittently? |
Hi Carlos, it fails intermittently several times a day. That's a real issue because if I detect the disconnection and restart the worker, I will miss trade events and order events at some point and it will create inconsistencies in the database. Restarting the worker take 10 seconds for one account, but if there are tens of accounts it will take even more. That's the reason why I would like to investigate this issue a bit more. Could you please check under what conditions CCXT Pro initiates this failure ? |
@Kinzowa How many streams are you listening? Using a few of them, I don't have any issues |
I use 4 streams in total with FTX. 2 of them are public and 2 are private (same account). Wondering if it could be related to the infrastructure. My hosting sevice is not AWS. Please find below the code that I use to initialize the exchange instance and open the streams. It's very common coroutines structure.
This the PARAMS variable
|
Hi @carlosmiei I did the test with another server located in Germany (instead of Poland, but the provider is the same) and it also fails with
As you can see, a few minutes later the remaining
Here you can see the 4 streams that were initiated.
|
I just saw that methods
|
Hello,
I received abnormal disconnection events from FTX while using CCXT Pro, error code
1006
followed by error1001
. Please find below the traceback. It seems like a very similar issue than #14086 which I encountered recently when using Binance. The workaround that still work today was to pingapi.binance.com
evey 5 seconds, but unfortunnatly the same hack does not have effect with FTX. I tried to perform periodic REST API calls but unfortunnatly the1006
error still happens.Could you elaborate on how the ping pong mechanism is implemented in CCTX Pro and what is the value of the timer ? Maybe a reduction of this timer would improve the stability of the connection.
Thank you,
The text was updated successfully, but these errors were encountered: