Uniswap v4 is the next iteration of the Uniswap Protocol, building upon the success of Uniswap v3. It introduces a concept called “hooks,” allowing for customizable liquidity pools and trade functionalities on the blockchain. Hooks are contracts that enable developers to customize various actions within a pool’s lifecycle, such as before or after a swap or when changing LP positions.

This customization opens up a world of possibilities for creating innovative AMM pools. Some potential experiments include time-weighted average market makers (TWAMM), dynamic fees based on volatility, on-chain limit orders, depositing liquidity into lending protocols, customized oracles, and distributing internalized MEV profits back to LPs. Each pool can use its own hook contract, granting specific permissions determined at pool creation.

Uniswap v4 introduces an improved architecture that reduces gas costs and enhances efficiency. Instead of deploying a new contract for each pool as in v3, all pools now reside within a singleton contract, resulting in significant gas savings. Swapping tokens between pools held in different contracts is no longer necessary. Additionally, the new “flash accounting” system transfers assets only on net balances, further optimizing gas usage.

The singleton architecture, combined with flash accounting, offers enhanced efficiency and supports flexible fee tiers. Pool creators can set fee levels that make them competitive or customize them using dynamic fee hooks. Uniswap v4 also brings back native ETH support, providing additional gas savings.

In terms of licensing and governance, Uniswap v4 code will be released under a Business Source License 1.1. This license restricts commercial or production use for up to four years, after which it converts to a GPL license. Governance, represented by the Uniswap community and Uniswap Labs, can grant exceptions to the license. The Protocol fee mechanism, similar to v3, allows governance to vote and add a Protocol fee to any pool, up to a capped amount.

Uniswap v4 aims to foster innovation, efficiency, and customization within the decentralized exchange ecosystem, with the community playing a vital role in governing its development and direction.