CowSwap: The Future Form of Intent DEX?

DODO Research
2023-09-19 15:32:42
Collection
From the background of its birth, to mechanism interpretation, data performance, and the differences of 9 products compared to UniswapX and 1inch fusion, let’s explore what CoWSwap is and how it works, and address the "plagiarism" controversy with the spirit of "carving up the ox."

Produced by: DODO Research

Edited by: Lisa

Author: xiaoyu

Dan, with all respect. The game was changed long ago by @1inch when they first did high-quality aggregation and @CoWSwap when they pioneered the solver model. It's good stuff, but you are not really the first or the second. ------ @Curve Finance

UniswapX's launch was sensational and controversial. The sharpest accusation questions whether UniswapX copied CoWSwap and 1inch. Curve's official Twitter stated: "The game rules were changed long ago by 1inch's high-quality aggregation and CoWSwap, the pioneer of the solver model. UniswapX is good, but it is really neither the first nor the second."

CoWSwap's image directly points to its status as a pioneer in Intent Based Trading. So, what exactly is CoWSwap? How does it differ from UniswapX? Why does the market accuse UniswapX of "copying" CoWSwap instead of 1inch fusion, despite both following the aggregator's solver model route?

We will explore what CoWSwap is, how it works, and address the "copying" controversy, from its background to mechanism interpretation, data performance, and the nine product differences with UniswapX and 1inch fusion, in the spirit of "carving the ox."

The "Thief" of DeFi Users: MEV Attacks

DeFi users have always been victims of MEV attacks, such as front-running, back-running, and sandwich attacks. The CoWSwap protocol provides MEV protection, aiming to reduce users' MEV losses. Before we dive deeper, let's briefly understand what MEV attacks are.

Imagine this scenario: you wait, and finally, you get the ideal trading opportunity! You open Uniswap, and as the Pending ends, you find that the tokens received in your wallet are much less than expected. You check the block explorer and see that someone raised the price before you bought and quickly sold after your purchase, taking the price difference from you. Yes, you have suffered an MEV attack. MEV attacks occur due to the "asynchronous" nature of submitting transactions to the blockchain. When a user submits a transaction on Ethereum, it is not immediately added to the next block. Instead, it first enters the "mempool," which is a collection of all pending transactions. Then, validators extract transactions from the mempool and add them to the next block as they build it. Since the mempool is public, searchers have the opportunity to pay validators to order transactions in a specific way, extracting value from users through sorting. Image source: CoWSwap Docs

The Guide in the Dark Forest: CoWSwap's MEV Protection

Better than the best price. ------ CoWSwap

The name CoWSwap seems to relate to "cow," but here CoW stands for "Coincidence of Wants," referring to a special way of matching trades. Specifically, "coincidence of wants" is an economic phenomenon where "two people simultaneously hold what the other needs, allowing them to trade directly without the need for currency as a medium."

In the CoWSwap protocol, users do not need to send a transaction to submit a trade; instead, they need to send a signed order (or trading intent). This order specifies the maximum and minimum output they are willing to receive in the trade within a specific time frame. Users do not care and do not need to care about how it is executed. Then, the off-chain signed orders are handed over to solvers, who compete to find the best execution path when the order becomes effective. The leading solver will gain the right to execute the batch. This also means that the gas required to execute the order is borne by the solver, and users do not have to pay gas in case of transaction failure (for example, if a path satisfying the promised price is not found before the deadline).

CoWSwap's MEV protection can be summarized in the following three points:

1. Batch Auctions

"Coincidence of Wants" occurs when two (or more) traders exchange cryptocurrencies without needing on-chain liquidity. The occurrence of CoW allows orders to be bundled together in a batch, improving efficiency. This is reflected in saving on-chain costs such as LP fees and gas fees, while the off-chain P2P method can also avoid slippage and potential MEV attacks on-chain.

Leupold, the technical lead of CoWSwap, stated: Due to the "Cambrian explosion" of various tokens in the DeFi space, market liquidity is highly fragmented. To create liquidity between various token pairs, market makers need to "intervene and provide liquidity." If a coincidence of wants can be found in each block, it can reaggregate the fragmented liquidity space. 2. Off-chain Solving

Since a third party handles transaction orders on behalf of users, the visibility of the mempool is hidden, and all MEV risks are borne by the third party. If the third party finds a better execution path, the order will be completed at a better price; otherwise, it will be completed at the worst price as signed. All risks and complexities of managing transactions are handled by professional solvers.

Users only need to express their "trading intent" without worrying about the execution process. For inexperienced users who do not know how to "boost" their priority in the public mempool, they are protected by CoWSwap's mechanism. There is no need to worry about being in the "dark forest." 3. Unified Clearing Price

