Hooks is the most anticipated development in V4, allowing anyone to create custom logic and plug it into Uniswap as a module plug-in.
Written by francesco, member of Castle Labs
Compiled by: Ashley, BlockBeats
Editor’s note: The article introduces the innovative features of Uniswap V4, focusing on the modular features of Hooks, which allow developers to customize the liquidity pool logic. In addition, the article also discusses the technological advances brought by V4, such as Singleton architecture, lightning settlement and native ETH support, as well as multiple innovative projects built on the V4 platform, demonstrating the new opportunities that Uniswap V4 brings to the DeFi ecosystem.
The following is the original content (the original content has been compiled for ease of reading and understanding):
About Uniswap V4
Uniswap V4 will be officially launched on January 30, 2025. This historic moment marks the future development of DEX and AMM. With the introduction of Hooks, Uniswap has become more modular.
Hooks is the most anticipated development in V4, allowing anyone to create custom logic and plug it into Uniswap as a module plug-in. Before we delve into Hooks, let’s take a look at the key concepts introduced by Uni V4:
- Singleton structure
- Flash accounting
- Native ETH support
Singleton contract for pool deployment
The Singleton structure affects the deployment cost of mobility pools, which is reduced by 99.99% in Uniswap V4. Singleton also serves as an immutable settlement layer for all pools.
- Previously: Each pool has its own smart contract (factory model)
- V4: All pools are created within the same contract, reducing costs
Flash Accounting
With flash clearing, anyone can lock in tokens in the pool as long as no tokens are owed at the end of the lock. Using the EIP-1153 standard, users can stack multiple operations in one transaction and enjoy faster and cheaper transactions. EIP-1153 refers to “transient storage” where data is erased at the end of each transaction. This allows you to add more information to the transaction without increasing the storage burden.
- Before (factory model): A pool of multiple contracts will settle the token balance after each operation.
- V4: Singleton and flash settlement mean that one contract ensures correspondence of balances. The internal balance is updated for each operation, and external transfers are made at the end of the lock-up.
The new take() and settle() functions can be used to borrow or deposit funds into the pool, respectively. Ensure pool solvency by requiring that no tokens be owed to the pool manager or caller at the end of the call.
Hooks
With Hooks, anyone can launch a mobility pool with customized and flexible execution capabilities or new features. Hooks is for everyone:
- Chain: Promote ecosystem development through new functions
- Agreement: Improve user experience and differentiate
- Developers: Provide new ways to plug applications into Uniswap’s mobility
The Uniswap Foundation has promoted the creation of more than 150 new Hooks through direct grants and investments. Ensuring enough Hooks is one of the foundation’s core tasks, especially those that are open source, production-usable, and adapted to multiple use cases. Hooks can also manage the generated fees independently. They can be set as static or dynamic fees, and all fees can even be reallocated to incentivize their use (e.g., to liquidity providers, users conducting transactions, integrated applications, etc.).
The TVL of Uniswap V4 is already close to US$50 million.
more features
1. Native ETH support is back, reducing exchange costs for ETH transaction pairs by 15%.
- V1: Only ETH trading pairs
- V2: ETH was removed due to integration complexity and liquidity fragmentation caused by WETH
- V3:WETH
- V4:ETH, WETH
2. Custom settlement: Developers can use Hooks to introduce new settlement logic. Here are some examples:
(1) Introduce a custom expense model: Add expenses to LP positions
(3) Interface composability: Hooks adapts to the exchange parameters defined by each integrated smart contract
(4) Use ERC-6909 for token settlement and keep the tokens in the contract instead of transferring money
3. Governance does not control fee levels or tick spacing, but can extract a percentage of the pool’s exchange fees
4. Reduce Gas costs: Gas costs for liquidity pool deployments have been reduced through Singleton and Lightning Settlement models, and other optimizations have been introduced. For example, the built-in price oracle in the Uni V2-V3 is now redundant (saving oracle costs).
5. Users can also use the donate() function to pay tips directly from tokens in the pool to liquidity providers
The combination of these features means that Uniswap V4 is a more customizable integration with multiple optimization mechanisms that bring practical developer and user benefits:
- Cheaper multi-route switching
- Easier integration and customization
- Safe and audited code foundation
Star projects on Uniswap V4
The charm of Hooks is that they allow permission-free development on Uniswap V4. In just a few days, more than 25 external Hooks have been released, with transaction volume exceeding $66 million.
Some of the most interesting projects built on V4 include:
- Bunni
- Flaunch
- Sorella
- Doppler
Bunni @bunny_xyz
Bunni focuses on increasing the return of LP through the following unique features:
1. Liquidity density function (LDF) that creates complex liquidity distributions based on market conditions or strategies
2. Liquidity shape transformation: Liquidity shape can be modified at any time without removing positions
3. Automatic position rebalancing and automatic compound interest return
4. Improved exchange: Always maintain the same Gas fees across ticks, improving the efficiency of large transactions
5. Resorcise Hook: Pool can deposit idle assets in external agreements and earn additional income
These features cover most important DeFi protocols:
6. Auction mechanism allows MEV to recover and optimize fee revenue
7. Exchange costs on a volatile basis
Why choose to deploy on Bunni?
Flaunch @flaunchgg
Flaunch is a launch platform focused on memecoin that integrates multiple sustainability mechanisms:
1. 100% of the revenue is returned to the developer, and the developer can decide how much to give back to the holder. Unwithdrawn fees will be used for repurchase.
2. Native integrated automatic token repurchase mechanism (one repurchase is activated every 0.1 ETH fee generation).
3. Privacy Launch: After launch, the token price remains fixed for 30 minutes, ensuring everyone has the same entry point.
4. Memestream: Creators can use NFT to grant rights to transaction fees to any wallet they choose, creating a secondary market for token transaction fees.
About a week since its launch, Flaunch has repaid more than $622,000 in fees.
How to use Uniswap V4 Hooks? Poopman has explained this very clearly here.
Sorella Labs @SorellaLabs
Sorella Labs focuses on providing tools for LP to solve MEV issues:
1. The blockchain browser provides MEV information and statistics on the latest blocks, including: statistics from searchers and builders: MEV revenue and profits, top funds, top searchers MEV events: CEX-DEX arbitrage, atomic arbitrage, sandwich attacks, instant trading
2. Dashboard that monitors MEV events in real time: displays the memory pool and bids from all builders
3. MEV statistics over time, disaggregated statistics by category
Sorella Labs has also launched Angstrom, a new DEX iteration focused on reducing MEV losses for LP users. Angstrom’s proposed solution enables applications to:
- Ensure fair pricing of transactions: Transactions within all blocks are executed at the same price, eliminating priority fees.
- Allocate rebates from winning bids to LPs to include transactions in the block.
How does Angstrom work?
- MEV auctions occur in a memory pool within the application.
- Unlike payment priority rights, arbitrageurs “must directly bid with the LP to obtain the right to arbitrage.”
- All transactions are executed equally within the same block, reducing sandwich attacks. Gas fees can be paid using any token.
- Angstrom uses a network of “pledge verifiers” to enforce specific rules for sequencing through consensus: verifiers use EigenLayer to pledge ETH and ensure compliance with the rules by facing slash penalties.
The benefits provided by LP are in turn reflected by reducing transaction costs and reducing the cost of incentives for liquidity.
Doppler @whetstonedotcc
Doppler is a protocol focused on improving liquidity guidance and price discovery. It introduces the concept of a “liquidity auction” to implement liquidity guidance within Hook contracts. These complex operations are completely abstracted through the UI.
The auction can be:
- Successful: If they end up based on user parameters, liquidity will be sent to AMM
- Failure: All contributions will be refunded
Auctions are designed to help projects price liquidity more accurately and minimize the possibility of initiating liquidity at the wrong price. The process also greatly simplifies integrator challenges, removes the burden of thinking about liquidity, and allows teams to focus on other priorities. At the same time, decentralized integrators are encouraged through “integrator fees”, allowing integrators to set fees that can be captured after successfully guiding liquidity.
Doppler also launched its second product, Pure Markets, a Doppler-based front-end.
other projects
There are also some protocols built on Uniswap V4, including:
@ArrakisFinance
@Corkprotocol
@SemanticLayer
Uniswap V4 is expected to inject a new wave of vitality into DeFi, bringing many new use cases to the Ethereum ecosystem. This is just the beginning, and with the launch of Uniswap V4, we can continue to look forward to more innovative Hooks in the coming weeks.
Welcome to join the official social community of Shenchao TechFlow
Telegram subscription group: www.gushiio.com/TechFlowDaily
Official Twitter account: www.gushiio.com/TechFlowPost
Twitter英文账号:https://www.gushiio.com/DeFlow_Intern