Moooove over WETH — native ETH trading is now live on CoW Protocol
You asked, we delivered. You can now trade ETH natively on your favorite, MEV-protected DEX aggregator — CoW Swap
Up until now, users could not trade ETH directly. They always had to wrap first. One of the most-common requests we get at CoW Protocol is to let people trade ETH without forcing them to wrap it first.
Although this might not be a major barrier, protocols often mentioned that they did not want to force their users to do so, as it would be a different UX in comparison to other DEXs or aggregators they have worked with. The reason for the forced wrapping lies on some technical hurdles that we had to overcome to leverage a non ERC20 token with the delegated trading model execution based on signed messages (intents) of CoW Protocol and since CoW Protocol settlement contract is only compatible with ERC20 tokens.
But we love our users very much, so we got the engineers thinking and are pleased to say that, just in time for Christmas, we’re able to give our users what you’ve been asking for.
The CoW ETH Flow Contract is a new way of trading on CoW Protocol specifically designed to trade ETH. The goal of this new trading flow is to avoid forcing the user to convert their ETH into WETH and having them set the approval of WETH while also having to wrap it, thus saving time and costs in the process.
However, with this new CoW ETH Flow Contract, the user experience will be a tiny bit different.
In this new flow, the user won’t send a meta-transaction (as in the ERC20 flow), but instead will send an actual on-chain transaction to the CoW ETH Flow Contract which results in them having to pay for the gas fees. This transaction will include the ETH the user wants to trade and the entire payload with all the details of the order.
From there, the CoW ETH Flow Contract will handle everything for the user, such as the approval, the wrapping, and the order creation. It will also handle the ETH refund for the user in the case that the order expires without being executed. In this case, the transaction cost of the refund will be subsidized by the protocol.
The road to this moment
Not only was the use of Batch Auctions and signed messages for trading a drawback for developing a native ETH sell flow, but also the fact that ERC1271 was not yet fully implemented in the infrastructure was another challenge to solve. With ERC1271 going live, smart contracts can now place orders on CoW Protocol as if they were an EOA, meaning that the order placement is gasless and the order signature from a smart contract can be verified by another smart contract. Once this feature was in place, it was easier to develop the CoW ETH Flow Contract, as in the event of price movements, the protocol could request the user to update the agreed price via a signed message instead of having to do another transaction onchain or face a reverted transaction.
As you know, CoW Protocol leverages a delegated trading model execution which is quite different from the trading model that DEXs and aggregators leverage. On CoW Protocol, users are not crafting a transaction that is sent to the mempool, but rather signing an intent to trade — asking the CoW Protocol solvers to find the best path for their trade and to send the transaction on their behalf. Solvers can bundle multiple intents to trade together and execute them all at once in the same transaction because of CoW Protocol batch auctions trading model.
Because of CoW Protocol’s use of signed messages, and the fact that it only works with ERC20 tokens, it was not possible to natively sell ETH. In order to do so, you had to wrap it first to make the token ERC20 compatible (aka WETH). Unlike CoW Protocol, DEXs and aggregators make the user craft a transaction and have them send it to the mempool, which leaves them exposed to the dangers of the mempool, such as MEV. However, because they make the user craft the transaction and do not work with signed messages to trade, they can hide all the actual wrapping ETH behind the curtains. This way, the user “thinks” they are selling ETH directly, when in reality they are selling WETH in the background.
But after some time, the wait is over, you can now sell native ETH with MEV protection in your favorite Meta-DEX-Aggregator
The solution
Thanks to a new intermediary smart contract, users can now sell ETH natively. The below diagram represents all steps happening when placing a ETH sell order:
Figure 1: ETH Sell Flow diagram for buying DAI
- User goes to CoW Swap, connects their wallet and selects ETH as the sell token. They also select whatever token they want to buy — in this case, DAI.
After the user has executed the transaction, the ETH is sent to the new CoW ETH Flow contract. This contract is the one in charge of all the execution.
**It is important to highlight that the CoW ETH Flow contract has undergone a successful audit. You can find all the information relevant to the audit here. - The CoW ETH Flow Contract then creates a ERC1271 smart contract order with the parameters the user specified in the CoW Swap UI.
The order is registered in CoW Protocol’s batch auction so that the solvers can take it into consideration for settlement. - If the order can be settled by the solvers, then the following actions happen atomically:
(1) The settlement contract receives the batch auction settlement from the winning solver, which triggers the execution of the pre-interactions from the CoW ETH Flow Contract.
(2) The first trigger from the CoW ETH Flow Contract is the wrapping of the ETH it was holding from the user into WETH.
(3) Then, the CoW ETH Flow Contract sends the WETH to the settlement contract to actually execute the trade on-chain. - Once the settlement contract has executed the settlement, the user receives their buy token.
The reason that a smart contract needs to be involved in this process is because you cannot sign an intent to trade with ETH. Since you cannot sign an intent to trade, CoW Protocol developed a custom smart contract that auto-converts your ETH into WETH and later places an ERC1271 order (intent) on your behalf.
The wrapping process is a little cumbersome as it requires some extra clicks before execution, but with the new native ETH flow, users can decide to do the wrapping themselves, or let the protocol do it for them.
Conclusion
To sum up, users can now sell ETH natively on CoW Swap! No need to wrap it anymore!
They are able to do so, because of a new intermediary contract, called the CoW ETH Flow contract, that receives the users ETH, and leverages ERC1271 orders to handle everything from wrapping to order placement on behalf of the user.
This development makes CoW Swap the best place to sell ETH, while also making CoW Protocol the most appealing protocol to integrate with…
There are no excuses anymoooore!
Try out the new flow today, and reach out if you are interested in buidling the future of finance alongside CoW Protocol.
About CoW DAO
CoW DAO is an open organization of developers, traders, market makers, and other community members focused on building, maintaining, and advancing fair and decentralized trading systems — principally through its work on CoW Protocol.
CoW Protocol is a DEX aggregation protocol that powers a network of independent solvers which, in turn, enable trustless and efficient peer-to-peer trading. Leveraging batch auctions uniquely positions CoW Protocol as native trading infrastructure for discrete-time settlement layers like Ethereum and enables fair and accessible trading to its users.
🌐 Website | 🐦 Twitter | 📒 Documentation | 💬 Discord | 📊 Analytics | 📸 Snapshot