If two people trade the same asset in the same batch, the protocol mandates that each batch of tokens has only one price. Both transactions will be cleared at the "exact same price," with no first-come-first-served concept. Even if a block has multiple transactions for the same token pair, each transaction will receive a different price, depending on the order of transactions with the pool. However, the CoWSwap protocol requires a unified clearing price, making reordering meaningless. According to Leupold, this approach eliminates "various MEVs." CoWSwap's mechanism is quite novel, and before the concept of Intent was proposed, it already roughly aligned with the requirements for DEX under the Intent concept, receiving high praise from various research reports. However, it is clear that CoWSwap is not a celebrity; when it comes to aggregators, more people think of 1inch and others. What is the reason?

We summarize the shortcomings of CoWSwap, specifically in the following three points:

1. Not suitable for inactive tokens

In theory, this mechanism can present better prices to users, but it may also lead to user losses. For actively traded tokens, orders are likely to find "coincidence of wants" to optimize prices in the batch. For inactive tokens (assuming ETH here), the solver may execute at the maximum slippage, even exceeding the slippage that would occur in a single liquidity source. 2. Additional protocol fees

For small trades with ample liquidity, CoW's protocol revenue may cause losses to users. 3. Does not support all tokens

CoWSwap does not support the exchange of all tokens, only supporting tokens that comply with the ERC-20 standard. Moreover, some tokens, although they implement the typical ERC20 interface, may result in the actual amount received being less than the specified sending amount when calling transfer and transferFrom methods. This can lead to issues with CoWSwap's settlement logic, such as $Unibot not being supported for trading on CoWSwap.

Seeing the Essence Through Data: A Close Look at CoWSwap's Market Performance

Ideals are always abundant, but reality is stark. Only through data can we explore CoWSwap's market performance. Combining CoWSwap's advantages, we will examine its market performance from the perspectives of MEV resistance, trading volume, and market share.

1. MEV Resistance Performance

Compared to sandwich attacks occurring on Uniswap and Curve, the number of trades routed through CoWSwap that were attacked has significantly decreased; compared to 1inch and matcha, CoWSwap had the least number of sandwich attacks and the lowest trading volume ratio in 2022. From the research report of the on-chain MEV analysis team @EigenPhi. 2. Trading Volume and Market Share

Horizontal comparison of the aggregator track. CoWSwap ranks fourth in trading volume, ninth in user count, and fifth in average trade size. Among them, 1inch ranks first. https://dune.com/murathan/uniswap-protocol-and-aggregators Horizontal comparison of aggregator market share. 1inch dominates with a market share of about 70% based on a large user base, followed by CoWSwap with about 10% market share, and then 0xAPI, Match, and Paraswap. CoWSwap's market share shows a growing trend. https://dune.com/murathan/uniswap-protocol-and-aggregators CoWSwap's monthly trading volume performance fluctuates significantly, reaching a total trading volume of $27.4B as of September 1. https://dune.com/cowprotocol/cowswap *3. DAO Choices*

1/3 of DAO trading volume occurs on CoWSwap. Because DAOs often require large, MEV-resistant trades, platforms that can meet the special order needs of DAOs, such as limit orders and TWAP, are essential (e.g., Milkman was used by AAVEDAO on July 10 to monitor the slippage of converting 326.88 wETH and $1,397,184 of $BAL into B-80BAL-20WETH). This proportion is still growing; in August, CoWSwap even accounted for more than half (54%). https://dune.com/queries/2338370/3828396 4. Balancer Provides Incentives

On March 24, Balancer released the [BIP-295] proposal to provide ~50-75% fee discounts for CoWSwap's solvers. CoW routing ranks third in Balancer's trading volume, only behind Uniswap and Curve. https://dune.com/sixdegree/dex-aggregators-comparision

The "Copying" Controversy

"CoW Swap is the first DEX Aggregator offering some protection against MEV" ------ CoWSwap About CoWSwap's predecessor, Gnosis Protocol V1, was launched in 2020. It was the first DEX to provide circular trading through batch auctions. UniswapX and 1inch fusion adopted the same architecture as CoWSwap: signed orders ------ outsourcing trade creation to third parties ------ (incentivizing third parties to return MEV to users). When UniswapX was launched, accusations of copying CoWSwap were rampant. 1inch was even humorously referred to as a modified version of CoWSwap.

Today, let's discuss the differences among the three, summarized in nine aspects. 1. Names of Third Parties

  • UniswapX: filler

  • CoWSwap: solver

  • 1inch fusion: resolver

The responsibilities are the same: to provide solutions for user-signed orders, packed into a single transaction for inclusion in the block.

2. Execution Process

  • UniswapX: The winning filler has execution priority for a certain period, followed by a Dutch auction.

  • CoWSwap: All solver solutions are submitted to the Driver for ranking; once bidding ends, all solutions are submitted and ranked, and the ranking information is announced to notify the top-ranked solver to execute.

  • 1inch fusion: The number of resolvers increases over time, while prices decay.

Initially, 1inch fusion had only one resolver in the first minute, and the criticism was that "the resolver waits for the price to drop before executing," leading to extended user wait times. Note: The proposal has now passed, increasing the number of resolvers to 10. 3. Batch Formation

