Article author: Uniswap

Article compiled by: Block unicorn

Since Uniswap was founded, we have been committed to creating the best exchange experience. As the crypto market develops, our understanding of user experience is also evolving.

In order to be the best exchange platform, Uniswap must provide the best price and the best liquidity. The best price seems easy to measure, but deep liquidity is needed to find the best path. Liquidity is best when there is a flexible but reliable combination of tokens, liquidity pools, and rate hierarchy to attract more liquidity providers to create deeper markets.

Each version of Uniswap supports more complex liquidity pool features, and v4 will take this to the next level. While great for liquidity, the customizability of liquidity pools makes it difficult to provide traders with the best price and the best trading path. As the market has evolved, routing and liquidity have become two different but related problem areas.

To make progress on both fronts, we are splitting it. Uniswap v4 introduces hooks for building custom automated market maker (AMM) functionality, such as recurring investments or oracles. Uniswap X outsources the complexity of routing to an open network of third-party fillers who compete to find the best price for liquidity sources. Together, these two complementary protocols help users get the best exchange experience.

Uniswap v4 provides the best liquidity

Uniswap v1 was an experiment in liquidity creation to test whether AMMs had a place in crypto. But AMMs unlock powerful new tools that enable anyone to create permissionless markets. Uniswap became the most popular venue for long-tail tokens like MKR and DAI. The next question then arose, which was what was the best place to provide liquidity.

Subsequent versions of Uniswap have become more colorful. Uniswap v2 and v3 introduced ERC20 trading pairs, centralized liquidity, and custom fee tiers, making the deployment of liquidity more customizable. Uniswap v4 will go a step further. V4 Hooks are like plug-ins, allowing liquidity pool deployers to add custom code to the liquidity pool and run any custom code at key moments throughout the liquidity pool, such as setting operations before and after transactions, and setting custom transaction execution values.

With Hooks, developers can innovate on top of the liquidity and security of the Uniswap protocol to create custom AMM pools that integrate with v4’s smart contracts. Because each pool is now defined by more than just a token and fee tier, we’ll see pools of all shapes and sizes.

All this customization and expressiveness is starting to fragment Uniswap’s liquidity across three (soon to be four) different versions and almost a dozen blockchains. To find the best price for a trade, more pools need to be checked to determine the best path. This means more computation, more hops, and more gas. Custom AMM functionality will make Uniswap the best choice for liquidity, but it will become more challenging to find the best path to get the most tokens to traders.

UniswapX is a protocol that focuses on the routing problem. 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 that provides the best price for traders.

UniswapX offers the best prices

Finding the best path depends on how broad the liquidity coverage is. The broader the liquidity we know about, the more options we have to find the best path. Uniswap auto-routers, DEX aggregators, and meta-aggregators have become popular for this very reason — they have broad liquidity coverage.

However, manually maintaining a single routing engine is unsustainable as liquidity pools continue to expand. Aggregators require constant maintenance and become a bottleneck. With the launch of Uniswap v4, this maintenance will become more difficult. Liquidity will exist behind custom hooks that routing engines need to find, audit, and use.

Our solution to the routing problem is to create a marketplace that makes liquidity discovery fun. Rather than accepting quotes from a single source, trades are routed through an auction system where "fillers" compete to find the best path that provides the best price for the trade.

This market is highly competitive. Like block builders and traders today, fillers (liquidity providers/LPs) are incentivized to offer lower prices using whatever strategies they have at their disposal. They can return MEV to traders, find uncommon sources of liquidity, leverage private inventories, or save on gas fees through batching — any strategy that gives them an advantage in winning the auction. UniswapX transforms routing from a one-to-one problem to a one-to-many problem, using a permissionless protocol to regulate market participants, set ground rules, and let fillers compete to return value to traders.

Creating a swap fulfillment market prepares us for a multi-chain future. Exchanging tokens on different chains needs to emulate the user experience of swapping on a single network. Routing needs to abstract away the complexity and latency of bridging. Fillers can leverage cross-domain MEV, private inventories, and user intent to win the right to provide the most output tokens to traders.

As the number of existing liquidity pools forks across the four Uniswap versions and more chains, Uniswap X’s network of fillers will actively discover new sources of liquidity to maximize liquidity coverage and provide the best prices.

Parallel and complementary protocols

Uniswap v4 and Uniswap X are parallel and complementary protocols, each focused on solving specific problems: Uniswap v4 optimizes pool customizability to maximize expressiveness, while Uniswap X optimizes routing to maximize output tokens. Combined, the two protocols provide traders with the best trading experience while maintaining our commitment to decentralized, censorship-resistant, and permissionless markets.