Repository navigation
Add VolatilePairHook hook on ethereum - #10548
Conversation
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_014fYw9QTMiuD2UhQD1AkQ9f
There was a problem hiding this comment.
Review: hooks/ethereum/0x000022ec4ebd6b12294396e852e4c3876b253cc0.json
Address Flags ✅
Lowest 14 bits of 0x...3cc0 = 0x3CC0 = 11 1100 1100 0000:
| Bit | Flag | Expected | File |
|---|---|---|---|
| 13 | beforeInitialize | true | true ✅ |
| 12 | afterInitialize | true | true ✅ |
| 11 | beforeAddLiquidity | true | true ✅ |
| 10 | afterAddLiquidity | true | true ✅ |
| 9 | beforeRemoveLiquidity | false | false ✅ |
| 8 | afterRemoveLiquidity | false | false ✅ |
| 7 | beforeSwap | true | true ✅ |
| 6 | afterSwap | true | true ✅ |
| 5 | beforeDonate | false | false ✅ |
| 4 | afterDonate | false | false ✅ |
| 3 | beforeSwapReturnsDelta | false | false ✅ |
| 2 | afterSwapReturnsDelta | false | false ✅ |
| 1 | afterAddLiquidityReturnsDelta | false | false ✅ |
| 0 | afterRemoveLiquidityReturnsDelta | false | false ✅ |
All flags are correct.
Proxy / Source Verification ⚠️
source_meta.json confirms this hook address is an ERC1967Proxy with:
verified: true(the proxy contract itself is verified)implementation: 0x1ddbf7215be4f8a7623b9b1b0255c6e1e3f6c000
The .sources/ directory contains only the proxy contract (ERC1967Proxy + ERC1967Utils). The implementation contract source code is not present. This means the actual hook logic — the beforeSwap, afterSwap, beforeInitialize, afterInitialize, beforeAddLiquidity, afterAddLiquidity callbacks — cannot be inspected.
Properties — Cannot Verify ❌
Because the implementation source is unavailable, the following cannot be confirmed:
dynamicFee: true— The description claims fees are dynamically adjusted based on recent price moves, but this cannot be verified without reading the implementation'sbeforeSwap/afterSwaplogic or anyupdateDynamicLPFee()calls.requiresCustomSwapData: false— Cannot verify whetherhookDatais optional or required.vanillaSwap: false— Correctly set tofalsegivendynamicFee: true, but the underlying claim (dynamicFee: true) is itself unverified.swapAccess: "none"— Cannot verify whetherbeforeSwapcontains access control.
upgradeable: true ✅
Confirmed: the hook is an ERC1967Proxy, which delegates all calls to a mutable implementation address stored in an EIP-1967 slot. This is a standard upgradeable proxy pattern.
Metadata
chainId: 1— Correct for Ethereum.verifiedSource: true— The proxy source is verified. Whether the implementation is separately verified on Etherscan is unknown (it was not resolved into.sources/).name: "VolatilePairHook"— The verified contract name isERC1967Proxy; "VolatilePairHook" presumably refers to the implementation. This cannot be confirmed without implementation source.description— Makes specific technical claims (dynamic fee, fee direction based on price volatility, LP value capture) that cannot be substantiated without the implementation source.
Required Action
The implementation contract at 0x1ddbf7215be4f8a7623b9b1b0255c6e1e3f6c000 must have verified source available before this entry can be approved. Without it, the properties fields and description cannot be cross-referenced against on-chain logic.
There was a problem hiding this comment.
Review: hooks/ethereum/0x000022ec4ebd6b12294396e852e4c3876b253cc0.json
Address Flags
Address 0x000022ec4ebd6b12294396e852e4c3876b253cc0 — last 14 bits of 0x3cc0:
| Bit | Flag | JSON | Correct? |
|---|---|---|---|
| 13 | beforeInitialize | true | ✓ |
| 12 | afterInitialize | true | ✓ |
| 11 | beforeAddLiquidity | true | ✓ |
| 10 | afterAddLiquidity | true | ✓ |
| 9 | beforeRemoveLiquidity | false | ✓ |
| 8 | afterRemoveLiquidity | false | ✓ |
| 7 | beforeSwap | true | ✓ |
| 6 | afterSwap | true | ✓ |
| 5–0 | (donate, delta flags) | all false | ✓ |
Confirmed by BaseDynamicFeeHook.getHookPermissions() which returns the identical permission set.
Properties
- dynamicFee: true —
_beforeSwapreturnsfeeE6 | LPFeeLibrary.OVERRIDE_FEE_FLAGas its third return value, overriding the LP fee on every swap. ✓ - upgradeable: true — Inherits
BaseUUPSHook→UUPSUpgradeable._authorizeUpgradeis gated byonlyRole(DEFAULT_ADMIN_ROLE).source_meta.jsonconfirms"proxy": true. ✓ - requiresCustomSwapData: false —
_beforeSwaphas abytes calldatahookData parameter that is entirely unused; the fee is computed purely from on-chain state. ✓ - vanillaSwap: false — Correct;
dynamicFeeis true, sovanillaSwapmust be false. ✓ - swapAccess: "none" —
_beforeSwapperforms no access control; it computes and returns a fee override without any gating logic. ✓
Metadata
- name: "VolatilePairHook" — matches
contractNameinsource_meta.jsonand the contract's own declaration. ✓ - chainId: 1 — correct for
ethereum. ✓ - verifiedSource: true — confirmed by
source_meta.json. ✓ - description — accurately describes the on-chain logic: dynamic fees, bid/ask direction differentiation, price-move-based fee adjustment. No audit claims, safety guarantees, or promotional language. ✓
All fields verified against on-chain source. No issues found.
Requested by Christian Angelopoulos · Slack thread
Before: The hooklist has no entry for the VolatilePair hook that Uniswap Labs deployed on Ethereum at
0x000022Ec4eBD6b12294396E852E4C3876b253Cc0.After: The hook is registered under
hooks/ethereum/, with the same shape as its sibling, the StablePair hook (0x0000113d…bfcC0).How: one new file, copied field for field from the Ethereum StablePair entry, with the address, name and description changed. The flags come from the address bits (
0x3CC0). Checked on-chain: the hook is an ERC1967 proxy whose bytecode is identical to StablePair's proxy. Its implementation (0x1DDbf7215be4F8A7623B9B1B0255C6e1E3F6c000, set by theUpgradedevent in the deploy tx) returns the same 14 flags fromgetHookPermissions()when its deployed bytecode is executed locally. The deploy tx0x85a82d5d…5363was sent by0xe49acc3b…5b95(the same deployer as StablePair) through the CREATE2 factory.scripts/validate.pyandscripts/verify_flags.pypass locally.Sibling PR: Uniswap/universe#43014 adds the same hook to the dev portal's Uniswap Labs Hooks docs and deployments explorer.
Note
Implementation verified. The hook team verified the implementation
0x1DDbf7215be4F8A7623B9B1B0255C6e1E3F6c000on Etherscan. On re-run, the Review Hook PR workflow fetched theVolatilePairHooksource and approved: every flag, property and metadata field matches the source. No JSON changes were needed.Summary
VolatilePair is a Uniswap v4 dynamic-fee hook built for assets without a fixed reference price. Instead of charging a flat fee on every swap, it uses recent price moves to set fees by trade direction, capturing more value for LPs while keeping the quoted spread competitive.
Flags
Properties
_beforeSwapreturnsfeeE6 | LPFeeLibrary.OVERRIDE_FEE_FLAG, overriding the LP fee on every swap (confirmed from source)BaseUUPSHook→UUPSUpgradeable, with_authorizeUpgradegated byDEFAULT_ADMIN_ROLEhookDatais unused in_beforeSwap; the fee comes from on-chain state only (confirmed from source)dynamicFee: true_beforeSwaphas no access control (confirmed from source)Warnings
auditUrlis empty, as it is for StablePair.🤖 Generated with Claude Code
https://claude.ai/code/session_014fYw9QTMiuD2UhQD1AkQ9f