Custom pricing hook on Avalanche
Uniswap v4 Hook Contract 0xda13bf8adcc6f8f9f36a2dda5ed0e13b4e24c0c0 on Avalanche · Custom pricing
- Volume (24h)
- $0
- Value locked (TVL)
- $1.24
- All-time volume
- $13
- Pools using this hook
- 121
- Swaps (24h)
- 0 (0 traders)
- Total swaps
- 157
What it does
A Uniswap v4 hook on Avalanche C-Chain that intercepts swaps on registered pools and moves tokens between the hook and the pool manager, apparently acting as an inventory or reserve-backed trading and accounting layer for whitelisted pools.
How it works step by step
- Implements beforeSwap and afterSwap callbacks, which run around every swap on pools that use this hook.
- Tracks per-pool enablement and per-pool-id state through mapped storage, and a global counter in storage slot 3 that is read and written by the swap callbacks.
- Maintains reserve-token flags (setReserveToken) and an inventory balance (tokenBalance), suggesting the hook holds its own token inventory.
- Calls pool manager settlement functions (take, settle, sync) and token transfers, so the hook moves currency during swaps rather than only adjusting fees.
- Has a withdrawToken path and references to a position manager and an executor, indicating an operator-managed reserve that can be drained or rebalanced.
- Liquidity add/remove and donate callbacks exist as selectors but the hook only declares swap permissions, so they are likely unused or only exist as interface stubs.
- Swap behaviour
- beforeSwap and afterSwap are invoked on every swap in pools using this hook. The swap callbacks read the enablement mapping and a counter, and the bytecode contains take, settle and sync calls, so the hook settles currency with the pool manager and may fill or account swaps from its own inventory.
- Liquidity behaviour
- No liquidity callbacks are enabled for this hook (only swap permissions are set in the address), although add/remove liquidity handler selectors are present in the bytecode.
- Fee behaviour
- No dynamic fee function is identified in the decoded selectors. Fees are not clearly set by the hook; the hook may take or net currency during swaps, so the effective price may differ from the pool's static fee. Confirm from source.
- Owner & admin controls
- An owner() getter and a NotOwner error exist, so an owner gates privileged functions such as setPoolEnabled, setReserveToken and withdrawToken. An executor() getter also exists, suggesting a separate operator role. Upgradeability is not evident from the selectors.
Enabled Uniswap v4 callbacks
beforeSwap, afterSwap
beforeSwap: checks pool enablement and may settle or account currency before the swap executes. afterSwap: updates accounting and counters and may move the resulting currency after the swap.
Security & trust assessment
Risk level: high, estimated (decoded bytecode, low confidence).
Who controls it: The owner, and possibly an executor, can withdraw hook-held tokens, enable or disable pools, change reserve-token designations and potentially route trades, meaning a privileged key could redirect or halt trading.
Risk to user funds: The hook can hold token inventory and move currency through pool manager settlement during swaps, and an owner withdrawal path exists, so user-side liquidity and swap proceeds are exposed to the privileged key and to the hook's inventory logic.
Security findings
- [high] Owner can withdraw hook-held tokens: withdrawToken(address,address,uint256) is a nonpayable owner-gated function that moves token balances out of the hook, so any inventory held by the contract can be removed by the privileged key.
- [medium] Owner can enable or disable pools and reserve tokens: setPoolEnabled and setReserveToken mutate the storage flags read during beforeSwap and afterSwap, so the owner can block swaps on a pool or change which tokens are treated as reserves.
- [medium] Hook moves currency during swaps: The bytecode includes take, settle and sync calls and token transfers from within swap callbacks, so the hook holds and moves user-facing funds and can affect swap outcomes beyond fee collection.
- [medium] Operator role via executor: An executor() getter and swapExactInput and validateRoute selectors suggest a separate executor may route and fill swaps, adding a trusted party to the trade path.
- [info] Source unverified: No verified source is available, so the exact logic, possible upgradeability and the precise role of the counter in storage slot 3 cannot be confirmed.
Contract details
- Verified source
- No
- Bytecode size
- 14,832 bytes
- Upgradeable proxy
- No
- Detected patterns
- moves-currency
Pools using Custom pricing hook
- AVAX / JOE (0.10% fee) — 24h volume $0, TVL <$0.01, 0 swaps today
- AVAX / LINK.e (0.10% fee) — 24h volume $0, TVL $0.09, 0 swaps today
- USDC / DAI.e (0.10% fee) — 24h volume $0, TVL $0.05, 0 swaps today
- AVAX / SNOB (0.10% fee) — 24h volume $0, TVL <$0.01, 0 swaps today
- AVAX / XPOW (0.10% fee) — 24h volume $0, TVL <$0.01, 0 swaps today
- AVAX / GRELF[ava] (0.10% fee) — 24h volume $0, TVL <$0.01, 0 swaps today
- AVAX / REDWOLF (0.10% fee) — 24h volume $0, TVL <$0.01, 0 swaps today
- AVAX / QI (0.10% fee) — 24h volume $0, TVL <$0.01, 0 swaps today
- AVAX / KIMBO (0.10% fee) — 24h volume $0, TVL <$0.01, 0 swaps today
- AVAX / yes (0.10% fee) — 24h volume $0, TVL <$0.01, 0 swaps today
- AVAX / KLO (0.10% fee) — 24h volume $0, TVL <$0.01, 0 swaps today
- AVAX / PEFI (0.10% fee) — 24h volume $0, TVL <$0.01, 0 swaps today
- AVAX / UST (0.10% fee) — 24h volume $0, TVL <$0.01, 0 swaps today
- AVAX / ELE (0.10% fee) — 24h volume $0, TVL <$0.01, 0 swaps today
- AVAX / JUICY (0.10% fee) — 24h volume $0, TVL <$0.01, 0 swaps today
- AVAX / NOCHILL (0.10% fee) — 24h volume $0, TVL <$0.01, 0 swaps today
- AVAX / AI (0.10% fee) — 24h volume $0, TVL <$0.01, 0 swaps today
- AVAX / BNZ (0.10% fee) — 24h volume $0, TVL <$0.01, 0 swaps today
- AVAX / USDT (0.10% fee) — 24h volume $0, TVL <$0.01, 0 swaps today
- USDC / XAVA (0.10% fee) — 24h volume $0, TVL <$0.01, 0 swaps today