- Blockletter
- Posts
- Uniswap V4
Uniswap V4
The largest DEX has just announced the next version of their AMM!
🚨CEXs are under attack🚨We need solid DEXs to take their place!2 years ago, Uniswap V3 introduced concentrated liquidity to improve capital efficiency.Now, Uniswap V4 is bringing customization & optimisation to DEXs.
Some argue that we wouldn't have #DeFi if it wasn't for Uniswap.Hard to disapprove.Throughout its 5-year journey, @Uniswap has undergone 3 major version:V1 = Innovated ERC20 - ETH pools & AMMV2 = Enabled ERC20/ERC20 pools & Flash swapV3 = Concentrated liquidity
So why do we need a new V4?Problem is, in V2 and V3 there is a lack of customizability.Problems like volatility oracles ideas like limit orders could not be added by third-party developers in V2 / V3 due to technical complexity.
With the launch of Uniswap V4, Uniswap is set to revolutionize #DeFi introducing more customizability with 3 new concepts:1. Hooks2. Singleton Structure3. Flash Accounting
1. Hooks Hooks is an external smart contracts that can execute logic at different "keypoints" in a pool.Keypoints refer to actions before/after swap, or when LP deposit / withdraw etc.
With hooks, pool creators can adjust pool parameters and introduce new functions to the AMM.More than that, the implementation of hooks can also shifts the curve and allowing various strategies to be built on top of Uniswap, ultimately benefiting LPs / swapper even more.
2. Singleton Structure In V3, you have to deploy a new contract every time you create a pool, and it's pretty expensive to deploy 💸.In V4, the singleton structure holds all pools in one contract, which makes pool deployment 99% cheaper than V3 📥
3. Flash Accounting In V3, each swap/LP staking ended with the action "transfer token."In short, you transfer your token after every operation.In multi-hop swapping, it can be REALLY painful as swappers need to consume a huge amount of gas fees during each operation.
With Flash accounting in V4, each operation (swap/deploy) will only result in an internal balance update 🧮, in which the balance is denominated in the unit "delta".By the end of the swap, it will only swap out the net "delta" balance after a series of calculations 🫶
Other notable upgrades in V4 include:☑️ Bringing back the Native ETH swapping☑️ Introducing the donate function (Tipping LPs, etc.)☑️ Governance updates to control the cap of the swapping fee
In summary, Uniswap V4 has enabled a more customizable, flexible, and efficient AMM that has never been seen in the space before.Most likely more dapps will leverage the flexibility of V4 & design optimized strategies to benefit their LPs or improve capital efficiency.