FeyHookStaticFeeV2 on Base

Uniswap v4 Hook Contract 0x5b409184204b86f708d3aebb3cad3f02835f68cc on Base · Dynamic fee · Verified contract

Volume (24h)
$0
Value locked (TVL)
$9.66K
All-time volume
$23.93M
Pools using this hook
963
Swaps (24h)
0 (0 traders)
Total swaps
124,865

What it does

A Fey-branded Uniswap v4 hook that gives each pool fixed fey and paired-side swap fees (up to 10%) and takes a 20% share of those fees as a protocol fee routed to the Fey factory.

How it works step by step

  • Sets a fixed fey-side fee or paired-side fee per pool based on swap direction, capped at 10%
  • Takes a protocol fee equal to 20% of the LP fee via beforeSwap and afterSwap return deltas
  • Mints protocol fee claims to the hook and forwards accumulated fees to the factory on later swaps
  • Blocks liquidity adds while the pool's MEV module is active during the first two minutes
  • Optionally runs a pool extension after each non-locker swap in a try/catch
  • Triggers LP locker reward collection on swaps for pools that have a locker set
Swap behaviour
Each swap sets the LP fee based on direction relative to the fey token, claims any accrued protocol and locker fees, and takes the protocol fee through before-swap and after-swap return deltas. The MEV module may temporarily raise the fee in the first two minutes after pool creation.
Liquidity behaviour
Adding liquidity is blocked while the pool's MEV module is operational (first 2 minutes after creation). Removing liquidity has no hook callback.
Fee behaviour
Each pool has fixed fey and paired LP fees (capped at 10%, 100000 out of 1000000) set at initialization. Per swap, the fee applied depends on swap direction relative to the fey token. The protocol fee is 20% of the LP fee, taken from swap amounts and minted to the hook as ERC6909 balances, then forwarded to the factory on subsequent swaps.
Owner & admin controls
No owner or pause on the hook itself. The factory can set the base token once via setBaseToken and can update the factory address via bootstrapFactory while the bootstrapper (bs) is set; the bootstrapper can call releaseBootstrapper to freeze that. Fee rates feyFee and pairedFee are fixed per pool at initialization and cannot be changed afterward; the MEV module can only raise the LP fee for a limited window after pool creation (up to 80%) and is disabled after 2 minutes.

Enabled Uniswap v4 callbacks

beforeInitialize, beforeAddLiquidity, beforeSwap, afterSwap, beforeSwapReturnDelta, afterSwapReturnDelta

beforeInitialize reverts to force initialization through the factory-controlled paths; beforeAddLiquidity blocks adds during the MEV window; beforeSwap sets the dynamic LP fee, claims accrued protocol and locker fees, and takes the protocol fee via return delta; afterSwap adjusts the unspecified delta to collect the protocol fee on the output or input side and runs an optional pool extension; beforeSwapReturnDelta and afterSwapReturnDelta allow the hook to take a share of swap amounts.

Security & trust assessment

Risk level: medium (verified source, high confidence).

Who controls it: Limited. The factory controls pool creation, base token assignment and factory address updates until the bootstrapper releases control. The bootstrapper can point the factory to a new address before release. Pool fee rates are immutable after initialization, so a key cannot raise user fees on live pools; the MEV module can only raise fees for a short window and only within its own registration.

Risk to user funds: The hook does not custody user funds at rest. It takes a protocol fee from each swap through return deltas, up to the LP fee cap (10% plus MEV window up to 80%). It holds minted claims temporarily and forwards them to the factory. Liquidity adds are blocked during the MEV window, but liquidity removals are never blocked.

Security findings

  • [medium] Bootstrapper can redirect fee destination: bootstrapFactory lets the bootstrapper replace the factory address, and the factory receives all protocol fees via take, so a compromised bootstrapper key could redirect protocol fee revenue until releaseBootstrapper is called.
  • [medium] MEV module can impose up to 80% fee early: The MEV module can raise the LP fee up to 80% on a pool during the first 2 minutes after creation, so early swappers can pay very high fees if the module is misconfigured or malicious.
  • [low] Fee accrual depends on factory liveness: Protocol fees are minted as ERC6909 claims to the hook and taken to the factory on later swaps; if the factory is unset or the take fails, accumulated fees can be stuck until the next successful claim.
  • [low] External locker call on every swap: Swaps that trigger the locker fee claim call an external locker, which is a dependency that could revert and block swaps on that pool.
  • [info] Optional pool extension hook: Pool extension execution is wrapped in try/catch, so failures do not block swaps, but extensions run after each user swap with access to swap deltas.

Contract details

Verified source
Yes (FeyHookStaticFeeV2)
Compiler
solc 0.8.28+commit.7893614a
Bytecode size
13,122 bytes
Upgradeable proxy
No
Detected patterns
access-control, dynamic-fee, mev-protection, moves-currency, return-delta

Pools using FeyHookStaticFeeV2