Add PriceImpactDynamicFeeHook hook on ethereum#1088
Merged
Ponx merged 1 commit intoJul 16, 2026
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Contributor
There was a problem hiding this comment.
Review: hooks/ethereum/0x3a9f9e9fcb1377de2c2f88ea0d8166e92bbf60c0.json
Flags
Address 0x3a9f9e9fcb1377de2c2f88ea0d8166e92bbf60c0 — lowest 14 bits are 0x20C0 (0x60C0 & 0x3FFF):
| Bit | Flag | Address | JSON |
|---|---|---|---|
| 13 | beforeInitialize | 1 | true ✓ |
| 12 | afterInitialize | 0 | false ✓ |
| 11–8 | addLiquidity/removeLiquidity | 0 | false ✓ |
| 7 | beforeSwap | 1 | true ✓ |
| 6 | afterSwap | 1 | true ✓ |
| 5–0 | donate/returnsDelta | 0 | false ✓ |
Confirmed by getHookPermissions() in source, which the constructor validates via Hooks.validateHookPermissions().
Properties
- dynamicFee = true:
beforeSwapreturnslpFee | LPFeeLibrary.OVERRIDE_FEE_FLAG— a direct LP fee override applied per swap (0% for owner, baseFeePpm 2% or feeCapPpm 10% for others). ✓ - upgradeable = false: No proxy pattern, no
delegatecall, no mutable implementation pointer.poolManagerandallowedPoolIdare immutable. ✓ - requiresCustomSwapData = false:
hookDatais only inspected inafterSwapfor an optional owner crank-reset (if (hookData.length >= 32 && abi.decode(hookData, (bool)) && feeCranked)). Normal swaps work correctly with empty hookData. ✓ - vanillaSwap = false: Correct —
dynamicFeeis true; the hook actively overrides LP fees, changing swap behavior. ✓ - swapAccess = "none":
beforeSwapdoes not block any caller from swapping. Thetx.origin == ownerWalletcheck only determines which fee tier applies (0% vs base/cap), not whether the swap is permitted. Pool-pinning inbeforeInitializeis initialization-time gating, not swap access control. ✓
Metadata
- verifiedSource = true: Confirmed by
source_meta.json. ✓ - chainId = 1: Ethereum mainnet — correct for chain
ethereum. ✓ - name = "PriceImpactDynamicFeeHook": Exact contract name from source. ✓
- description: Accurately describes the 2-state crank (DOWN/ON), pool-pinning via
allowedPoolId, default fees (2% base, 10% cap),beforeSwapLP fee override mechanism,tx.originowner exemption at 0%, and optional hookData reset. All claims are directly substantiated by the Solidity logic. No marketing, audit, or safety guarantee language. ✓
All fields verified against on-chain source. No issues found.
Ponx
approved these changes
Jul 16, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
A 2-state dynamic fee hook pinned to a single pool. In the DOWN state, non-owner swaps pay a base LP fee (default 2%); if a swap moves the sqrtPrice beyond a configurable threshold, the crank flips ON and subsequent non-owner swaps pay a fee cap (default 10%). Fee is applied as a beforeSwap LP fee override; the owner (tx.origin) pays 0% and can reset the crank via hookData.
Flags
Properties
Warnings
Closes #1083