Hooks
Last Updated: November 16, 2026
Hooks are pieces of custom code that a protocol runs at set points in its process, such as before or after a swap. In crypto, the term now mostly means Uniswap v4 hooks: separate smart contracts attached to a liquidity pool that change how the pool behaves without altering the core protocol. They let decentralized applications (dApps) add features such as dynamic fees.
How Hooks Work
Hooks can be used to trigger specific actions or conditions in a blockchain network or smart contract. For example, they might be programmed to execute a function when certain criteria are met, such as transferring tokens or triggering a specific event within a dApp. Hooks provide flexibility and extend the functionality of blockchain systems, enabling developers to innovate more easily.
In Uniswap v4, each liquidity pool can name one hook contract when it is created. The pool manager then calls that contract at the points it has signed up for: before or after a pool starts, before or after liquidity is added or removed, before or after a swap, and before or after a donation to liquidity providers.
Two design rules matter. A hook’s permissions are encoded in the last bits of its contract address, so developers search for an address that matches the functions they implement. A pool’s hook is also fixed at creation. It cannot be added, removed or swapped later, so a different hook means a new pool.
Uniswap v4 and What Hooks Can Do
Uniswap Labs first outlined hooks on June 13, 2023, when it shared its plans for v4. That post listed early experiments: a time-weighted average market maker (TWAMM) that spreads large orders over time, dynamic fees based on volatility, and on-chain limit orders. It also described one contract that holds every pool and “flash accounting”, which moves only net balances.
Uniswap v4 went live on January 31, 2025 on 10 networks, including Ethereum, Arbitrum, OP Mainnet, Base, Polygon and BNB Chain, Uniswap’s announcement says. More than 150 hooks had been built by launch. Common uses include dynamic fees, automated liquidity management, pools that only approved addresses can use, and custom pricing curves.
Types of Hooks
- Smart Contract Hooks: These are used within smart contracts to automate actions based on specific inputs or events.
- Protocol Hooks: These integrate into blockchain protocols to adjust network behavior or introduce new features without forking the network.
- Pool Hooks: Uniswap v4 style contracts tied to a pool at creation and called by the pool manager at fixed points.
Hooks in 2026: An Example
Uniswap v4 held about $1.0 billion in total value locked across its networks at 19:33 UTC on November 16, 2026, DefiLlama data shows. That figure covers all v4 pools, with or without a hook. A hook is optional, and many pools run without one.
Hook code has also been the weak point in some exploits. Cork Protocol lost 3,761 wstETH on May 28, 2025, after an attacker passed forged parameters through Cork’s hook to get around its authorization checks, Cork’s post-mortem says. In September 2025, an attacker took about $8.4 million from Bunni, using a flash loan and a rounding bug in its hook.
Security firm Trail of Bits, in a July 30, 2026 review, traced both cases to hook code, not to Uniswap v4’s core contracts.
Where to Check a Hook
Before using a pool with a hook, users can look up the hook address on a block explorer, check whether its code is verified, and look for a public audit. The address also shows which callbacks the hook uses, and the contract shows whether it can be upgraded. DefiLlama tracks v4 liquidity by network.
Risks and Limits
A hook can hold or move pool funds, so a bug or a malicious owner can cause losses that the core protocol does not prevent. Trail of Bits lists common failures: callbacks anyone can call, trusting any pool that attaches to the hook, rounding and accounting errors, and code that can revert swaps or block withdrawals. Upgradeable hooks can change behavior after a user deposits.
Hooks also add complexity. Each pool with a custom hook is its own design, which makes risks harder to compare across pools, and extra hook logic can raise gas costs. This entry is for education and is not investment advice.
Frequently Asked Questions
What is a hook in Uniswap v4?
A hook is a separate smart contract that a Uniswap v4 pool can attach when it is created. The pool manager calls it at set points, such as before or after a swap or a liquidity change. Hooks let builders add dynamic fees, custom pricing, access rules or automated liquidity management without changing Uniswap’s core contracts.
When did Uniswap v4 with hooks launch?
Uniswap v4 launched on January 31, 2025, across 10 networks, including Ethereum, Arbitrum, OP Mainnet, Base, Polygon and BNB Chain, according to Uniswap’s announcement. Early hook ideas, such as TWAMM orders, dynamic fees and on-chain limit orders, were first shared on June 13, 2023. More than 150 hooks had been developed by launch day.
Are Uniswap v4 hooks safe?
Not automatically. A hook is written by its own developer, not by Uniswap, and bugs in hook code have caused losses, including at Cork Protocol in May 2025 and Bunni in September 2025. Users can check whether the code is verified, audited and upgradeable. Uniswap v4’s core contracts were not the cause in those two cases.
Sources: Uniswap blog (June 13, 2023 and January 31, 2025); Uniswap developer documentation on hooks (read November 16, 2026); DefiLlama (read 19:33 UTC, November 16, 2026); Cork Protocol post-mortem; Trail of Bits (July 30, 2026).