cowprotocol / services

Off-chain services for CoW Protocol
https://cow.fi/
Other
171 stars 67 forks source link

feat: Report and store all executed orders during bidding #3004

Open fhenneke opened 1 day ago

fhenneke commented 1 day ago

Problem

At the moment, a solver can include orders in a settlement at will if the order is settled at limit price. Those orders need not be reported during bidding.

This is generally a problem for protecting users but will also be problematic with most forms of combinatorial auction or payments with multiple winners. For example, a solver might execute an additional order on a token pair having no tokens in common with the reported trades. A second winner might now execute on that same token pair.

Suggested solution

A first step towards creating more rigorous rules around settling orders out of competition would be to force solvers to report all orders which are executed to the autopilot.

Additional context

There is a general problem with executing orders which can capture surplus at limit price.

The feature of executing jit orders at limit price without reporting the order is only used in obscure cases. For example for CoW AMM JIT orders with missing native prices. The impact of removing the feature should be small.

sunce86 commented 1 day ago

I assume that for these orders we don't have to require existence of native prices for tokens they swap?

fleupold commented 3 hours ago

The reporting is already covered by https://github.com/cowprotocol/services/pull/3001 isn't it? Now we also need to store those (even if they don't up landed)