AsterixHook on Ethereum
Uniswap v4 Hook Contract 0xdad7ea85ff786b389a13f4714a56b1721b56c044 on Ethereum · Fee sharing · Verified contract
- Volume (24h)
- $0
- Value locked (TVL)
- $43
- All-time volume
- $195.68K
- Pools using this hook
- 1
- Swaps (24h)
- 0 (0 traders)
- Total swaps
- 24,860
What it does
Adds a configurable protocol fee to every swap in the pool, routing a share of the output token to treasury and main treasury addresses.
How it works step by step
- Runs an afterSwap callback on every swap in the pool
- Computes treasury fee and main treasury fee as basis points of the unspecified-side amount using FullMath.mulDiv over a 1e6 denominator
- Takes the native or ERC20 fee amounts from the PoolManager and sends them to treasury (or deadAddress) and mainTreasury
- Returns the total fee as an afterSwap return delta so the trader's settlement reflects the deduction
- Lets the owner update fee rates (capped below 100% combined) and the main treasury address
- Swap behaviour
- After each swap, the hook takes treasuryFeeBps (8% default) plus mainTreasuryFeeBps (1% default) of the unspecified-side amount and forwards it to the treasury and mainTreasury (or burns the treasury share to deadAddress for non-native token1 pairs), reducing the trader's net output.
- Liquidity behaviour
- No liquidity callbacks.
- Fee behaviour
- Takes a fee from the unspecified side of every swap in afterSwap: treasuryFeeBps (default 80000, i.e. 8%) and mainTreasuryFeeBps (default 10000, i.e. 1%) of the unspecified amount, both owner-adjustable up to a combined just under 100%. Fees are sent to treasury (or deadAddress for non-native token1 pairs) and mainTreasury via poolManager.take. The pool's own LP fee is not altered.
- Owner & admin controls
- Owner (Ownable) can call setFees to change treasuryFeeBps and mainTreasuryFeeBps (combined must stay below 1e6, i.e. 100%), setMainTreasury to redirect the main treasury fee recipient, transferOwnership and renounceOwnership. treasury and deadAddress are immutable. No pause or upgrade mechanism found.
Enabled Uniswap v4 callbacks
afterSwap, afterSwapReturnDelta
afterSwap: charges the treasury and main treasury fee on the unspecified currency after each swap. afterSwapReturnDelta: lets the hook return a delta so the fee is deducted from the trader's output and the pool's accounting stays balanced.
Security & trust assessment
Risk level: high (verified source, high confidence).
Who controls it: The owner can set the combined hook fee up to nearly 100% of swap output, effectively draining trader proceeds, and can redirect mainTreasury to any address at any time with no timelock.
Risk to user funds: The hook does not custody funds but its afterSwap takes a configurable share of each swap's output, so trader proceeds and LP-side flows are directly exposed to the owner-set fee rate and recipient addresses.
Security findings
- [high] Owner can set extreme swap fees: setFees allows treasuryFeeBps + mainTreasuryFeeBps up to just under 1e6 (100%), so the owner can set nearly all of each swap's unspecified output to be taken as fees.
- [medium] Unrestricted fee recipient change: setMainTreasury lets the owner instantly redirect the 1% main treasury fee to any address with no delay or event-gated safeguard.
- [info] Burn path for certain fees: For non-native token1 pairs, the treasury fee is sent to deadAddress, meaning those fees are burned and not received by treasury; this is a design choice that may surprise integrators.
- [info] Hook affects every swap: Fees are taken via poolManager.take in afterSwap with the return delta, so the hook alters net swap settlement for every swap while enabled.
Contract details
- Verified source
- Yes (AsterixHook)
- Compiler
- solc 0.8.26+commit.8a97fa7a
- Bytecode size
- 5,566 bytes
- Upgradeable proxy
- No
- Detected patterns
- dynamic-fee, ownable, return-delta
Pools using AsterixHook
- ETH / ASTX (1.00% fee) — 24h volume $0, TVL $43, 0 swaps today