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
[roq-core] MbP needs heuristics to determine tick_size when no reference data exists #114
Comments
Now logging if no reference data when creating MbP. The pattern to look for is |
Another reason for getting bad state is that reference data can be received, but either the tick-size is missing or it's plain wrong. Heuristics has now been added to check for a possible initial tick-size based on the prices observed in the initial snapshot.
|
The new logic was flawed and didn't deal with |
Today it worked with Deribit. Still needs extensive testing before we can say it's good. |
More changes were required due to HitBTC allowing extreme price ranges. Short version:
Example, tick size was detected as 1e-9 and maximum ask price was 1e15, converting to integer would require 1e24 causing overflow because The solution: drop all prices causing overflow (essentially truncating the ask-side of the order book). |
Seems to work now. Will test for a few more days before closing this issue. |
Seeing issues most likely relating to heuristics working differently between gateway and client. A current idea, and possible solution, is to have the gateway publish current price/quantity decimal digits with MbP and use those on the client side for any scaling required. This would remove any uncertainty from the client-side. (This would also remove the constraint to pass |
Seems to work now |
This has recently started happening for Deribit where there are new instruments (options) being published at 8am UTC. It appears market data maybe arrives before reference data.
Without reference data, the prices will be rounded or even truncated thereby potentially causing BadState (bid>=ask).
Workaround
Use
--mbp_allow_price_inversion=true
The text was updated successfully, but these errors were encountered: