Skip to content
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

Heuristically filter orders for batch cutting #740

Closed
Tracked by #643
sistemd opened this issue Nov 8, 2022 · 6 comments · Fixed by #752
Closed
Tracked by #643

Heuristically filter orders for batch cutting #740

sistemd opened this issue Nov 8, 2022 · 6 comments · Fixed by #752
Assignees

Comments

@sistemd
Copy link
Contributor

sistemd commented Nov 8, 2022

During batch cutting, only include orders which are a certain % away (configurable) from the estimated native price.

@sistemd sistemd mentioned this issue Nov 8, 2022
20 tasks
@sistemd sistemd changed the title Heuristically filter orders for solving. Specifically, single order solvers (like 1Inch and 0x solvers) would have issues in trying to solve large batches with 1000s of out of price orders and a small amount of market orders. We need to prioritize market orders and limit orders that are in price. Tentatively, we can use the external price vector for this. Heuristically filter orders for solving Nov 8, 2022
@sistemd sistemd self-assigned this Nov 8, 2022
@MartinquaXD
Copy link
Contributor

During batch cutting, only include orders which are a certain % away (configurable) from the estimated native price.

Eventually we also have to think about prioritizing for which limit order we want to update the surplus_fee in case we run into rate limits of the quoting mechanism.
I think the same heuristic can be applied there which would make filtering orders at the time of auction cutting redundant.

@nlordell
Copy link
Contributor

nlordell commented Nov 8, 2022

Just to clarify, is this issue about solving (i.e. ordering of orders we chose to look at in our SingleOrderSolver implementation in the solver) or batch cutting (i.e. ordering of orders to look at when preparing the auction in the autopilot)?

@sistemd
Copy link
Contributor Author

sistemd commented Nov 8, 2022

Just to clarify, is this issue about solving (i.e. ordering of orders we chose to look at in our SingleOrderSolver implementation in the solver) or batch cutting (i.e. ordering of orders to look at when preparing the auction in the autopilot)?

It's about batch cutting.

@nlordell nlordell changed the title Heuristically filter orders for solving Heuristically filter orders for batch cutting Nov 8, 2022
@harisang
Copy link
Contributor

I am not sure I agree with this, although I definitely see where it's coming from.

To me, this will look like order censorship; having a valid order in the orderbook that no solver potentially ever sees.

@sistemd
Copy link
Contributor Author

sistemd commented Nov 10, 2022

I am not sure I agree with this, although I definitely see where it's coming from.

To me, this will look like order censorship; having a valid order in the orderbook that no solver potentially ever sees.

Solvers won't see orders only if their prices are far outside the market range. We can't spam solvers with all limit orders, that's not going to work. But it's definitely not censorship.

Censorship would be if we omit limit orders even if they are within the market price, which we don't do.

@nlordell
Copy link
Contributor

I am not sure I agree with this

While, I must admit I'm not super happy with filtering out limit orders, one of the major risks from this feature is the additional load on the services and not being able to keep up with auction creation. This changes is more about providing us with safety handles and to reduce that risk.

Another proposal by @MartinquaXD was to take N most favourably priced orders (#765). Maybe we can iterate on how we do this filtering and improve our algorithm and heuristics over time, but having an "easy way out" of having an orderbook that is just too large is an important backup IMO.

having a valid order in the orderbook that no solver potentially ever sees

I agree, but I think the alternative is worse (in having an order that a solver doesn't see because we can't compute fees fast enough).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants