Uniswap Labs, the team behind the popular decentralized exchange (DEX) Uniswap, has released a draft of the code for Uniswap V4 for the community to give feedback (see guidelines), find optimizations, and prepare to build on top of it.

This new protocol version promises to be faster, more efficient, and more customizable than its predecessors.

What’s New in Uniswap v4

In the blog post, the team shared their vision for Uniswap v4 and the planned changes.

Hooks & Custom Pools

One of the key features of Uniswap V4 is the introduction of hooks (wtf is it, thread).

"Hooks are contracts that run at various points of a pool action's lifecycle. Pools can make the same tradeoffs as v3, or they can add totally new functionality. For example, v4 will allow pools that natively support dynamic fees, add on-chain limit orders, or act as a time-weighted average market maker (TWAMM) to spread out large orders over time."

Improved Architecture and Gas Savings

Another major improvement in Uniswap V4 is using singleton contract architecture and a new "flash accounting" system.

In v4, all pools are held in a single contract, resulting in significant gas savings. Tokens will be moving within that single smart contract instead of transferring between pools in different contracts. The introduction of hooks and the singleton architecture allows for efficient routing across various options.

Additionally, the new "flash accounting" system optimizes asset transfers by only processing net balances, further enhancing gas efficiency. The implementation of EIP-1153, if approved in the #Ethereum Cancun hardfork, is expected to bring even greater gas improvements and cleaner contract designs. With these enhancements, fee tiers can be customized and set competitively, and native $ETH support is reintroduced, providing additional gas savings.

Overall

Overall, Uniswap V4 represents a major step forward for DEX and the broader DeFi ecosystem: increased functionality, gas & capital efficiency. Also, V4 makes Uniswap a far more composable protocol.

“The possibilities are pretty endless,” as Sara Reynolds of Uniswap Labs said to Decrypt, “can take it anywhere.”