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
The driver has built-in logic to prioritize and pre-filter some of the orders. For example if a user has 3 open orders for the same sell tokens but only funds for 2 we discard the worst priced order (according to native prices).
This is further complicated with partially fillable orders. If for example the third order was partially fillable the driver would tell the solver that only a portion of the order would be fillable with the user's funds instead of dropping it completely.
Also if an order has a pre-interaction it makes sense to compute the available balance after executing the pre-interaction (in case the pre-interaction unlocks more funds).
Impact
All of this logic is relatively complex and currently overly conservative. For example if the same user has multiple orders open for the same sell token but with different pre-interactions the driver can't really be sure how much funds would actually be available for each order.
This can lead to cases where an order with a pre-interaction would unlock a lot of funds gets filled a tiny amount based on the users balance without taking the pre-interaction into account.
This very conservative logic was implemented to avoid solvers trying to solve multiple orders and then running into reverts because not enough funds for both orders are available. However, this is a pretty rare thing and most solvers are single order solvers which later merge together solutions anyway. In this scenario it would be preferable to very rarely run the risk of wasting some time on solving incompatible orders than filling orders with pre-interactions suboptimally.
To reproduce
Create 2 orders (same user, same sell_token):
limit order without any pre-interactions
market order with pre-interaction that unlocks more sell_tokens (sell_token.balanceOf(user) needs to be way smaller than the order's total amount)
Expected behaviour
The system should be able to settle the second order completely given that the pre-interaction unlocks all the necessary funds.
The text was updated successfully, but these errors were encountered:
Problem
The driver has built-in logic to prioritize and pre-filter some of the orders. For example if a user has 3 open orders for the same sell tokens but only funds for 2 we discard the worst priced order (according to native prices).
This is further complicated with partially fillable orders. If for example the third order was partially fillable the driver would tell the solver that only a portion of the order would be fillable with the user's funds instead of dropping it completely.
Also if an order has a pre-interaction it makes sense to compute the available balance after executing the pre-interaction (in case the pre-interaction unlocks more funds).
Impact
All of this logic is relatively complex and currently overly conservative. For example if the same user has multiple orders open for the same sell token but with different pre-interactions the driver can't really be sure how much funds would actually be available for each order.
This can lead to cases where an order with a pre-interaction would unlock a lot of funds gets filled a tiny amount based on the users balance without taking the pre-interaction into account.
This very conservative logic was implemented to avoid solvers trying to solve multiple orders and then running into reverts because not enough funds for both orders are available. However, this is a pretty rare thing and most solvers are single order solvers which later merge together solutions anyway. In this scenario it would be preferable to very rarely run the risk of wasting some time on solving incompatible orders than filling orders with pre-interactions suboptimally.
To reproduce
Create 2 orders (same user, same sell_token):
sell_token.balanceOf(user)
needs to be way smaller than the order's total amount)Expected behaviour
The system should be able to settle the second order completely given that the pre-interaction unlocks all the necessary funds.
The text was updated successfully, but these errors were encountered: