Dynamic fee hook on Arc

Uniswap v4 Hook Contract 0xaa49adadd33c5e953b645567afb10cbbba63afc4 on Arc · Dynamic fee

Volume (24h)
$118
Value locked (TVL)
$594
All-time volume
$5.89K
Pools using this hook
1
Swaps (24h)
6 (2 traders)
Total swaps
96

What it does

An NFTX pool hook that charges a dynamic LP fee (default 1%, owner-adjustable up to 100%) plus an optional owner-set AMM fee on swap output, donates listing fees to LPs, and never restricts LP withdrawals.

This read was written for the hook 0xaa49…afc4 on Base and reused here: the two share a code shape, so constants such as fees, owners and addresses can differ.

How it works step by step

  • Runs the NFTX pools that pair NFT collection tokens against an ETH-equivalent token, with a fee set by the hook for each swap.
  • Charges a dynamic LP fee (default 1%) that the owner can change per pool or globally. Specific traders can be given lower-fee exemptions.
  • Optionally takes an extra protocol (AMM) fee from each swap's output and holds it in escrow for a beneficiary to withdraw.
  • Queues fees from NFTX listings and donates them to in-range LPs during later pool actions.
  • Records a manipulation-resistant price oracle (TWAP with a per-observation tick cap) and lets an external notifier veto swaps.
Swap behaviour
Before each swap the hook sets the LP fee, can let an owner-set notifier contract reject the swap, and blocks all swaps on pools whose collection has been retired. After the swap, if an AMM fee is configured, it takes that share of the unspecified (usually output) leg for the beneficiary.
Liquidity behaviour
Adding liquidity requires the pool to have been launched through the NFTX Locker. Add and remove callbacks only flush queued fee donations and emit state, and the code deliberately keeps withdrawals open even on retired pools, with no liquidity fee taken.
Fee behaviour
The LP fee defaults to 1% and goes to LPs. The owner can set it anywhere up to 100% using Uniswap's max-fee validation, and exemptions can only lower it. A separate AMM fee, also owner-set up to 100% of the unspecified swap leg, is escrowed for the AMM beneficiary; it is zero unless both the fee and the beneficiary are set.
Owner & admin controls
The owner can set the default and per-pool LP fees and the AMM fee, each up to 100% with no lower hard cap. The owner can also grant fee exemptions, change the AMM beneficiary, attach a notifier that can veto swaps, and tune oracle parameters; the Locker can register and retire collections, which stops swaps.

Enabled Uniswap v4 callbacks

beforeInitialize, beforeAddLiquidity, afterAddLiquidity, beforeRemoveLiquidity, afterRemoveLiquidity, beforeSwap, afterSwap, afterSwapReturnDelta

beforeInitialize: blocks anyone except the hook itself from creating pools; beforeAddLiquidity: requires an initialized pool and flushes queued donations; afterAddLiquidity: emits pool state; beforeRemoveLiquidity: flushes queued donations; afterRemoveLiquidity: emits pool state; beforeSwap: sets the dynamic fee, blocks retired pools, consults the notifier, and records the oracle; afterSwap and afterSwapReturnDelta: take the optional AMM fee from the swap output.

Security & trust assessment

Risk level: high, estimated (decoded bytecode, high confidence).

Who controls it: A single owner controls all swap fees (up to 100%), the AMM fee recipient, and a notifier that can veto swaps, while the Locker can permanently retire pools. None of them can block or tax LP withdrawals.

Risk to user funds: Traders can lose from 0% up to 100% of a swap's value to owner-set LP and AMM fees, with the AMM fee taken from the output leg and escrowed in the hook for the beneficiary. LP principal cannot be locked or drained, and withdrawals remain free.

Security findings

  • [high] Uncapped owner-set fees: setDefaultFee, setFee and setAmmFee only check that the value is at most the Uniswap maximum of 100%. The owner could therefore make swaps confiscatory through the LP fee and the AMM fee on the output leg.
  • [medium] Notifier can block swaps: An owner-chosen notifier contract is called on every swap and can revert it, effectively pausing or gating trading. It can also modify the resolved fee.
  • [info] Retired pools stop swapping: When the Locker retires a collection, swaps revert permanently, but adding and removing liquidity stays open.
  • [info] LP withdrawals unrestricted: The remove-liquidity callbacks only donate queued fees and emit events. There is no liquidity return delta, so LP principal cannot be taken.

Contract details

Verified source
No
Bytecode size
24,133 bytes
Upgradeable proxy
No
Detected patterns
donates, erc6909-claims, moves-currency, ownable, return-delta

Pools using Dynamic fee hook