Reference
Hook permissions
All 14 Uniswap v4 callbacks, their bit, and what to watch for.
Bit numbers count from the least significant bit of the hook address.
| Callback | Bit | Meaning | Watch for |
|---|---|---|---|
| beforeInitialize | 13 | Runs before the pool's starting price is set. | Can refuse to open the pool or check who opens it. |
| afterInitialize | 12 | Runs once the pool exists. | Usually records the opening block or stores per-pool settings. |
| beforeAddLiquidity | 11 | Runs before anyone adds liquidity. | Can restrict who provides liquidity or in which range. |
| afterAddLiquidity | 10 | Runs after liquidity is added. | Often used to track LP positions for rewards. |
| beforeRemoveLiquidity | 9 | Runs before anyone removes liquidity. | Can delay or block LP exits. Read the unlock terms. |
| afterRemoveLiquidity | 8 | Runs after liquidity is removed. | Settles rewards or exit fees for the leaving LP. |
| beforeSwap | 7 | Runs before every swap, can override the LP fee. | Fees can change per trade. Check the fee range. |
| afterSwap | 6 | Runs after every swap with the final amounts. | Reacts to trades: burns, pots, reward accounting. |
| beforeDonate | 5 | Runs before a donation to in-range LPs. | Can gate who may donate to the pool. |
| afterDonate | 4 | Runs after a donation. | Bookkeeping for donated rewards. |
| beforeSwapReturnDelta | 3 | Lets beforeSwap take or give tokens itself. | The hook can change what you pay in. Read every rule that uses it. |
| afterSwapReturnDelta | 2 | Lets afterSwap take a cut of the output. | The hook can change what you receive. Taxes and burns live here. |
| afterAddLiquidityReturnDelta | 1 | Lets the hook adjust an LP deposit. | Deposit fees or rebates on adding liquidity. |
| afterRemoveLiquidityReturnDelta | 0 | Lets the hook adjust an LP withdrawal. | Exit fees on removing liquidity. |