Is CowSwap, an intent-based swap, the next-gen DEX?

IntermediateDec 03, 2023
This article explores three major intent-centric protocols - UniswapX, 1inch Fusion, and CoWSwap - through detailed charts and case analysis. It explains the origins and backgrounds of these protocols, interprets their operational mechanisms and data performance, and reveals the product differences, strengths, and weaknesses of each, as well as the unique aspects of CoWSwap in terms of product core.
Is CowSwap, an intent-based swap, the next-gen DEX?


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 made a big splash but also faced controversy. The most pointed accusation was whether UniswapX copied CoWSwap and 1inch. Curve’s official Twitter account stated, “The game was changed long ago by @1inch when they first did high-quality aggregation and @CoWSwap when they pioneered the solver model. UniswapX is good, but it’s not the first or the second.”

CoWSwap emphasized its position as the pioneer of Intent Based Trading. So, what exactly is CoWSwap? How does it differ from UniswapX? Why do market voices accuse UniswapX of “copying” CoWSwap instead of 1inch fusion?

With detailed analysis of their backgrounds, mechanism interpretation, data performance, and comparison of 9 product differences with UniswapX and 1inch fusion, let’s explore what CoWSwap is, how it works, and address the controversy of “copying”.

MEV Attacks “Steal” From DeFi Users

DeFi users have always been victims of MEV attacks, such as front-running, back-running, and sandwich attacks. CoWSwap protocol offers MEV protection to minimize users’ MEV losses. Before diving in, let’s briefly understand what MEV attacks are.

Imagine this scenario: You finally have the perfect trading opportunity! You open Uniswap, and as the pending ends, you realize that the tokens received in your wallet are much less than expected. You open the block explorer and discover that someone manipulated the price before you made the purchase and quickly sold after you bought, pocketing the price difference. Yes, you have fallen victim to an MEV attack.

MEV attacks occur due to the “asynchronous” submission of transactions to the blockchain. When users submit transactions on Ethereum, they are not immediately added to the next block. Instead, they first enter the “mempool,” which is a collection of all pending transactions. Then, validators extract transactions from the mempool and add them to the next block during the building process. As the mempool is public, searchers have the opportunity to pay validators to order transactions in a specific way, extracting value from users through prioritized sorting.

图源:CoWSwap Docs

The Dark Forest’s Pathfinder:MEV Protection by CoWSwap

Better than the best price. —— CoWSwap

Although CoWSwap’s name seems related to “cows,” here, CoW stands for “Coincidence of Wants,” referring to a specific matching of trades. Specifically, “Coincidence of Wants” is an economic phenomenon where “two parties simultaneously hold something the other wants, enabling direct exchange without the need for currency as a medium.”

In the CoWSwap protocol, users don’t need to send a transaction to execute a trade. Instead, they need to send a signed order (or transaction intent). The order specifies the maximum and minimum outputs they are willing to receive within a specific time frame. Users don’t care about or need to know how it is executed. Then, off-chain signed orders are handed to solvers, who compete to find the best execution path when the order becomes valid. The winning solver gets the right to execute the batch. This also means that solvers bear the gas costs required for executing the orders, and users do not need to pay gas in case of transaction failure (e.g., not finding a path satisfying the committed price before the deadline).

CoWSwap’s MEV Protection:

1. Batch Auctions

When two or more traders exchange cryptocurrencies without the need for on-chain liquidity, a “demand coincidence” occurs. CoW enables the packaging of orders in batches, resulting in efficiency improvements. This eliminates on-chain costs such as LP fees, gas fees, and avoids slippage and potential MEV attacks.

According to Leupold, the technical lead of CoWSwap, the highly fragmented market liquidity caused by the explosion of various tokens in the DeFi space requires market makers to “intervene and provide liquidity” between various token pairs. If demand coincidences can be found in each block, the scattered liquidity spaces can be re-aggregated.

2. Off-Chain Solvers

By having a third party handle 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 can find a better execution path, the order will be completed at a better price. Otherwise, it will be executed at the worst quoted price. All transaction management risks and complexities are handled by professional solvers.

Users only need to express their “transaction intent” without worrying about the execution process. CoWSwap’s mechanism protects inexperienced users who do not know how to “prioritize” themselves in the public mempool. They don’t have to worry about being in the “dark forest”.

3. Unified Clearing Prices

If two people trade the same asset in the same batch, the protocol will enforce a single price for each batch of tokens. The two transactions will be settled at the “exact same price” without the concept of first-come, first-served. Even if a block has multiple transactions with the same token pair, each transaction will receive a different price depending on the transaction order with the pool. However, CoWSwap protocol requires uniform clearing prices, so reordering is meaningless. According to Leupold, this method eliminates “various MEVs”.

CoWSwap’s unique mechanism aligns closely with the concept of Intent in the DEX space, even before it was formally introduced. However, it is not as well-known as other aggregators like 1inch. This may be due to various reasons.

Disadvantages of CoWSwap:

1. Not Suitable for Inactive Tokens

In theory, this mechanism can present users with better prices, but it can also lead to losses. For actively traded tokens, orders have a high probability of finding “demand coincidences” to optimize prices. However, for inactive tokens (assuming ETH in this case), the Solver may execute the order at the maximum allowable slippage or even exceed the slippage that would occur within a single liquidity source.

2. Additional Protocal Fees

For small trades with sufficient liquidity, Cow’s protocol revenue may result in losses for users.

3. Not Supporting All Tokens

CoWSwap does not support the exchange of all tokens, only tokens that comply with the ERC-20 standard. Additionally, some tokens, although implementing the typical ERC20 interface, result in the recipient receiving an amount smaller than the specified send amount when calling the transfer and transferFrom methods. This can cause issues with CoWSwap’s settlement logic, and thus $Unibot does not support trading on CoWSwap.

CoWSwap’s Market Performance through Data

Ideals are always lofty, but reality is tough. Only through data can we truly explore the market performance of CoWSwap. Considering the advantages of CoWSwap, we will analyze its market performance from the perspectives of anti-MEV performance, trading volume, and market share.

1. MEV Resistance

Compared to sandwich attacks that occur on Uniswap and Curve, CoWSwap significantly reduces the number of attacked transactions through its routing. Compared to 1inch and Matcha, CoWSwap has the fewest sandwich attacks and the lowest proportion of attacked transactions in 2022.

Research report from the on-chain MEV analysis team @EigenPhi

2. Trading Volume and Market Share

CoWSwap ranks fourth in terms of trading volume, ninth in terms of user count, and fifth in terms of average trade size among aggregators. 1inch is the leader in these categories.

https://dune.com/murathan/uniswap-protocol-and-aggregators

Comparative analysis of aggregator market shares. 1inch dominates the market with a share of approximately 70% based on its large user base. CoWSwap follows with a market share of approximately 10%. Behind them are 0xAPI, Match, and Paraswap. CoWSwap’s market share is showing a growth trend.

https://dune.com/murathan/uniswap-protocol-and-aggregators

CoWSwap’s monthly trading volume has shown significant fluctuations. As of September 1st, the total trading volume reached $27.4B.

https://dune.com/cowprotocol/cowswap

3. DAO Adoption

One-third of DAO trading volume occurs on CoWSwap. CoWSwap satisfies the special order requirements of DAOs, such as limit orders and TWAPs, Milkman (on July 10th, Milkman was used by AAVEDAO to monitor a swap of 326.88 wETH and $1,397,184 worth of $BAL for B-80BAL-20WETH with slippage) , which often require large, MEV-resistant trades. This proportion is still growing, and in August, CoWSwap accounted for over half (54%) of the volume.

https://dune.com/queries/2338370/3828396

4. Balancer Provides Incentives

On March 24th, Balancer released [BIP-295] proposal to provide ~50-75% fee discount for CoWSwap solvers. CoW ranks third in trading volume on Balancer, following Uniswap and Curve.

https://dune.com/sixdegree/dex-aggregators-comparision

“Copying” Controversy

“CoW Swap is the first DEX Aggregator offering some protection against MEV”—— CoWSwap About

CoWSwap, formerly known as Gnosis Protocol V1, was launched in 2020. It was the first DEX to provide circular trading through batch auctions. UniswapX and 1inch fusion adopted a similar architecture to CoWSwap: signing orders, outsourcing transaction creation to third parties, and incentivizing third parties to return MEV to users. UniswapX was accused of copying CoWSwap upon its launch, and 1inch fusion was jokingly referred to as a modified version of CoWSwap.

Explore the differences between the three and summarize them into nine aspects

1. Third-Party Names

  • UniswapX:filler
  • CoWSwap:solver
  • 1inch fusion:resolver

Their responsibilities are the same: providing solutions for user-signed orders, bundled into a single transaction in a block.

2. Execution Process

  • UniswapX:The winning quote filler has priority for a certain period of time, followed by a Dutch auction.
  • CoWSwap:Submits all solver solutions to the Driver ranking. Once the bidding ends and all solutions are submitted and ranked, the ranking information is announced, and the top-ranked solution is executed.
  • 1inch fusion:The number of resolvers increases over time, while the price decays.

1inch Fusion initially has only 1 resolver in the first minute, which has been criticized for “resolvers waiting for the price to drop before executing,” leading to longer user waiting times.

Note: The proposal has been approved, and the number of resolvers will be increased 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:packs all outstanding orders on the chain into a single batch for the Dutch auction, allowing orders to be matched with CoW.
  • UniswapX:fillers individually process one or more orders via API.

Due to the complexity of orders, it is difficult to determine if the optimal solution can be found within one block time in CoWSwap. There may not even exist an optimal solution.

4. Level of Order Parameterization

  • UniswapX:sers have more freedom (which may bring more complexity) to define parameters, including auction decay functions and initial Dutch auction prices.
  • CoWSwap and 1inch fusion:Users only need to provide the tokens to be exchanged and the slippage. CoWSwap also allows setting the duration of the order. \

5. Different Sources of Third-Party Liquidity

  • UniswapX:Allows any filler to access liquidity sources, including private ones.
  • CoWSwap:CoW and external liquidity sources.
  • 1inch fusion:Usually large-scale market makers.

CoWSwap focuses more on finding counterpart orders at the same time, while 1inch market makers act as resolvers and can choose to execute directly. UniswapX also allows professional market makers to participate, potentially addressing the criticism of “resolvers waiting for the price to drop before executing” aimed at 1inch, and competing for 1inch’s market share.

6. Degree of Decentralization

  • UniswapX:Absolutely permissionless, allowing anyone to access outstanding orders through the API and compete with Reactors and other fillers (unless fillers are specified by users).
  • CoWSwap:Either being whitelisted by creating a $1M USDC/COW pool or being whitelisted by Cow DAO based on DAO standards.
  • 1inch fusion:Based on the amount of $1INCH token staked and weighted staking duration, select the top ten addresses as the Resolver. Registration is required to undergo the KYC process, and there should be sufficient balance to cover the transaction fees.

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

7. Different Sources of Quote

  • UniswapX:Allows fillers to quote (RFQ), which means allowing fillers to set the initial Dutch auction price.
  • CoWSwap、1inch fusion:API quotes.

8. UniswapX Uses RFQ and Considers Reputation System

  • UniswapX:allows orders to specify a filler for execution within a certain period of time (followed by a Dutch auction) to incentivize fillers to quote in the RFQ system. To limit fillers’ abuse of this exclusive right, a corresponding reputation or punishment system may be introduced.
  • CoWSwap:rewards the solver with the highest completion rate once a week.

9. Uniswap X to Introduce Cross-Chain Aggregation Functionality (Not Yet Implemented)

  • UniswapX:able to expand to support cross-chain transactions, where exchange and cross-chain are merged into a single action without the need for the exchanger to directly interact with the bridge to exchange assets held on the original chain for the required assets on the target chain.
  • CoWSwap、1inch fusion:still under discussion.

Conclusion

Overall, CoWSwap is an intriguing project. By outsourcing orders to third-party Solvers for execution and adopting an off-chain execution and on-chain settlement and verification approach, CoWSwap shares similarities with the philosophy of scaling through Layer 2 solutions. CoWSwap cleverly turns trading into a vast barter economy, addressing the issue of fragmented liquidity and utilizing on-chain liquidity when peer-to-peer transactions cannot meet the demand.

One of the requirements for implementing Intent is that anyone can act as a Solver to improve efficiency through competition. The architecture of CoWSwap undoubtedly aligns with this concept. By entrusting all the risks and complexities of managing transactions to professional Solvers, users are protected from “walking” in the dark forest. This is consistent with the philosophy of DODO V3, where the funds of liquidity providers are managed by professional market-making teams, eliminating the need for personal strategy considerations.

CoWSwap has made significant progress in addressing MEV issues and is gaining market share under the narrative of Intent. However, it has also encountered obstacles such as protocol fees and the lack of support for all tokens in large-scale applications. As pioneers of the solver model, UniswapX and 1inch fusion have introduced innovations based on its foundation. 1inch releases resolvers in a sequential manner, connecting with professional market makers, while Uniswap’s RFQ system allows users to specify fillers before presenting proposals. We look forward to the CoWSwap framework driving more innovation in the decentralized exchange aggregator space, and are hoping for a prosperous and outstanding future for CoWSwap.

Disclaimer:

  1. This article is reprinted from [DODO Research]. All copyrights belong to the original author [xiaoyu]. If there are objections to this reprint, please contact the Gate Learn team, and they will handle it promptly.
  2. Liability Disclaimer: The views and opinions expressed in this article are solely those of the author and do not constitute any investment advice.
  3. Translations of the article into other languages are done by the Gate Learn team. Unless mentioned, copying, distributing, or plagiarizing the translated articles is prohibited.
Start Now
Sign up and get a
$100
Voucher!
Create Account