CoW Swap seeks to solve the MEV problem in decentralized trading

Using batch auctions in CoW Swap, users sign “trade intent” in an off-chain message that sets a limit price

article-image

Alena Demidyuk/Shutterstock modified by Blockworks

share

A coincidence of wants, Felix Leupold explains, is “an economic phenomenon where one party would like to purchase an asset that another party wants to sell, and the other party wants to buy another asset that the first party wants to sell.”

Enter the creation of the CoW protocol, built on the notion of two parties with opposite interests. 

The advantage is that the trading parties can forgo the complications of trading into another medium of exchange, like money, and instead trade directly.

Leupold, the technical lead at CoW Swap, explains the trading mechanism’s advantages on the 0xResearch podcast (Spotify/Apple), allowing for more efficient trading and, according to Leupold, mitigating the problem of MEV.

Due to the “Cambrian explosion” of a vast variety of tokens in the DeFi space, market liquidity is highly fragmented, Leupold says. To create liquidity between the wide variety of token pairs, market makers need to “step in and provide liquidity,” he says. 

If instead, a “holistic approach” can look at the “entire preference expression of the world” once per block, Leupold says, “you can re-aggregate that fragmented liquidity space and find those coincidences of wants.”

Importantly, such an arrangement cuts down on MEV — or maximum extractable value — attacks, where traders incur losses by being “sandwiched” or front-run by opportunistic bots. “Traditionally, if you want to trade token A for token B on Ethereum, you go directly to an [automated market maker] interface or a DEX aggregator,” he says. 

“The algorithm will find you the best on-chain route for your trade,” he says, and “give you back a transaction that you, with your MetaMask account, will submit to the blockchain to execute that trade.”

The problem takes place because of an “asynchronous aspect,” Leupold says, as time passes between receiving the “optimal route from whatever API you’re using” and the transaction being sent to the public mempool to be mined.

“During that time,” he explains, “prices can change,” and MEV actors can extract profit at the expense of traders. 

Batch auctions

Using batch auctions in CoW Swap, the user instead signs “trade intent” in an off-chain message that sets a limit, Leupold explains. “I want to sell token A for token B, and here’s my limit price. But I don’t care exactly how it is executed.”

The user then hands off the intent to “solvers,” Leupold says, a “decentralized network of matching engines.” They compete to find the best execution path at the time that the order is being made valid, he says.

As opposed to individual trades, orders are aggregated into batches, Leupold says. “All the trades that are placed into the API, within a 30-second window roughly, are placed into the same batch.” The solvers that find the optimal trade solution then receive the right to execute the batch.

“All these risks, these complexities of managing your own transaction,” Leupold says, “are now taken care of by a professional entity.” 

Podcast host Dan Smith observes that the solution sounds a lot like MEV-Boost, where builders work to solve transactions for proposers, but Leupold says the process is exactly the opposite in effect.

“If there are two people trading the same asset in the same batch,” he explains, “then the protocol enforces that there is only one price per token per batch.”

The two trades would be cleared “at exactly the same price,” Leupold says. “There’s no concept of first come, first serve or some kind of ordering, fair ordering. There’s just uniform price clearing, one price per token per batch.” This method removes “all kinds of MEV,” according to Leupold.

On CoW Swap, he says, “if there’s two people trading the same asset, you actually need to have a uniform price clearing, so [there’s] no difference between buy and ask.”

Unsophisticated users who don’t know how to “boost” their way to priority over others in the public mempool can be protected by the CoW Swap mechanism, Leupold says, and “not have to worry about all these games that are being played in the Dark Forest.”


Get the news in your inbox. Explore Blockworks newsletters:

Tags

Decoding crypto and the markets. Daily, with Byron Gilliam.

Upcoming Events

Old Billingsgate

Mon - Wed, October 13 - 15, 2025

Blockworks’ Digital Asset Summit (DAS) will feature conversations between the builders, allocators, and legislators who will shape the trajectory of the digital asset ecosystem in the US and abroad.

Industry City | Brooklyn, NY

TUES - THURS, JUNE 24 - 26, 2025

Permissionless IV serves as the definitive gathering for crypto’s technical founders, developers, and builders to come together and create the future.If you’re ready to shape the future of crypto, Permissionless IV is where it happens.

Brooklyn, NY

SUN - MON, JUN. 22 - 23, 2025

Blockworks and Cracked Labs are teaming up for the third installment of the Permissionless Hackathon, happening June 22–23, 2025 in Brooklyn, NY. This is a 36-hour IRL builder sprint where developers, designers, and creatives ship real projects solving real problems across […]

recent research

Research Report Templates.png

Research

Maple Finance has successfully navigated significant market challenges through its strategic pivot to secured lending (Maple v2) and the launch of its Syrup product. Syrup has become a primary growth driver, delivering sustainable, outperforming stablecoin yields and rapidly increasing TVL. The upcoming custody-first Bitcoin staking product (istBTC) presents another significant avenue for expansion. Crucially, Maple has achieved operational profitability, a key inflection point that, combined with a fully vested token and active buyback mechanism, strengthens its investment case. While valuation metrics suggest potential undervaluation relative to peers and growth, the primary forward-looking risk identified is the long-term sustainability of its current high-take-rate collateral staking revenue model.

article-image

In 2014, Microsoft virus scanners were detecting viruses in Bitcoin software

article-image

Ledn’s Mauricio Di Bartolomeo explained how this cycle’s been different for the lender

article-image

The shorts looking for funding range from charming animated series to gritty live-action dramas

article-image

Money, it turns out, is emergent, like consciousness

article-image

Bridge flows churn in both directions as risk appetite returns