You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Mar 9, 2022. It is now read-only.
When using websockets to get the content of the orderbook (orderBookL2_25.Symbol) the content of the orderbook obtained when calling fetch() is out of order. When Bybit sends the orderbook the first time on the websocket it is ordered properly and then on subsequent delta pushes, pybit updates the local version of the orderbook, but does not re-sort it after delta updates. So when we call fetch() to get the orderbook we might assume the orderbook is sorted, but that is not the case and reading only the top rows for buyers/sellers sometime gives inaccurate results. Here is an example of what fetch() returns after a few delta updates.
For example:
Maybe pybit should re-sort the local orderbook in _on_message() after each delta updates, or prior to returning the orderbook to the user in the fetch() method and if not, at least tell the user he needs to re-sort the orderbook himself prior to using it.
The text was updated successfully, but these errors were encountered:
Sign up for freeto subscribe to this conversation on GitHub.
Already have an account?
Sign in.
When using websockets to get the content of the orderbook
(orderBookL2_25.Symbol)
the content of the orderbook obtained when callingfetch()
is out of order. WhenBybit
sends the orderbook the first time on the websocket it is ordered properly and then on subsequent delta pushes,pybit
updates the local version of the orderbook, but does not re-sort it after delta updates. So when we callfetch()
to get the orderbook we might assume the orderbook is sorted, but that is not the case and reading only the top rows for buyers/sellers sometime gives inaccurate results. Here is an example of whatfetch()
returns after a few delta updates.For example:
Maybe
pybit
should re-sort the local orderbook in_on_message()
after each delta updates, or prior to returning the orderbook to the user in thefetch()
method and if not, at least tell the user he needs to re-sort the orderbook himself prior to using it.The text was updated successfully, but these errors were encountered: