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

bug: SolvableOrders is filtering out orders by balance but not prioritising newer orders #1997

Closed
fleupold opened this issue Oct 20, 2023 · 1 comment · Fixed by #2397
Closed
Labels
bug Something isn't working

Comments

@fleupold
Copy link
Contributor

Problem

If a user places an order that doesn't get matched and then places a new order on top (without cancelling the old one), the second one may not make it into the auction because they may not have enough balance.

We used to evaluate the balance for orders sorted by order creation time (desc) to make sure we prioritise newer orders over older ones. I cannot find this logic anymore (in fact we filter out insufficient balance orders unsorted here)

Impact

Users may not get their replacement orders (or more recent limit orders) matched.

To reproduce

Place a small order with minimum slippage and a small amount (likely resulting in a negative objective value), which won't get matched. Then place another order with large slippage and see it also doesn't get matched until you cancel the first one. You'll also not see the order in the auction that the autopilot creates.

Expected behaviour

Second order is matched even without cancelling the first one.

Screenshots/logs

  1. https://explorer.cow.fi/orders/0xe4ccfcb66df87901f7fa8ec1f54aba94df7f9ac836c4672e66df2eed0fb6b9b7c3792470cee7e0d42c2be8e9552bd651766c517865317b74 (eventually cancelled)
  2. https://explorer.cow.fi/orders/0xba7f9ef98bc8742538f9310bb5662da2c16804bb1937d190c95930252cfd6347c3792470cee7e0d42c2be8e9552bd651766c517865317bf3 (not matched until ☝️ was cancelled)
@fleupold fleupold added the bug Something isn't working label Oct 20, 2023
Copy link

github-actions bot commented Feb 9, 2024

This issue has been marked as stale because it has been inactive a while. Please update this issue or it will be automatically closed.

@github-actions github-actions bot added the stale label Feb 9, 2024
MartinquaXD added a commit that referenced this issue Feb 12, 2024
# Description
When we build the auction in the autopilot we filter out orders that are
unlikely to be filled to shrink the auction to a more manageable size.
One step is to filter out fill-or-kill orders where the owner doesn't
have enough sell_token for all of the open orders. The new logic sorts
orders by `creation_timestamp` (desc) to first use the user's existing
balance on recent orders rather than old ones.

Fixes: #1997
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant