How do Uniswap V4 and Uniswap X create the best trading experience?
Article Author: Uniswap
Article Compiled by: Block Unicorn
Since the establishment of Uniswap, we have been committed to creating the best exchange experience. As the crypto market evolves, our understanding of user experience continues to develop.
To be the best exchange platform, Uniswap must provide the best prices and the best liquidity. While the best price seems easy to measure, it requires deep liquidity to find the optimal path. Liquidity is at its best when there is a flexible yet reliable combination of tokens, liquidity pools, and fee structures to attract more liquidity providers to create deeper markets.
Each version of Uniswap supports more complex liquidity pool features, and version 4 will further enhance this level. While this is great for liquidity, the customizability of liquidity pools makes it challenging to provide traders with the best prices and optimal trading paths. As the market evolves, pathfinding and liquidity have become two distinct but related areas of concern.
To make progress in both areas, we are splitting them apart. Uniswap v4 introduces hooks for building custom automated market maker (AMM) functionalities, such as periodic investments or oracles. Uniswap X outsources the complexity of pathfinding to an open network of third-party fillers, who compete to find the best prices for liquidity sources, with these two complementary protocols working together to help users achieve the best exchange experience.
Uniswap v4 Provides Optimal Liquidity
Uniswap v1 was an experiment in liquidity creation to test whether AMMs had a place in cryptocurrency. But AMMs unlocked powerful new tools that allow anyone to create permissionless markets. Uniswap became the most popular venue for long-tail tokens like MKR and DAI. The next question that arose was where the best place to provide liquidity was.
Subsequent versions of Uniswap became more colorful. Uniswap v2 and v3 introduced ERC20 trading pairs, concentrated liquidity, and custom fee tiers, making liquidity deployment more customizable. **Uniswap v4 takes it a step further; the *V4 Hook* acts like a plugin, allowing liquidity pool deployers to add custom code to liquidity pools that can run any custom code at critical moments throughout the liquidity pool, such as setting custom execution values before and after trades.**
With hooks, developers can innovate on top of Uniswap's liquidity and security, creating custom AMM pools integrated with v4's smart contracts. Now, each pool is defined not only by tokens and fee tiers, so we will see a variety of shapes and sizes of pools.
All this customization and expressiveness has begun to disperse Uniswap's liquidity across three (soon to be four) different versions and nearly a dozen blockchains. To find the best price for trades, more pools need to be checked to determine the optimal path. This means more calculations, more hops, and more gas fees. Custom AMM functionalities will make Uniswap the best choice for liquidity, but finding the best path that provides the most tokens for traders will become more challenging.
UniswapX is a protocol focused on routing issues. It outsources the problem of finding the best path to a competitive market that understands other on-chain sources and private inventories to find the best path for traders to get the best prices.
UniswapX Provides Optimal Prices
Finding the best path depends on how broad the liquidity coverage is. The more extensive the liquidity we understand, the more options we have to find the best path. This is why Uniswap's automatic routers, DEX aggregators, and meta-aggregators have become popular—they have broad liquidity coverage.
However, as liquidity pools continue to expand, manually maintaining a single routing engine is unsustainable. Aggregators require constant maintenance, becoming a bottleneck. With the launch of Uniswap v4, this maintenance will become even more challenging. Liquidity will exist behind custom hooks, and routing engines will need to find, audit, and utilize these hooks.
Our solution to the routing problem is to create a market that makes liquidity discovery interesting. Instead of accepting quotes from a single source, trades are conducted through an auction system, where "fillers" compete to find the best path for providing the best prices for trades.
This market is highly competitive. Like today's block builders and traders, fillers (liquidity providers/LPs) are incentivized to leverage any strategies they have to offer lower prices. They can return MEV to traders, seek out uncommon liquidity sources, utilize private inventories, or save gas fees through batching—any strategy that gives them an edge to win in the auction. UniswapX transforms routing from a one-to-one problem into a one-to-many problem, using a permissionless protocol to regulate market participants, establish basic rules, and allow fillers to compete with each other to return value to traders.
Creating a market for exchange fulfillment prepares us for a multi-chain future. Swapping tokens across different chains requires simulating the user experience of swapping on a single network. Routing needs to abstract the complexities and delays of bridging. Fillers can leverage cross-domain MEV, private inventories, and user intent to win the right to provide the most output tokens for traders.
As the number of existing liquidity pools branches across four Uniswap versions and more chains, the Uniswap X filler network will actively discover new liquidity sources to maximize liquidity coverage and provide the best prices.
Parallel and Complementary Protocols
Uniswap v4 and Uniswap X are parallel and complementary protocols, each focusing on solving specific problems: Uniswap v4 optimizes pool customizability to maximize expressiveness, while Uniswap X optimizes routing to maximize output tokens. Together, these two protocols provide traders with the best trading experience while maintaining our commitment to decentralized, censorship-resistant, and permissionless markets.