In an official blog post, Uniswap introduces its vision for Uniswap v4, which it believes will impact how liquidity is created and how tokens are traded on-chain.
In line with this, it released the v4 draft code so that it can be built in public with open feedback and meaningful community contributions.
The conceived Uniswap v4 is expected to even usher in greater possibilities beyond Uniswap v3, released about two years ago.
Uniswap released Uniswap v4 code draft, the vision is to allow anyone to make these tradeoff decisions through the introduction of “hooks.” 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…
— Wu Blockchain (@WuBlockchain) June 13, 2023
According to it, v3 marked a watershed moment for on-chain liquidity and DeFi, with significant growth for the ecosystem.
It says that, currently, the Uniswap protocol is the largest decentralized exchange protocol, processing over $1.5 trillion in trading volume.
This is because Uniswap v3 took an opinionated approach to liquidity provision, balancing a complex trade-off space. The Uniswap team says that its vision with Uniswap v4 is to allow anyone to make trade-off decisions through the introduction of “hooks.”
Hooks refer to contracts that run at different points in a pool action’s lifecycle. Pools can make the same tradeoffs as v3, or they can add entirely new functionality.
V4 to reduce pool creation gas costs by 99%
Uniswap v4 will also boast unique features as it 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.
V3-enshrined oracles rather allow builders to integrate real-time, on-chain pricing data, but at the expense of some increased costs for swappers. As stated in the blog post, early estimates show that v4 reduces pool creation gas costs by 99%.
Another is that in Uniswap v3, a new contract is deployed for every pool, making creating pools and performing multi-pool swaps more costly. In v4, all pools would be held in one singleton contract, which will offer important gas savings because swaps will no longer need to transfer tokens between pools held in different contracts.
Source: https://u.today/uniswap-uni-releases-new-code-draft-heres-what-changed