Custom pricing hook on HyperEVM

Uniswap v4 Hook Contract 0xd217127eca5ae3b21cdc6c5a2407f8c56c1960cc on HyperEVM · Custom pricing

Volume (24h)
$6.39
Value locked (TVL)
$0
All-time volume
$6.39
Pools using this hook
1
Swaps (24h)
6 (2 traders)
Total swaps
6

What it does

This hook applies a per-pool tax on swaps that is taken through return deltas and tracks amounts owed to addresses, but the exact tax direction and which trades pay more cannot be confirmed from decoded bytecode alone.

How it works step by step

  • Registers pools at initialization and maps each pool to a tax rate and position record in storage
  • Applies a per-token tax on swaps by taking a share of the swap amount through beforeSwap and afterSwap return deltas
  • Tracks owed amounts per address and lets holders claim them via claim(address)
  • Uses a self-unlock flow (unlock and unlockCallback) to move currency through the pool manager with take and withdraw
  • Exposes view functions for pool keys, pool ids, tax rates, owed balances and position records
  • Caps tax and LP fee with MAX_TAX_BPS and MAX_LP_FEE constants
Swap behaviour
On beforeSwap the hook can take a tax from the swap via return deltas and records state per pool; afterSwap updates owed balances and storage. Which trades pay more or less cannot be determined from decoded bytecode alone.
Liquidity behaviour
No liquidity callbacks.
Fee behaviour
A tax in basis points is stored per pool (taxOf) and bounded by MAX_TAX_BPS; the hook takes this tax as a currency delta rather than only relying on the static pool fee. The exact tax direction and recipient cannot be confirmed without source.
Owner & admin controls
No admin controls found in the decoded functions. No owner, pause or upgrade selectors were identified, but absence of such selectors in decoded bytecode is not proof of immutability.

Enabled Uniswap v4 callbacks

beforeInitialize, beforeSwap, afterSwap, beforeSwapReturnDelta, afterSwapReturnDelta

beforeInitialize registers pool state at pool creation. beforeSwap can set a return delta to take tax before the swap executes. afterSwap updates accounting and can apply a return delta after the swap. beforeSwapReturnDelta and afterSwapReturnDelta allow these deltas to alter the amounts traders receive.

Security & trust assessment

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

Who controls it: If a privileged key controls the tax setter or the position logic, it could raise tax up to the cap on pools it covers, though no such setter was positively identified.

Risk to user funds: The hook can take currency via return deltas on swaps and can move pool currency through unlock, take and withdraw, so user and pool funds are exposed to the hook's accounting logic.

Security findings

  • [medium] Return-delta tax on swaps: Return delta permissions let the hook take currency from every swap, so the hook can alter amounts received by traders and must be trusted for correct accounting.
  • [medium] Currency movement via self-unlock: The hook unlocks the pool manager and calls take and withdraw, so it can move pool funds to addresses it selects; the recipient logic is not verifiable from decoded bytecode.
  • [info] Tax parameters stored per pool: Tax is stored in a mapping keyed by pool and bounded by MAX_TAX_BPS, which limits the maximum tax but the setter's access control could not be confirmed.
  • [info] No verified source: Without verified source, function semantics and access restrictions on claim and position writes are inferred from selectors and storage only.

Contract details

Verified source
No
Bytecode size
10,385 bytes
Upgradeable proxy
No
Detected patterns
erc20, moves-currency, return-delta, self-unlock, tax

Pools using Custom pricing hook