Typefully

Uniswap V4 Overview

Avatar

Share

 • 

3 years ago

 • 

View on X

The long awaited Uniswap V4 is out! The @Uniswap team added new features that will increase interoperability, lower gas fees and add customization! And did someone say... on-chain limit orders on UNISWAP? Let's dig in!
Just a note, I borrowed many graphics from the @Uniswap Labs team from their documentation and recently released thread to help explain the concepts in this thread. Hats off to the amazing work the team has done to ensure and document the features. Thread linked at the end.
The four new features are as follows: 1️⃣Hooks 2️⃣Singleton 3️⃣Flash accounting 4️⃣ Native ETH
1️⃣Hooks: Custom functionality to liquidity pools Each pool created by a user can define a hook contract for its LP. Hook contracts allow for the customization of many factors of the LP like swap fees and withdrawal fees charged to liquidity providers.
Hooks allow for custom logic that executes at certain moments of the swap. This means that custom actions can take place before and after a swap, AND before and after an LP position is changed. Hooks can be seen as plugins to customize how we interact with the DEX.
The Uniswap Labs team has already written the following hooks: ⌛ Time-weighted average market maker (TWAMM) 🔮 Customized onchain oracles 📖 Onchain limit orders The examples can be found here: github.com/Uniswap/v4-periphery/tree/main/contracts/hooks/examples
@haydenzadams outlined other potential hook features in his blog post found here: blog.uniswap.org/uniswap-v4
These features include: a) Dynamic fees based on volatility and other inputs b) Depositing out-of-range liquidity into lending pools c) Autocompounded LP fees back into the LP position d) Internalized MEV profits that are distributed back to the LPs
2️⃣Singleton: One pool to rule them all! In Uniswap V4, all liquidity pools will live on one smart contract! Say goodbye to hopping between smart contract pools to execute your trade! This single smart-contract solutions will reduce gas costs significantly.
Due to this new singleton model, developers will be able to piggy-back off of the security and network effects of Uniswap without having to build their own AMM from scratch.
3️⃣Flash accounting: The way singleton does its accounting Flash accounting is a more technical aspect to the Uniswap V4.
According to the docs: "Flash accounting [...] requires that no tokens are owed to the pool or to the caller by the end of the lock. During the call, tokens can be used for any number of operations inside and outside the singleton."
All in all, flash accounting reduces gas costs of trades that cross multiple pools and allow for more complex integrations.
4️⃣ Native ETH: Support for native ETH pairs Uniswap V4 allows for native tokens inside of V4 pools! Smart contracts no longer need to wrap ETH into WETH. The users benefit from another gas cost reduction as wrapping costs are removed!
Other features have also been included in Uniswap V4 such as ERC1155 accounting showed in this diagram below (taken from whitepaper).
Let me know your thoughts! Do you think Uniswap V4 is bringing something that is needed to the AMM space? Will it revolutionize the way we interact with DEXs?
For more information and documents, please check out the official announcement thread by the Uniswap Labs team below: twitter.com/Uniswap/status/1668603580184502276?t=A5F5iUhCo6yYGV5JS6tTMA&s=19
Link to the whitepaper here: github.com/Uniswap/v4-core/blob/main/whitepaper-v4-draft.pdf
Unicorn hunters @_FabianHD @pt1mfv_ @francescoweb3 @DeFiMinty @schizoxbt @Subli_Defi @0xsurferboy @rektdiomedes @chilla_ct @defi_mochi @CryptoKoryo @2lambro @thelearningpill @0xFlips @crypto_yuvi @burstingbagel
Unicorn caretakers @DAdvisoor @Louround_ @CJCJCJCJ_ @crypthoem @0xSalazar @WinterSoldierxz @jake_pahor @kindahangry @Slappjakke @arndxt_xo @CryptoShiro_ @ThisIsM1NH @crypto_linn @rektfencer @NNovaDefi @0xShinChannn @DefiIgnas
Avatar

Overcollateralized Jonny

@OvrCldJonny

Tokenizing @3iQ_corp, Co-Founder @Web3MTL All views/opinions are my own.