Hooks are smart contract plugins that can customize how pools, swaps, fees, and liquidity positions operate. Like extensions can add tools to your web browser, hooks can add more functionality to liquidity pools and positions on the Uniswap v4 protocol.
This is a new feature introduced by Uniswap v4.
Hooks enable developers and liquidity providers to execute actions at specific stages of a pool’s lifecycle such as before or after a swap or when liquidity is added or removed. This allows for greater customization of liquidity pools and positions.
Some things hooks can be used for:
- A time-weighted average market maker (TWAMM)
- Dynamic fees based on volatility or other inputs
- Onchain limit orders
Liquidity providers can add a hook to their pool on Uniswap v4. For more information, see this article.
Note: Hooks are developed by independent third-party developers who are not affiliated with Uniswap Labs. Exercise caution when adding hooks, as some may be malicious or cause unintended consequences. See more about hooks here.