cowprotocol / services

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

feat: Add surplus capturing JIT order data to /solve response #2839

Closed sunce86 closed 2 days ago

sunce86 commented 1 month ago

Problem

As stated in https://github.com/cowprotocol/services/pull/2730#issuecomment-2251417186:

Now that cow amm orders are surplus capturing, they are also part of the /solve response, but autopilot doesn't know all necessary data for these orders to build the settlement::Solution and consequently Score AT COMPETITION TIME. The solution would be to expand /solve response with sell_token, sell_amount, but_token, buy_amount, side. With that, score could be calculated.

So, since JIT orders are invisible to autopilot before being settled onchain, if we want to do anything with them at COMPETITION time (verify score, surplus, whatever), we need to add some more data to /solve response.

fleupold commented 6 days ago

Can this be closed?

sunce86 commented 6 days ago

Can this be closed?

We added surplus capturing JIT orders to solve response but we still miss "sell_token, sell_amount, but_token, buy_amount, side" for each surplus capturing JIT order to unblock https://github.com/cowprotocol/services/pull/2730.