Uniswap V4 introduces the concept of hooks, which allow developers to customize and extend the behavior of liquidity pools. A developer who wishes for Uniswap to route swap requests through their hook must open a PR to add their hook to Uniswap’s permitted list of hooks for routing (the allowlist). Additionally, certain hooks which hold pool liquidity in the hook rather than in the pool will not have their hooked pool TVL reported correctly without opening a PR to adjust their TVL. Not adjusting the TVL to be accurate can negatively impact routing for new hooks and hooks which require no pool TVL. This document explains how a developer can open PRs for either or both scenarios.

Allowlisting a New Hook

Prerequisites:

Steps:

  1. Clone the Uniswap routing-api repo
    1. git clone [git@github.com](<mailto:git@github.com>):Uniswap/routing-api.git
  2. Create a new branch including the name of your hook
  3. Add your hook address to lib/util/hooksAddressesAllowlist.ts
    1. Add a new const variable which includes the name of your hook and the chain on which it is deployed, populated with your hook address

      export const CLANKER_STATIC_FEE_HOOKS_ADDRESS_ON_BASE = '0xdd5eeaff7bd481ad55db083062b13a3cdf0a68cc'
      
    2. Add the hook variable to the corresponding HOOKS_ADDRESSES_ALLOWLIST under the correct chainId

        [ChainId.BASE]: [
          ADDRESS_ZERO,
          ...
          CLANKER_STATIC_FEE_HOOKS_ADDRESS_ON_BASE,
        ],
      
    3. Example PR: https://github.com/Uniswap/routing-api/pull/1146/files

  4. Commit and submit the PR
    1. In the PR comments, include a link to the Uniswap App page for the hooked pool which you have already deployed

Notes:

Updating TVL for Low- and 0-TVL Hooks

Prerequisites: