Rule Craft
DocsHook permissionsMenu

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.

CallbackBitMeaningWatch for
beforeInitialize13Runs before the pool's starting price is set.Can refuse to open the pool or check who opens it.
afterInitialize12Runs once the pool exists.Usually records the opening block or stores per-pool settings.
beforeAddLiquidity11Runs before anyone adds liquidity.Can restrict who provides liquidity or in which range.
afterAddLiquidity10Runs after liquidity is added.Often used to track LP positions for rewards.
beforeRemoveLiquidity9Runs before anyone removes liquidity.Can delay or block LP exits. Read the unlock terms.
afterRemoveLiquidity8Runs after liquidity is removed.Settles rewards or exit fees for the leaving LP.
beforeSwap7Runs before every swap, can override the LP fee.Fees can change per trade. Check the fee range.
afterSwap6Runs after every swap with the final amounts.Reacts to trades: burns, pots, reward accounting.
beforeDonate5Runs before a donation to in-range LPs.Can gate who may donate to the pool.
afterDonate4Runs after a donation.Bookkeeping for donated rewards.
beforeSwapReturnDelta3Lets beforeSwap take or give tokens itself.The hook can change what you pay in. Read every rule that uses it.
afterSwapReturnDelta2Lets afterSwap take a cut of the output.The hook can change what you receive. Taxes and burns live here.
afterAddLiquidityReturnDelta1Lets the hook adjust an LP deposit.Deposit fees or rebates on adding liquidity.
afterRemoveLiquidityReturnDelta0Lets the hook adjust an LP withdrawal.Exit fees on removing liquidity.