Skip to content

Add PriceImpactDynamicFeeHook hook on ethereum#1088

Merged
Ponx merged 1 commit into
mainfrom
hooks/ethereum/0x3a9f9e9fcb1377de2c2f88ea0d8166e92bbf60c0
Jul 16, 2026
Merged

Add PriceImpactDynamicFeeHook hook on ethereum#1088
Ponx merged 1 commit into
mainfrom
hooks/ethereum/0x3a9f9e9fcb1377de2c2f88ea0d8166e92bbf60c0

Conversation

@hooklist-generator

Copy link
Copy Markdown
Contributor

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

Flag Value
beforeInitialize true
afterInitialize false
beforeAddLiquidity false
afterAddLiquidity false
beforeRemoveLiquidity false
afterRemoveLiquidity false
beforeSwap true
afterSwap true
beforeDonate false
afterDonate false
beforeSwapReturnsDelta false
afterSwapReturnsDelta false
afterAddLiquidityReturnsDelta false
afterRemoveLiquidityReturnsDelta false

Properties

Property Value
dynamicFee true
upgradeable false
requiresCustomSwapData false
vanillaSwap false
swapAccess none

Warnings

  • Submitter did not provide a description. Using AI-generated description.

Closes #1083

@vercel

vercel Bot commented Jul 16, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
hooklist Ready Ready Preview, Comment Jul 16, 2026 2:39pm

Request Review

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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: beforeSwap returns lpFee | 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. poolManager and allowedPoolId are immutable. ✓
  • requiresCustomSwapData = false: hookData is only inspected in afterSwap for an optional owner crank-reset (if (hookData.length >= 32 && abi.decode(hookData, (bool)) && feeCranked)). Normal swaps work correctly with empty hookData. ✓
  • vanillaSwap = false: Correct — dynamicFee is true; the hook actively overrides LP fees, changing swap behavior. ✓
  • swapAccess = "none": beforeSwap does not block any caller from swapping. The tx.origin == ownerWallet check only determines which fee tier applies (0% vs base/cap), not whether the swap is permitted. Pool-pinning in beforeInitialize is 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), beforeSwap LP fee override mechanism, tx.origin owner 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
Ponx merged commit f4971e9 into main Jul 16, 2026
7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

hook: PriceImpactDynamicFeeHook on Ethereum

1 participant