Uniswap V4: A New Era For Defi

There has never been a better time to be a builder on Uniswap.

In the coming months, V4 of the protocol will be launched and we will enter a time where the Uniswap Protocol truly becomes a platform for all developers. While V1, V2, and V3 started to open the door for more developer activity, V4 busts the door open and ushers in a whole new wave of builders. These builders will create innovative ways to attract liquidity, design new interfaces, and bridge DeFi into the mainstream tenfold. How does this happen, though?

Well, in V4, the concept of hooks is introduced. Hooks are smart contracts that you can add to a pool to affect actions that happen within that pool. The V4 white paper explains how and where those hooks can happen. So far, the V4 contract contains four areas where developers can add a hook before or after an action occurs:

  • Initializing a Pool

  • Minting/Modifying a Position

  • Swapping

  • Donating

While there may be only four places where you can add hooks, this creates an almost endless realm of possible design and product choices for people to build on top of. And when we say endless, we mean it. You can create a pool with a hook that allows better pricing for large orders with a TWAMM hook, or you can create unique ones like one where a pool is only swappable during the hours of the regular NYSE. We've already been impressed with the depth and creativity of hooks we're seeing built, and we expect that to continue as time goes on.

Now, that's not the only exciting item about V4. In addition to the Singleton smart contract design and supporting native tokens, there will also be custom fee tiers and the ability to add dynamic fees to pools. If you can't tell already, customizability is what V4 is all about. As such, the protocol becomes a very interesting and exciting place for developers, but also for Liquidity Providers. With the ability to add custom hooks into pools, you're expanding the range of what can be done with liquidity — enhancing LP experience as a result. You can create a dynamic fee hook that increases fees in times of high volatility for a given pair, or you can create hooks for LPs that automatically modify your position due to certain events. These are just a few examples, but as you can see, there's a lot to be done in the space, and it amplifies the experiences that LPs can have.

However, this customizability also introduces an interesting new implication for Uniswap stakeholders. Across dozens of interviews with community members, the UF has found that the top concern for developers thinking about building hooks is how routing to pools with these hooks will be handled. In V3, a given pair could only be customized across 4 fee tiers. V4 introduces a world in which a single pair could be customized across a hypothetically infinite number of fee tiers — and an infinite number of hooks. As such, routing, a task which is already a challenge to do effectively, becomes even more difficult. Routers in a V4 paradigm must now not only work to offer the best execution possible, but also take into account all of the permutations of how a hook might execute an order for a given swapper, and steer clear of malicious or dangerous hooks. And on the flip side, how can a hook developer receive some assurance that pools using their hook will receive order flow?

We’re excited to see many teams in DeFi working to address the space of routing and aggregation. Teams like CoW Swap, 1Inch, 0x have been innovating in this space for years, and recently Uniswap Labs entered the fold with UniswapX, in order to provide the best execution to swappers across on- and off-chain liquidity sources (UF Governance Lead Erin Koen shared a post yesterday about UniswapX and what it means for the Uniswap Protocol and community). We believe aggregators built by these teams, and particularly the models which open up routing to a competitive marketplace, are complementary to V4, and to the needs of V4 hook developers.

Consider an alternative space made up of a static set of routers maintained by teams building other interfaces and apps — hook developers would be entirely reliant upon the development cycle of those teams to update their routers to whitelist their hooks. This could disincentivize developers from building hooks as a central party (the static router) would essentially be determining if the pools with their hooks would be routed to or not. Rather, hook developers are best served by a competitive marketplace of routers. In this instance, routers are competing to find the best liquidity to fill orders, which means hooks that attract a lot of liquidity would be found by one of these routers in the marketplace in order to win order flow. In turn, we believe this environment incentivizes developers to build great hooks that attract liquidity and compete with other on- and off-chain liquidity sources — a tall task but a requirement in order to strengthen DEX liquidity for the long term.

The launch of V4, combined with protocols building sophisticated router mechanisms, makes this an exciting time to be in the ecosystem. Developers are now even more empowered to come up with creative, unique, and valuable hooks on V4 that attract liquidity — and order flow — to pools. LPs can benefit from increased customizability and earn more fees by being in pools with innovative hooks. In short, we believe that the best hook designs will always attract liquidity — and in turn will be found by routers competing to serve up the best execution to swappers. As we stated from the beginning, there has never been a better time to build on Uniswap. We are committed to supporting the Uniswap ecosystem, particularly developers building their own V4 hooks and routing mechanisms/protocols, as we move into this next phase. We cannot wait to witness all the incredible developments that will come from it!

Subscribe to Uniswap Foundation
Receive the latest updates directly to your inbox.
Mint this entry as an NFT to add it to your collection.
Verification
This entry has been permanently stored onchain and signed by its creator.