Open mfw78 opened 5 months ago
I think a crucial component of the market parameters are a trade processing contract that allows for custom settlement logic. Instead of having one contract that processes all trade executions the same way (or knows up front all different ways market parameters are supposed to be handled), we could delegate this aspect to multiple different implementations (extensible later on)
The most basic logic is the one we support today (limit orders):
If any of the steps fails, revert.
For bridging markets for instance, step 3 might be changed for a call to some bridge registry where we want to make sure a claim has been recorded (meaning the user now has a claim on another chain) instead of particular transfer
call.
It's important to note that orders of different markets should all be inter-operable. I'm not sure if the DAO should gate-keep the different trade processing contracts or solely rely on solvers/users deciding for themselves what markets they are willing to take part in (by signing orders/including orders in their solution).
Problem
The current message signing enforces that an intent's delivery / metadata is unnecessarily bound to the type of market in which the intent is placed. In this case, the type of intent is an "ERC-20 to ERC-20" swap intent. This also enforces a single-type marketplace and limits CoW Protocol's diversity / growth opportunities.
Acceptance criteria
Details
The current swap marketplace does not support use cases such as where there is no out token (in the event of bridging), basket trades (e.g. trading m:n tokens), or more exotic markets such as "ERC-20 to ERC-721/ERC-1155" and vice-versa.
Possible Solutions
Intent
, with metadata / hooks / non-market-specific / validity parameters being moved to this type.sellToken
,sellAmount
,buyToken
,buyAmount
,partiallyFillable
, andkind
.Research track