LiquidHookDynamicFeeV2 on Base

Uniswap v4 Hook Contract 0x80e2f7dc8c2c880bbc4bdf80a5fb0eb8b1db68cc on Base · MEV protection · Verified contract

Volume (24h)
$291
Value locked (TVL)
$32.07K
All-time volume
$26.82M
Pools using this hook
1,835
Swaps (24h)
34 (10 traders)
Total swaps
102,335

What it does

A Uniswap v4 hook that appears to apply MEV-protection logic to pools, adjusting swap fees and optionally taking part of swap amounts, with an admin-configurable MEV module.

How it works step by step

  • Initializes pools and records per-pool configuration, fee and MEV module state on initialization.
  • Sets a dynamic LP fee on swaps in beforeSwap, bounded by MIN_BASE_FEE and MAX_MEV_LP_FEE constants.
  • Uses return-delta hooks to take or redirect a portion of swap amounts.
  • Gates or inspects liquidity additions via beforeAddLiquidity based on MEV module state.
  • Exposes a simulateSwap view-style function for quoting swap outcomes.
  • Supports an optional pool extension helper and allowlist for external logic.
Swap behaviour
beforeSwap and afterSwap run MEV-module logic: beforeSwap computes and sets a dynamic LP fee and beforeSwapReturnDelta/afterSwapReturnDelta can adjust the swap amounts, while afterSwap runs post-swap extension processing.
Liquidity behaviour
beforeAddLiquidity is implemented and may check or gate liquidity additions based on the MEV module state (slots 4 and 5 read); beforeRemoveLiquidity and afterAddLiquidity/afterRemoveLiquidity selectors exist as view-only dispatch entries. Exact gating logic is not confirmed.
Fee behaviour
Pool fees are read from per-pool mappings (slots 8 and 9, via poolFeeVars and poolConfigVars) in beforeSwap, and mevModuleSetFee writes a fee value; the hook appears to apply a dynamic MEV-related LP fee bounded by MAX_MEV_LP_FEE, MIN_BASE_FEE and a protocol fee numerator, but exact formulas are not determinable from the bytecode.
Owner & admin controls
Storage slot 0 (uint24) is written by beforeSwap and mevModuleSetFee, and slot 4 flags are written by mevModuleSetFee and initializeMevModule, suggesting a privileged role can set MEV module fee and enable or operate the module per pool. Access control mechanics could not be confirmed without source.

Enabled Uniswap v4 callbacks

beforeInitialize, beforeAddLiquidity, beforeSwap, afterSwap, beforeSwapReturnDelta, afterSwapReturnDelta

beforeInitialize and afterInitialize are used to register pool configuration and MEV module state; beforeAddLiquidity gates or inspects liquidity additions; beforeSwap sets the dynamic LP fee for an MEV-protected swap; afterSwap runs post-swap processing and extension logic; beforeSwapReturnDelta and afterSwapReturnDelta allow the hook to take or redirect a token amount delta during swaps.

Security & trust assessment

Risk level: medium (decoded bytecode, low confidence).

Who controls it: A privileged key that can call mevModuleSetFee and initializeMevModule may alter fees on pools and control whether the MEV module is operational; the ability to change the fee could impose high swap costs on traders.

Risk to user funds: The hook can take or redirect token amounts through return deltas during swaps and can alter LP fees, so user swap proceeds and LP balances can be affected; it is not verified whether it can block swaps or hold funds beyond transient amounts.

Security findings

  • [medium] Return delta permissions enable swap-level token extraction: The hook enables beforeSwapReturnDelta and afterSwapReturnDelta, so it can take a token amount from swaps and affect the amounts users receive or pay.
  • [medium] Fee and module setters may be privileged: Selectors mevModuleSetFee and initializeMevModule write fee and enable state; without source, it is unknown whether these are restricted to an owner or role, so a single key could change fees.
  • [info] External extension calls expand trust surface: Selectors for an external pool extension helper (_runPoolExtensionHelper, poolExtension, poolExtensionAllowlist, poolExtensionSetup) indicate calls to other contracts that could alter swap behaviour if those contracts are upgradeable or privileged.
  • [info] Public simulation function present: The contract includes a simulateSwap entry point, which is a neutral utility for quoting.

Contract details

Verified source
Yes (LiquidHookDynamicFeeV2)
Compiler
solc 0.8.28+commit.7893614a
Bytecode size
20,341 bytes
Upgradeable proxy
No
Detected patterns
access-control, dynamic-fee, mev-protection, return-delta

Pools using LiquidHookDynamicFeeV2