Alphix on Arbitrum

Uniswap v4 Hook Contract 0x5e645c3d580976ca9e3fe77525d954e73a0ce0c0 on Arbitrum · Dynamic fee · Verified contract

Volume (24h)
$9.48
Value locked (TVL)
$40
All-time volume
$23.00M
Pools using this hook
1
Swaps (24h)
7 (7 traders)
Total swaps
19,139

What it does

Alphix is a single-pool Uniswap v4 hook that sets dynamic LP fees from a moving target ratio and rehypothecates pooled liquidity into ERC-4626 yield sources, adding just-in-time concentrated liquidity around each swap.

How it works step by step

  • Sets the pool's dynamic LP fee via poke(), using an EMA target ratio and a linear out-of-band adjustment clamped to min and max fee.
  • Accepts ERC20 deposits of both pool tokens, sends them to ERC-4626 yield sources, and mints ERC20 share tokens to LPs.
  • Adds concentrated JIT liquidity in a fixed tick range during beforeSwap using yield-source balances.
  • Removes the JIT liquidity in afterSwap and settles currency deltas back to yield sources.
  • Allows the owner to initialize the pool once and set fee parameters, while an AccessManager controls pause, fee poking and yield source changes.
Swap behaviour
beforeSwap adds JIT concentrated liquidity from yield-source balances within the configured tick range; afterSwap removes it and settles the net hook deltas with the PoolManager, depositing or withdrawing from yield sources.
Liquidity behaviour
addReHypothecatedLiquidity mints share tokens (ERC20) against deposits of both currencies, which are deposited into ERC-4626 yield sources; removeReHypothecatedLiquidity burns shares and withdraws proportionally. Owner must seed the first deposit. In beforeSwap the hook adds concentrated JIT liquidity in the configured tick range using yield-source balances, and in afterSwap removes it and settles deltas back to the yield sources.
Fee behaviour
Dynamic LP fee: the fee is recomputed off-chain-triggered via poke(currentRatio) by the AccessManager role, using an EMA target ratio and a linear out-of-band adjustment throttled by streak and side factors, clamped to minFee/maxFee. The fee is written to the PoolManager through updateDynamicLPFee. The hook itself takes no fee from swaps.
Owner & admin controls
Owner (Ownable2Step, renounce disabled) can initialize the pool once, set pool params (fee bounds, EMA lookback, slope, etc.), set global max adjustment rate, and bypasses the first-deposit restriction only as owner. AccessManager (restricted modifier) controls pause/unpause, poke (fee updates), and setYieldSource, which can migrate all yield-source shares to a new ERC-4626 vault chosen by the admin. Authority can be changed via setAuthority.

Enabled Uniswap v4 callbacks

beforeInitialize, beforeSwap, afterSwap

beforeInitialize: validates caller is owner, pool not already set, and rejects native ETH pools. beforeSwap: adds JIT liquidity from yield-source funds before the swap (paused when hook is paused). afterSwap: removes JIT liquidity and resolves net currency deltas by taking/settling with the PoolManager and depositing/withdrawing from yield sources.

Security & trust assessment

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

Who controls it: The AccessManager authority can pause all swaps and liquidity operations, call poke to move the fee within configured bounds, and redirect all rehypothecated funds to any ERC-4626 vault via setYieldSource (migration redeems and redeposits). The owner can set fee bounds and parameters and change the global adjustment rate; a malicious or compromised admin could reconfigure the fee to the maximum or migrate reserves to a malicious yield source.

Risk to user funds: Deposited LP funds are held in ERC-4626 yield sources controlled through the admin-set yield source addresses, and the hook can move them to a new vault via setYieldSource; pausing can block withdrawals and swaps. Swap deltas are settled by the hook, so swaps route value through the yield sources.

Security findings

  • [high] Admin-controlled yield source migration: setYieldSource lets a restricted caller redeem all shares from the current vault and redeposit into any address that passes ERC-4626 asset checks. Trust in yield-source correctness and in the admin role is assumed in the code comments.
  • [medium] Pause can halt trading: Pausing via the restricted role blocks beforeSwap and afterSwap, which halts swaps and liquidity actions for the pool.
  • [medium] Admin can change swap fees: poke and setPoolParams allow the admin to move fees within minFee and maxFee bounds (up to LP fee max) and change the adjustment behaviour, changing trader costs at will.
  • [medium] Swaps depend on yield source behaviour: Hook settlement calls yield-source deposit and withdraw during swaps; a reverting or misconfigured yield source makes swaps revert. Share pricing trusts convertToAssets of the yield source.
  • [info] Non-upgradeable with persistent admin: Contract is not an upgradeable proxy and renounceOwnership is disabled, so admin functions remain available indefinitely.

Contract details

Verified source
Yes (Alphix)
Compiler
solc 0.8.30+commit.73712a01
Bytecode size
22,906 bytes
Upgradeable proxy
No
Detected patterns
dynamic-fee, erc20, erc6909-claims, liquidity-management, moves-currency, ownable, pausable

Pools using Alphix