Custom pricing hook on Avalanche

Uniswap v4 Hook Contract 0x5aeae090351d0ea6a6597c9fb03dc6d1a32c00c0 on Avalanche · Custom pricing

Volume (24h)
$0
Value locked (TVL)
<$0.01
All-time volume
$290
Pools using this hook
1
Swaps (24h)
0 (0 traders)
Total swaps
32

What it does

A Uniswap v4 hook on Avalanche that manages USDC reserves and hedges swap exposure after trades, with owner-controlled pausing and fee settings.

How it works step by step

  • Gates swaps with an owner-controlled swapsEnabled flag checked in beforeSwap.
  • Tracks a USDC reserve balance that can be deposited and withdrawn by owner or executor.
  • Calls an external hedge function after swaps to rebalance exposure.
  • Exposes owner-settable fee (uint24) and tick (int24) parameters.
  • Hooks liquidity add and remove callbacks, including before and after variants.
  • Uses an executor role for privileged reserve and parameter operations.
Swap behaviour
beforeSwap checks whether swaps are enabled and reads pool state; afterSwap updates internal reserve state and calls an external hedge function.
Liquidity behaviour
beforeAddLiquidity and beforeRemoveLiquidity and afterAddLiquidity and afterRemoveLiquidity selectors are present, suggesting liquidity callbacks are handled; the hook also tracks USDC reserves via depositReserve, withdrawReserve and withdrawAllReserve, and reads a reserve balance in slot 3.
Fee behaviour
The hook references a V4 pool fee and a uint24 fee value (slot 1 offset 23) that the owner or executor can set; the exact fee logic cannot be fully determined from decoded bytecode, but the hook appears to override or manage the pool fee rather than use only the static fee.
Owner & admin controls
Owner (slot 0) can transfer ownership (transferOwnership), set the executor address (setExecutor, slot 1), toggle swaps on or off (setSwapsEnabled, slot 1 bit 26), change the fee setting via the uint24 setter (0x1a7fbad6) and the int24 tick setter (0x5a50ba9a), and withdraw reserves (withdrawReserve, withdrawAllReserve). Executor-restricted functions include depositReserve and the 0x8e5c0c39 setter. Admin is a single EOA-style owner key with no evident timelock.

Enabled Uniswap v4 callbacks

beforeSwap, afterSwap

beforeSwap: gates swaps and reads swapsEnabled and pool state before a swap. afterSwap: updates the hook's internal state (slot 2 and slot 3) after a swap, and calls hedge(address,address,uint256) via an external call, suggesting the hook hedges its exposure after trades.

Security & trust assessment

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

Who controls it: The owner can disable swaps entirely, change fee and tick parameters, redirect the executor and withdraw reserve funds. A compromised owner key could drain reserves and halt trading.

Risk to user funds: The hook holds USDC reserves that the owner or executor can withdraw, and it can block swaps through the pause flag. Users' pool funds are exposed to owner action, and the afterSwap hedge path moves tokens through an external contract.

Security findings

  • [medium] Owner can pause swaps: setSwapsEnabled lets the owner halt all swaps through the swapsEnabled flag, a direct pause control over trading.
  • [high] Owner can withdraw hook reserves: withdrawReserve and withdrawAllReserve let the owner move USDC reserve funds held by the hook to an arbitrary address.
  • [medium] Owner can change fee and tick parameters: The owner can change the fee and tick parameters, altering pricing for swappers and LPs at will.
  • [info] Single privileged key with no visible timelock: The contract is Ownable with transferOwnership and a setExecutor role, so privileged control rests on a single key with no timelock evident in the bytecode.
  • [low] Dependency on external hedge call: The afterSwap path calls hedge on an external contract using the balance of tokens, which means swap outcomes depend on an external hedging component.

Contract details

Verified source
No
Bytecode size
6,547 bytes
Upgradeable proxy
No
Detected patterns
ownable

Pools using Custom pricing hook