"Leopold contends that CoW Swap's design still offers better pricing because it batches trades rather than processes them individually like UniswapX. Batching many different trade requests together provides better MEV resistance, he said." ------ CowSwap CTO

  • CoWSwap: Batches all on-chain unfulfilled orders into a single batch for a Dutch auction, allowing for order matching via CoW.

  • UniswapX: Fillers pick one or more orders for processing via API.

Given the complexity of orders, CoWSwap needs to batch all unfulfilled orders into a single batch, and whether an optimal solution can be found within a block time is uncertain, and there may not even be an optimal solution.

4. Degree of Order Parameterization

  • UniswapX: Users have more freedom (which may also bring more complexity) to define parameters, including auction decay functions, initial Dutch order prices, etc.

  • CoWSwap and 1inch fusion: Users only need to provide the tokens to be exchanged and slippage. CoWSwap can also set the duration of the order.

5. Different Sources of Liquidity for Third Parties

  • UniswapX: Allows any filler to access liquidity sources, including private liquidity.

  • CoWSwap: CoW and external liquidity sources.

  • 1inch fusion: Typically large market makers.

CoWSwap focuses more on finding counterparties at the same moment, while 1inch market makers acting as resolvers can choose to execute directly. UniswapX also allows professional market makers to intervene, potentially addressing the criticism of 1inch's "resolver waiting for the price to drop before executing," thus capturing market share from 1inch. 6. Degree of Decentralization

  • UniswapX: Absolutely permissionless; anyone can access unfulfilled orders via API and send them to the Reactor to compete with other fillers' solutions (unless the user specifies a filler).

  • CoWSwap: Must either be whitelisted by creating a $1M USDC/COW pool or be whitelisted by Cow DAO based on DAO standards.

  • 1inch fusion: Selects the top ten addresses as resolvers based on the amount of $1INCH tokens staked, weighted by staking duration. Registration, KYC processes, and maintaining sufficient balance to pay order fees are required.

Note: CoWSwap is currently in phase 1 of the Cow project authorization; phase 2 requires staking tokens and DAO voting approval; phase 3 allows anyone to become a solver.

7. Different Quotation Sources

  • UniswapX: Allows fillers to quote (RFQ), meaning fillers can initialize the initial price of the Dutch auction.

  • CoWSwap, 1inch fusion: API quotations.

8. UniswapX Uses RFQ and Considers Using a Reputation System

  • UniswapX: Allows orders to specify a filler to execute the order for a certain period (followed by a Dutch auction), incentivizing fillers to quote to the RFQ system. To limit fillers' abuse of this exclusive right, a corresponding reputation or penalty system may be introduced.

  • CoWSwap: Rewards the solver with the highest order completion rate from the previous week once a week.

9. UniswapX Launches Cross-chain Aggregation Function (Not Yet Implemented)

  • UniswapX: Can be extended to support cross-chain trading, merging exchanges and cross-chain into a single action, allowing assets held on the original chain to be exchanged for assets needed on the target chain without direct interaction with the bridge.

  • CoWSwap, 1inch fusion: Still under discussion.

In Conclusion

Overall, CoWSwap is an intriguing project. Outsourcing orders to third-party solvers aligns with the "philosophy" of L2 scaling: executing off-chain while final settlement and verification occur on-chain. CoWSwap cleverly transforms trading into a vast barter economy, addressing the fragmentation of liquidity and utilizing on-chain liquidity for parts that peer-to-peer trading cannot satisfy.

One of the requirements for implementing Intent is that anyone can act as a solver, thereby enhancing efficiency through competition. CoWSwap's architecture undoubtedly resonates with this. By having professional solvers manage all risks and complexities of transactions, users are protected by CoWSwap's mechanism and do not need to worry about "walking" in the dark forest. This aligns with the philosophy of DODO V3, where liquidity providers' funds are managed by professional market-making teams, eliminating the need for them to consider strategies personally.

CoWSwap has achieved good results in addressing the MEV issue, and under the narrative of Intent, its market share is also on the rise. However, it also faces resistance to large-scale applications due to protocol fees and lack of support for all tokens. As a pioneer of the solver model, UniswapX and 1inch fusion's mechanisms seem more like innovations built on its foundation, with 1inch sequentially releasing resolvers to connect with professional market makers; Uniswap's RFQ system allows users to specify fillers first rather than proposing solutions simultaneously. We look forward to CoWSwap's framework driving more innovations in the decentralized trading aggregator space and anticipate its significant and outstanding development.

ChainCatcher reminds readers to view blockchain rationally, enhance risk awareness, and be cautious of various virtual token issuances and speculations. All content on this site is solely market information or related party opinions, and does not constitute any form of investment advice. If you find sensitive information in the content, please click "Report", and we will handle it promptly.
ChainCatcher Building the Web3 world with innovators