-
Notifications
You must be signed in to change notification settings - Fork 97
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
feat: Fix market price checker for market orders #2312
Comments
Before #2304, out of market order would require:
So, if we increase |
Wouldn't the right fix in this case be to compare
? |
|
At least here (see below) we are using the raw orders sell amount, which (at least for market orders) doesn't contain the fee amount: services/crates/autopilot/src/domain/fee/mod.rs Lines 50 to 56 in d4fc3c2
|
# Description #2304 fixed the checker for limit orders. However, for market orders, which signed `sell_amount` doesn't contain the signed `fee_amount` (so it's basically `sell_amount_after_fee`), we need to take this fee into acount. For limit orders nothing changes, since those have `fee_amount` = 0. Fixes #2312
# Description #2304 fixed the checker for limit orders. However, for market orders, which signed `sell_amount` doesn't contain the signed `fee_amount` (so it's basically `sell_amount_after_fee`), we need to take this fee into acount. For limit orders nothing changes, since those have `fee_amount` = 0. Fixes #2312
Problem
As a consequence of #2304, market orders
contain a bug, because their sell_amount doesn't contain the fee. This leads to market orders being classified as liquidity orders. https://github.com/cowprotocol/services/blob/main/crates/shared/src/order_validation.rs#L682
An order being classified as liquidity order might lead to order being less likely to be picked up by solvers? (Haris confirmed that only quasilabs can solve them as part of COW).
Example order: https://dev.explorer.cow.fi/orders/0xa1b886011c8d077187bead0e7d0ba1077f68de6bc0d6423b9ac643ead2153e33dd9eb88c5c6d2a85a08a96c7f0cccce27cb843cb65ae7f5a?tab=overview
The text was updated successfully, but these errors were encountered: