Order Flow Auctions Explained
Want to know what makes CoW Swap unique? Apart from the amazing UI, MEV protection, and class leading surplus of course. It’s our unique use of Order Flow Auctions (OFAs). Never heard of them? You’re in the right place.
In this article we’ll explain what they are, how they work, and how they help traders on CoW Swap not only get the best prices for their trades, but help avoid dreaded MEV attacks.
What is an Order Flow Auction?
Order Flow Auctions are, at their simplest, a process where solvers compete to fulfil trades. The aim is to ensure users capture as much value from each swap or trade, while also being protected from Maximal Extractable Value (MEV).
The key point to take away from OFA is that it’s a competitive bidding system where solvers compete over who can make the best offer, which is then selected by the protocol. This system not only simplifies the trading process but also ensures traders access the best available price without the need to manually search through multiple platforms.
What’s the difference between Order Flow Auctions and regular swaps?
There is a difference between what happens when you swap on CoW Swap and what happens when you use platforms or wallets that don’t use OFAs.
When you trade or swap on other platforms that do not use Order Flow Auctions to manage trades, when you hit the button to trade, your transaction is sent to the mempool. This is a public queue of all transactions awaiting to be assigned to a block.
Validators then pull transactions from the mempool and add them to the next block when it’s time for it to be built. Here is where the opportunity to extract value through MEV comes in.
Validators are not required to add transactions to the block in the same order that they were submitted by users, so searchers can pay validators a fee to order transactions in a specific way. For example, they can pay to have their transactions come first if they want to frontrun someone else, or they can pay to have their transactions come right after a specific transaction if they want to perform a backrun — both are types of MEV.
On OFAs, however, your transactions are hidden from that mempool, meaning your trades are not exposed to prying eyes.
To find out more about how this system works, check out our page explaining what MEV is and how it works.
Why are Order Flow Auctions important?
Order Flow Auctions not only offer a safer way for users to make transactions, they are also more efficient. That’s because inside CoW Protocol’s OFA is a matching system called a Coincidence of Wants (CoW).
The solvers we mentioned earlier who are competing to find you the best deal on your trades look at a number of different sources in order to find you the best deal. One of those might be another trade in the batch. If the solver does find someone with a mirror trade to yours, they will facilitate the trade, which can help you save on fees.
If the protocol does not find a CoW, the solvers search all available on-chain and off-chain liquidity to find the best price for a set of trade intents within a batch.
Liquidity sources include:
-
AMMs (e.g. Uniswap, Sushiswap, Balancer, Curve, etc.)
-
DEX Aggregators (e.g. 1inch, Paraswap, Matcha, etc.)
-
Private Market Makers
These different sources - some of which may not be available to users - mean users can search dozens of liquidity sources with a single click, saving time, effort, and money too.
Let’s take a deeper look at how the Order Flow Auction Process works.
The Order Flow Auction Process Explained
There are several key steps to the Order Flow Auction process, which you can find below.
-
Gathering Orders: Orders from multiple users are collected and grouped together in a batch.
-
Auction Initiation: These batches are then presented in an auction format, and the auction begins.
-
Bid Optimization: Bidders assess the orders within the auction and then try to find the best execution based on what’s in the batch.
-
Selecting Winning Bids: Once all bids are submitted, the winning bid is selected.
-
On-Chain Settlement: The winning bids are pushed on-chain, along with all the orders included in the auction, and they are settled.
While these are the core components of each OFA, there are several different types of auction, which we explore below.
The different types of Order Flow Auctions
There are three primary types of Order Flow Auctions:
-
RFQ (Request for Quote) Auctions: RFQs are optimized for price discovery, so they are particularly suited to market makers offering quotes for swaps. These auctions help facilitate price discovery through a system of bidders quoting swaps and market makers using private inventory to offer better prices than automated market makers (AMMs).
-
Frequent Batch Auctions: A combination of price discovery, price optimization, and settlement path, Frequent Batch Auctions enable multi-dimensional intent matching. This, in turn, allows for trade optimizations not available through other mechanisms and complete protection from MEV thanks to peer-to-peer trading.
-
Block Space Aggregator Auctions: Unlike other auctions that focus on price discovery and execution, Block Space Aggregator Auctions provide value to the user through post-trade rebates. These rebates come from capturing value that likely would have leaked out at the last stage of the supply chain.
CoW DAO has long understood the potential of Order Flow Auctions to ensure better prices and better protection. Let’s take a look at how CoW DAO has implemented Order Flow Auctions into its products.
MEV Blocker RPC uses Order Flow Auctions at the block builder level
MEV Blocker is an RPC endpoint that facilitates Order Flow Auctions. If you're a wallet, a solver, or any project that settles transactions on behalf of users, MEV Blocker protects them from MEV and helps you earn some extra revenue.
Its primary objectives are to provide privacy, expedite transaction inclusion, and offer protection from MEV. MEV Blocker protects user transactions from the worst types of MEV, but it goes a step further by capturing backrunning opportunities and providing rebates. Users receive up to 90% of the value of any backrunning opportunity they create before MEV bots can take it for themselves.
Just 6 months after launch, MEV Blocker had protected 387,000 users, 7 million transactions, and $21 billion in DEX volume.
CoW Swap uses Order Flow Auctions at the dApp level
CoW Swap is an Order Flow Auction operating at the dApp level. It relies on intents, which hardcode transaction outputs, in order to prevent MEV exploits. CoW Swap aims to protect users from MEV, enhance liquidity, offer fair pricing, and optimize fee consumption.
Let’s see how Order Flow Auctions works when someone makes a transaction on CoW Swap.
A timeline of an order on CoW Swap:
-
Users express an intent to trade
-
Intents are registered in the orderbook
-
The protocol initiates a batch auction
-
Solvers optimize the trades within the batch auction
-
The protocol selects the winning solvers
-
Transactions are pushed on-chain, and users receive their tokens
CoW Swap’s efficiency lies in bundling multiple transactions into one which reduces block congestion and requires less gas. It also ensures uniform clearing prices for liquidity pools, promoting fairness and balanced liquidity.
How have Order Flow Auctions helped users of CoW Swap and MEV Blocker?
So far, these products have had a profound impact. Since its creation, MEV Blocker has protected over $188 billion in trading volume across 2.4 million users from MEV and has returned over 4,324 ETH in rebates (for an updated version of these stats, check out the MEV Blocker Dune dashboard).
CoW Swap, meanwhile, has optimized and protected tens of billions in trading volume across millions of users, (for an updated version of these stats, make sure to check the CoW Swap Dune dashboard).
These figures highlight the essential role that OFAs play in enhancing the Ethereum ecosystem.
Where might Order Flow Auctions go next?
Order Flow Auctions have the potential to benefit all Ethereum users through better price discovery, lower transaction costs, more liquidity, and fewer opportunities for exploitation.
The key features of OFAs are transparency and a competition mechanism that ensures only the best outcomes prevail.
CoW DAO is showcasing the power of OFAs through MEV Blocker and CoW Swap, two products that protect users from MEV and optimize block space usage.
In conclusion, as the blockchain space continues to evolve, Order Flow Auctions are emerging as a crucial tool for achieving fairness, efficiency, and transparency. CoW DAO’s innovative solutions offer promising glimpses into a future where users can trade with confidence in a secure and friendly environment.