Open squadgazzz opened 1 month ago
nit: The new quote struct should have the uniform clearing prices instead of out_amount
because the out_amount
can be computed based on the prices. Other than that the plan looks good.
Also clearingPrices
currently contains JITOrder
s in your suggested openapispec
. But I assume this was more for demonstration purposes anyway.
The new quote struct should have the uniform clearing prices instead of out_amount because the out_amount can be computed based on the prices. Other than that the plan looks good.
Ah, right. Updated the example.
Also clearingPrices currently contains JITOrders in your suggested openapispec. But I assume this was more for demonstration purposes anyway.
Thanks, it was a typo, replaced with a Price
object.
Background
From https://github.com/cowprotocol/services/issues/3027:
Details
Previous attempts to implement it(https://github.com/cowprotocol/services/pull/3033 and https://github.com/cowprotocol/services/pull/3038) showed that this is a more involved change than anticipated, which also requires breaking API changes.
Currently, JIT orders get simulated on limit prices which means they will not get any surplus. Any surplus that can be generated by using a CoW AMM would, therefore, go to the user quote. In reality, the user order that comes out of the quote would be settled at a worse price because if it gets settled against a CoW AMM order surplus will have to be shared. So, the solvers should be able to tell us at which price things should get settled so that we can reason about distributing surplus even in quotes.
To fix that we should allow solvers to return pre-interactions, JIT orders and uniform clearing prices with their quote. That way solvers could quote with CoW AMMs (require JIT orders, pre-interactions and UCP). They could also index the orderbook and return resting limit orders as JIT orders.
Tasks
Example
driver
crate and start sending the new quote version. Implement e2e tests.