Hooks
A hook is a smart contract attached to a Uniswap V4 pool. The pool calls it at set moments, so the pool can follow rules you write.
When a hook runs
Uniswap V4 can call a hook at ten points. A hook only opts in to the ones it needs.
| Callback | Runs |
|---|---|
beforeInitialize / afterInitialize | When a pool is created |
beforeAddLiquidity / afterAddLiquidity | When liquidity is added |
beforeRemoveLiquidity / afterRemoveLiquidity | When liquidity is removed |
beforeSwap / afterSwap | On every swap |
beforeDonate / afterDonate | When someone donates to the pool's liquidity providers |
Permissions
Each callback is a permission. There are four more permissions that let a hook change token amounts:
| Permission | Lets the hook |
|---|---|
beforeSwapReturnDelta | Take or give tokens before the swap is priced |
afterSwapReturnDelta | Take or give tokens after the swap, for example to charge a fee |
afterAddLiquidityReturnDelta | Adjust what a liquidity provider owes when adding |
afterRemoveLiquidityReturnDelta | Adjust what a liquidity provider receives when removing |
The hook card in the app lists the permissions each hook uses. They matter for two reasons:
- They tell you what the hook is able to touch. A hook with only
afterSwapcan observe swaps. A hook withafterSwapReturnDeltacan take tokens from them. - They are encoded in the hook's address. See Hook addresses.
One hook, one or many pools
A hook contract can serve any number of pools. On v4 chains almost every hook is deployed for a single pool, and many use beforeInitialize to stop strangers from attaching the hook to pools the owner did not approve.
What people build
Elysium mainnet is new, so its pools have not been scanned yet. On an established v4 chain (a scan of about 960,000 pools in October 2026):
- About a third of pools use a hook.
- 91% of pools with a hook use one that takes a fee on every swap.
- About two thirds of pools with a hook are dynamic-fee pools.
The recipes start from these.