Skip to main content

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.

CallbackRuns
beforeInitialize / afterInitializeWhen a pool is created
beforeAddLiquidity / afterAddLiquidityWhen liquidity is added
beforeRemoveLiquidity / afterRemoveLiquidityWhen liquidity is removed
beforeSwap / afterSwapOn every swap
beforeDonate / afterDonateWhen 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:

PermissionLets the hook
beforeSwapReturnDeltaTake or give tokens before the swap is priced
afterSwapReturnDeltaTake or give tokens after the swap, for example to charge a fee
afterAddLiquidityReturnDeltaAdjust what a liquidity provider owes when adding
afterRemoveLiquidityReturnDeltaAdjust what a liquidity provider receives when removing

The hook card in the app lists the permissions each hook uses. They matter for two reasons:

  1. They tell you what the hook is able to touch. A hook with only afterSwap can observe swaps. A hook with afterSwapReturnDelta can take tokens from them.
  2. 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 Robinhood Chain 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​

From a scan of all Uniswap V4 pools on Robinhood Chain in October 2026 (about 960,000 pools):

  • 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.