Description
@Marfusios
Hi
Please take a look at this issue, let a program that is reading your position size, wallet info and market price run for more than few hours (most likely between 12 to 15 hours), during these times, randomly close a position by API and open a new one or send some orders to change the size, you will see that after some hours, the websocket stops fetching the correct values.
How did i find about this?
I'm developing a bot and found that after around 12 hours, my bot is sending long signals for at least 3 times, knowing my own code, i would new that if there was any short positions, it would have been closed by the very first long signal.
But,... the info section of the bot, that is using websocket, was showing that i had a short position with even wrong number !
investigating it farther, it looks like even the bitmex's own python version of websocket is having this type of issue and looks like only nodejs version is the one without ANY issue.
thinking about it, i think i came up with a dirty solution, every 30 minute or so, disconnect from websocket, reconnect and re register everything user asked for (authenticated and non authenticated) but do it under the hood so that no log or any sort of error rise up and being cached by the user side.
By doing this dirty trick, until bitmex move their sorry assess to solve many issues they have on their servers,... we should be able to refresh the websocket connections every 30 minutes. As much as i understand it, it looks like the connection keeps working for hours but then drops the validity of it from server side some how. although the ping works always, but the info from the authenticated section of websocket to be precise,... won't update any more.
And this happens without any disconnection/reconnection log info being captured. Right now, the solution i have? is to close the bot and reopen it and everything works for hours until it gets ugly again !