Closed LKresta closed 1 year ago
It's a problem. I'll check if some additional information can be provided to correlate position with order notification, and, how position notification can distinguish from each other if multiple notifications are with the same time_ms
Thanks. Are there at least some guarantees at the moment, as mentioned in https://github.com/gateio/gatews/issues/43? Like relative order of notifications, and their timestamps?
From what I know, there is no absolute guarantees if there are multiple order&position notifications in 1ms for now. But I'll go for a second check.
I see. Thanks for clarification & please let me know if you find anything usable.
Confirmed the timestamp cannot be guaranteed to be exactly the same for positions, orders and trades. However, the update timestamp for each follows the sequence: position, user_trades, then order, which means if a trade happens, position will be updated, then user_trades, and lastly the order.
Great, thanks - that's something I can work with :)
Cheers, L.
Thanks; I'm observing slightly altered sequence though (on TestNet) - following a trade the first notification to arrive is for futures.usertrades
, then futures.positions
, then futures.orders
(and then futures.balances
). So more like user trades, position, and lastly the order...?
Um, the information might be misleading. I think it might not help you. The update time occurred in the engine follows the sequence but not the time websocket pushed to client. For the latter, there is no sequence guarantee. 😢
Ah, I see. Thanks for clarification!
Hello there,
Is there any reliable way to determine whether position notification from
futures.positions
WS channel represents state newer than information returned from REST API (/futures/{settle}/positions)? From what I saw the timestamp (in ms) is not enough - there can be multiple WS notifications sent with the sametime_ms
.Thanks, L.