{
  "$schema": "https://degreesofsatoshi.com/encyclopedia/schemas/article-v1.json",
  "schemaVersion": "1.0.0",
  "id": "uniswap-v4-hooks",
  "canonical": "https://degreesofsatoshi.com/encyclopedia/uniswap-v4-hooks/",
  "collection": "defi",
  "title": "Uniswap v4 hooks: custom pool behavior and extra dependencies",
  "description": "Understand optional Uniswap v4 hook contracts, their permissions and why a pool’s custom behavior must be examined alongside the core protocol.",
  "aliases": [],
  "dates": {
    "published": "2026-10-02",
    "modified": "2026-10-02",
    "verified": "2026-10-02T18:19:48.887Z",
    "dataAsOf": "2026-10-02"
  },
  "authorship": {
    "publisher": "Degrees of Satoshi editorial project",
    "process": "AI-assisted research and drafting with a separate automated source-verification pass; no external expert or named human review is implied."
  },
  "quickAnswer": {
    "text": "A Uniswap v4 hook is an optional external contract that customizes a pool at specified operation boundaries, such as before or after a swap or liquidity change. The hook address forms part of the pool’s identity. Its code and permissions can change the experience and risks of that particular pool, so the v4 label alone does not describe the complete behavior.",
    "claimId": "uniswap-v4-hooks-quick-answer",
    "sourceIds": [
      "uniswap-v4-hooks"
    ]
  },
  "keyFacts": [
    {
      "label": "Optional",
      "value": "A v4 pool can operate without an attached hook.",
      "sourceIds": [
        "uniswap-v4-hooks"
      ],
      "id": "optional",
      "claimId": "uniswap-v4-hooks-fact-optional"
    },
    {
      "label": "Permissions",
      "value": "Hook address bits identify which callbacks the PoolManager invokes.",
      "sourceIds": [
        "uniswap-v4-hooks"
      ],
      "id": "permissions",
      "claimId": "uniswap-v4-hooks-fact-permissions"
    },
    {
      "label": "Pool identity",
      "value": "A pool’s hook is specified at creation and cannot simply be replaced in that pool’s key.",
      "sourceIds": [
        "uniswap-v4-hooks"
      ],
      "id": "pool-identity",
      "claimId": "uniswap-v4-hooks-fact-pool-identity"
    }
  ],
  "prerequisites": [
    "uniswap-v2-vs-v3"
  ],
  "sections": [
    {
      "id": "callbacks",
      "heading": "Custom logic runs at defined points",
      "sourceIds": [
        "uniswap-v4-hooks"
      ],
      "paragraphs": [
        "The documented callbacks cover initialization, adding or removing liquidity, swaps and donations. A developer selects the callbacks the contract implements; a hook need not implement all of them.",
        "For example, a hypothetical hook could check eligibility before adding liquidity. A wallet holding the right tokens would still need to satisfy that pool’s additional rule."
      ]
    },
    {
      "id": "identity",
      "heading": "The same token pair can have different behavior",
      "sourceIds": [
        "uniswap-v4-hooks"
      ],
      "paragraphs": [
        "Two pools for the same assets can use different hooks. One might apply custom fee logic, while another uses no hook. Comparing only the asset symbols would miss that distinction.",
        "Record the pool key and hook address when assessing a route. The documentation states that changing the attached hook requires a different pool, although the attached contract’s own code and administrative design still need inspection."
      ]
    },
    {
      "id": "review",
      "heading": "Core mechanics do not establish every hook’s properties",
      "sourceIds": [
        "uniswap-v4-hooks"
      ],
      "paragraphs": [
        "Hook permissions tell you which execution points are enabled, not whether the custom logic is sound. Inspect restrictions, balance adjustments, external dependencies and any authority within the hook’s design.",
        "A hook can introduce useful behavior, but its presence does not guarantee routing, liquidity or better returns. Evaluate the actual pool that will receive the transaction."
      ]
    }
  ],
  "faq": [
    {
      "question": "Can someone add a hook to a pool that already has none?",
      "answer": "The documented v4 design fixes the hook in the PoolKey at initialization. Adding or replacing that attachment requires creating a different pool with the desired key.",
      "sourceIds": [
        "uniswap-v4-hooks"
      ]
    }
  ],
  "claims": [
    {
      "id": "uniswap-v4-hooks-quick-answer",
      "articleSlug": "uniswap-v4-hooks",
      "statement": "A Uniswap v4 hook is an optional external contract that customizes a pool at specified operation boundaries, such as before or after a swap or liquidity change. The hook address forms part of the pool’s identity. Its code and permissions can change the experience and risks of that particular pool, so the v4 label alone does not describe the complete behavior.",
      "sourceIds": [
        "source-dc5d5dd3b089171c"
      ],
      "sourceLocators": [
        {
          "sourceId": "source-dc5d5dd3b089171c",
          "locator": "Core Hook Functions; Hook lifecycle"
        }
      ],
      "scope": {
        "collection": "defi",
        "dataAsOf": "2026-10-02",
        "blockHeight": null
      },
      "qualification": "",
      "evidenceStatus": "documented",
      "verification": {
        "status": "verified",
        "method": "independent automated source review",
        "checkedAt": "2026-10-02T18:19:48.887Z",
        "reviewer": "automated independent verification — Codex root, separate from final-ten DeFi author",
        "notes": [
          "Read fresh Uniswap v4 Hooks primary documentation: optional pool-specific attachment, encoded callback permissions, immutable PoolKey attachment, before/after operations and custom restrictions. Hypothetical examples clearly distinguished from deployed guarantees."
        ]
      }
    },
    {
      "id": "uniswap-v4-hooks-fact-optional",
      "articleSlug": "uniswap-v4-hooks",
      "statement": "Optional: A v4 pool can operate without an attached hook.",
      "sourceIds": [
        "source-dc5d5dd3b089171c"
      ],
      "sourceLocators": [
        {
          "sourceId": "source-dc5d5dd3b089171c",
          "locator": "Core Hook Functions; Hook lifecycle"
        }
      ],
      "scope": {
        "collection": "defi",
        "dataAsOf": "2026-10-02",
        "blockHeight": null
      },
      "qualification": "",
      "evidenceStatus": "documented",
      "verification": {
        "status": "verified",
        "method": "independent automated source review",
        "checkedAt": "2026-10-02T18:19:48.887Z",
        "reviewer": "automated independent verification — Codex root, separate from final-ten DeFi author",
        "notes": [
          "Read fresh Uniswap v4 Hooks primary documentation: optional pool-specific attachment, encoded callback permissions, immutable PoolKey attachment, before/after operations and custom restrictions. Hypothetical examples clearly distinguished from deployed guarantees."
        ]
      }
    },
    {
      "id": "uniswap-v4-hooks-fact-permissions",
      "articleSlug": "uniswap-v4-hooks",
      "statement": "Permissions: Hook address bits identify which callbacks the PoolManager invokes.",
      "sourceIds": [
        "source-dc5d5dd3b089171c"
      ],
      "sourceLocators": [
        {
          "sourceId": "source-dc5d5dd3b089171c",
          "locator": "Core Hook Functions; Hook lifecycle"
        }
      ],
      "scope": {
        "collection": "defi",
        "dataAsOf": "2026-10-02",
        "blockHeight": null
      },
      "qualification": "",
      "evidenceStatus": "documented",
      "verification": {
        "status": "verified",
        "method": "independent automated source review",
        "checkedAt": "2026-10-02T18:19:48.887Z",
        "reviewer": "automated independent verification — Codex root, separate from final-ten DeFi author",
        "notes": [
          "Read fresh Uniswap v4 Hooks primary documentation: optional pool-specific attachment, encoded callback permissions, immutable PoolKey attachment, before/after operations and custom restrictions. Hypothetical examples clearly distinguished from deployed guarantees."
        ]
      }
    },
    {
      "id": "uniswap-v4-hooks-fact-pool-identity",
      "articleSlug": "uniswap-v4-hooks",
      "statement": "Pool identity: A pool’s hook is specified at creation and cannot simply be replaced in that pool’s key.",
      "sourceIds": [
        "source-dc5d5dd3b089171c"
      ],
      "sourceLocators": [
        {
          "sourceId": "source-dc5d5dd3b089171c",
          "locator": "Core Hook Functions; Hook lifecycle"
        }
      ],
      "scope": {
        "collection": "defi",
        "dataAsOf": "2026-10-02",
        "blockHeight": null
      },
      "qualification": "",
      "evidenceStatus": "documented",
      "verification": {
        "status": "verified",
        "method": "independent automated source review",
        "checkedAt": "2026-10-02T18:19:48.887Z",
        "reviewer": "automated independent verification — Codex root, separate from final-ten DeFi author",
        "notes": [
          "Read fresh Uniswap v4 Hooks primary documentation: optional pool-specific attachment, encoded callback permissions, immutable PoolKey attachment, before/after operations and custom restrictions. Hypothetical examples clearly distinguished from deployed guarantees."
        ]
      }
    }
  ],
  "sources": [
    {
      "id": "uniswap-v4-hooks",
      "label": "Uniswap v4 Hooks",
      "publisher": "Uniswap",
      "url": "https://docs.uniswap.org/contracts/v4/concepts/hooks",
      "locator": "Core Hook Functions; Hook lifecycle",
      "note": "Hooks execute custom logic at pool operation boundaries.",
      "version": "Uniswap v4 documentation",
      "checkedAt": "2026-10-02T17:03:45.793Z",
      "contentSha256": "5eb85303942c793df3be1b9acc59c502b13c0a45c0f840bf0beb7d3b3319e33e",
      "recordId": "source-dc5d5dd3b089171c"
    }
  ],
  "related": {
    "articles": [
      "concentrated-liquidity",
      "swap-routing-and-aggregators",
      "fee-on-transfer-tokens"
    ],
    "dossiers": [],
    "wallets": []
  },
  "revisionHistory": [
    {
      "date": "2026-10-02",
      "kind": "published",
      "summary": "First publication after primary-source research and independent automated verification."
    }
  ],
  "citation": "Degrees of Satoshi editorial project. “Uniswap v4 hooks: custom pool behavior and extra dependencies.” Published 2026-10-02; updated 2026-10-02. https://degreesofsatoshi.com/encyclopedia/uniswap-v4-hooks/"
}
