Introduction
Following the unveiling of Uniswap v4, the crypto community was abuzz with discussions, not just about the contentious topic of code licensing, but also about Uniswap Labs’ innovative approach to integrating existing DeFi primitives.
Observers noted the clever incorporation of features reminiscent of Balancer’s Vault or Ambient’s single-contract DEX through a Singleton contract, dynamic fees akin to those in other DEXs, and the utilization of idle liquidity to generate yield, much like Balancer’s boosted pools. The narrative took a similar turn with the announcement of Uniswap X at ETHCC 2023, as a wave of criticism emerged, accusing Uniswap of overstepping the bounds of inspiration by incorporating elements strongly reminiscent of protocols like 1inch and Cowswap.
Regardless of all criticism, Uniswap X is the realization that there must be a complement to Uniswap v4 in order to come up with the ultimate DEX platform. More specifically, Uniswap v4 inevitably introduced some tradeoffs: the singleton contract and hooks come at the expense of making liquidity fragmentation even worse and routing even harder. As an example, v4 makes routing harder by increasing the number of pools and complexity of each pool and routing across them (due to the broad design space and arbitrary logic of custom hooks).
Overview
Uniswap TVL Source: Coingecko
Primary Chain: Ethereum Mainnet TVL
UniswapX is the latest product from Uniswap Labs. It is a non-custodial Dutch auction-based trading protocol implemented for the Ethereum Virtual Machine. The protocol aggregates both on-chain and off-chain liquidity, internalizes Miner Extractable Value (MEV) in the form of price improvement, offers gas-free swaps, and can be extended to support cross-chain trading.
While the design clearly takes inspiration from CowSwap’s off-chain solvers and 1inch Fusion’s Dutch auction, UniswapX is better understood as an RFQ (Request for Quote) system that has the ability to tap into both off-chain and on-chain trading venues.
Put simply, there are two market participants:
- Swappers – entities looking to buy or sell spot assets (i.e. market takers).
- Fillers – entities such as MEV searchers or on-chain market makers, which will help swappers receive optimal execution for their trades.
For market-making purposes, fillers are free to use any available trading venue, even Binance or Coinbase for that matter. The next step involves filling that order. For that, swappers will specify a series of parameters:
- What (and how much of an) asset to trade.
- What (and how much of an) asset to trade for.
- The absolute minimum output tokens they are willing to accept.
- The maximum amount of time they are willing to wait for the order to fill.
- The usual approval to spend tokens.
- A time-decay function that gradually worsens the price execution.
Dutch Auction-Based Trading
To understand the utility of the time-decay function, we can go back to the origin of Dutch auctions, which can be traced back to the Netherlands in the 17th century during the Dutch Golden Age. These auctions were commonly used to sell goods, particularly flowers, such as tulips.
During a Dutch auction, the seller starts with a high asking price for the item being auctioned. The price is then gradually lowered until a buyer is willing to accept the price and make a purchase. The first buyer to agree to the price wins the item.
At that time, tulip bulbs were highly sought after, leading to a speculative “tulip mania” in which prices soared to extravagant levels. Dutch auctions were used to quickly and efficiently sell tulip bulbs, with the decreasing price adding an element of urgency for buyers to make a purchase.
With UniswapX, the protocol will leverage this functionality to come up with the concept of OFA, which stands for Order Flow Auctions:
- A swapper (user who wants to swap one token for another) signs an off-chain order indicating their intent to swap a certain amount of one token for another. This order includes the maximum price the swapper is willing to pay.
- This order is then broadcasted to fillers, who are entities that take the other side of the trade (like market makers, arbitrageurs, or other users).
- The Dutch auction begins with a high price that continuously decreases over time. Fillers monitor the auction and when the current price matches the price they are willing to accept, they execute the order on-chain.
- The first filler to execute the order wins the auction. They receive the tokens from the swapper and send the swapped tokens back to the swapper.
By using a Dutch auction mechanism, UniswapX ensures that swappers always receive the best possible execution on their orders.
The competitive nature of the auction means that fillers are incentivized to execute orders as soon as the price is right, leading to efficient and fair trades.
Additionally, orders can be parametrized by an optional RFQ (Request for Quote) that helps the auction to happen faster. This leads to the two variants shown below.
The main benefit of the RFQ variant is the ability to converge more quickly on the initial or expected price.
Gas-Free Swaps
Instead of orders being transactions, orders become off-chain signatures. UniswapX trades use Permit2 executable off-chain signatures, allowing swappers to pay transaction fees implicitly as part of their swap and avoid maintaining a balance of the chain’s native token. This feature eliminates gas costs for failed swaps and makes the process more gas-efficient than swaps on the core Uniswap Protocol.
By moving to off-chain signatures, fillers will pay the gas costs on behalf of the swapper (e.g. if the swapper wants to swap $USDC for $DAI, they will not need to have $ETH in their wallet). Hence, because swappers don’t have to pay gas, they don’t need a chain’s native network token (e.g. $ETH, $MATIC) to swap.
These off-chain signatures are called Dutch orders, because the user specifies the price they want their order to be executed at, and the price then decays until the transaction is filled or times out. This makes it possible for fillers to compete against each other to fill first, leading to better price execution and not necessarily the realization of slippage.
Therefore, by creating an auction-based routing protocol, UniswapX creates a competitive marketplace for trade execution, thus complementing Uniswap v4 by aggregating on-chain and off-chain liquidity.
MEV Internalization
MEV poses a significant challenge in on-chain swapping today. It refers to the profit a miner can make through their ability to include, exclude, or re-order transactions within the blocks they produce. In many cases, this leads to worse prices for swappers as miners or arbitrage bots can manipulate transaction ordering to their advantage. MEV activities often come at the expense of regular users.
Unlike standard Automated Market Makers (AMMs), UniswapX internalizes MEV in order to keep as much value for the swappers as possible.
- Improved Prices: UniswapX ensures that MEV, which would typically be captured by an arbitrage transaction, is instead returned to swappers in the form of improved prices. This means that any surplus generated by an order is given back to the users, reducing the value lost to MEV.
- Protection Against Extractive MEV: UniswapX also helps users avoid more explicitly extractive forms of MEV. For instance, orders executed with fillers’ inventory cannot be sandwiched. Sandwich attacks usually tend to impact large transactions, and involve MEV bots filling buying an asset shortly after they find out that a large trade is about to be approved. This raises the price of the asset, so by the time the original large order is approved, there may be significant slippage.
- Private Transaction Relays: Fillers in UniswapX are incentivized to use private transaction relays when routing orders to on-chain liquidity venues. This means that transaction information is kept private until the transaction is executed, reducing the opportunity for malicious actors to manipulate or front-run the transaction.
Cross-Chain Trading
One of the main advantages of this new intent-based architecture is the fact that, due to its off-chain nature, Dutch orders enable cross-chain swaps and fast L2 exits. This allows swappers to seamlessly trade assets on an origin chain for desired assets on a destination chain.
- The swapper signs an off-chain Dutch order.
- Fillers compete for the swapper’s order in a Dutch auction, and whoever wins claims that order.
- The swapper’s input tokens are now locked in a smart contract in the input chain.
- The filler will then proceed to fill the swapper on the destination chain.
- A message is then initiated through a bridge releasing the swapper’s input tokens back to the filler.
These cross-chain orders can settle over almost any bridge, still enabling a seamless UX for swappers and allowing fillers to manage most of the complexity, such as gas payments. Also, the bridge latency is borne by the filler, not the swapper.
One of the key features is that this reduces exposure to bridge risk while still allowing for native asset swaps. Additionally, optimistic proofs (assumption that the bridge is filled unless proven otherwise) can be used as part of the bridge design, thereby introducing a challenge period during which others will be able to submit proofs if they detect an invalid settlement.
Protocol architecture
Carving Out a Niche in the DEX Aggregator Cector
To fully appreciate the strides made by UniswapX, it’s crucial to understand how most DEX aggregators operate. Typically, individual teams integrate liquidity sources one by one, hoping to amass as much liquidity as possible.
UniswapX, however, takes a different approach. Instead of manually finding and aggregating individual liquidity sources, UniswapX creates a marketplace where anyone can compete as fillers to offer the best price execution to a swapper. This approach not only democratizes the process but also fosters a competitive environment that ultimately benefits the end user.
By leveraging the power of competition and the ingenuity of the community, UniswapX is carving a unique niche in the DEX aggregator sector. It’s not just about aggregating liquidity; it’s about creating a dynamic marketplace where the best price execution is a product of healthy competition among fillers.
Key Takeaways
- UniswapX acts as an aggregator of both on-chain and off-chain liquidity sources.
- UniswapX introduces an RFQ (Request for Quote) System to match orders between swappers,
- Offchain signatures make new feats possible, including gas-free swaps. This eliminates the need to maintain balances of a given chain’s native token.
- Crosschain swaps are also made possible, as well as MEV internalization, which can reduce the occurrence of sandwich attacks.
Conclusion
UniswapX represents a significant evolution in the DEX and DEX aggregator design space, offering a unique solution that combines the efficiency of Dutch auctions with the power of on-chain and off-chain liquidity aggregation.
Despite many claims of taking huge inspiration from 1inch Fusion or Cowswap, Uniswap’s approach improves the handling of MEV at the protocol level and makes it possible to offer gas-free and cross-chain trading for protocol users.
By creating a competitive marketplace for trade execution, UniswapX is not only improving the trading experience for swappers but also democratizing the process of liquidity provision.
Finally, there are no primary or second-order effects as a result of UniswapX that will impact the $UNI token.
Links
Revelo Links
Uniswap Research Links
Disclosures
Revelo Intel has never had a commercial relationship with Uniswap and this report was not paid for or commissioned in any way.
Members of the Revelo Intel team, including those directly involved in the analysis above, may have positions in the tokens discussed.
This content is provided for educational purposes only and does not constitute financial or investment advice. You should do your own research and only invest what you can afford to lose. Revelo Intel is a research platform and not an investment or financial advisor.