ERC4626V2Aggregator
EthereumERC4626V2Aggregator is a Uniswap v4 hook on Ethereum. Brand new: its first pool went live today.
- Contract name
- ERC4626V2Aggregator
How this hook works
Trading taxA trading tax hook. It takes a cut of every trade, stops liquidity being added directly and only lets approved callers create pools.
Takes a cut of every trade
On top of the normal pool fee, it keeps a share of each trade. It can never be above 0.05%.
The code that does this (conductSwap):function _conductSwap(Currency settleCurrency, Currency takeCurrency, SwapParams calldata params, PoolId poolId) internal override returns (uint256 amountSettle, uint256 amountTake, bool hasSettled) { if (params.amountSpecified >= 0) revert ExactOutputNotSupported(); amountTake = uint256(-params.amountSpecified); if (amountTake == 0) revert AmountInZero(); if (amountTake > MAX_SWAP_AMOUNT) revert AmountInTooLarge(); VaultInfo memory vi = poolIdToVault[poolId]; if (address(vi.vault) == address(0)) revert InvalidPoolId(); bool isDeposit = (params.zeroForOne == vi.token0IsAsset); poolManager.take(takeCurrency, address(this), amountTake); uint256 grossOut; if (isDeposit) { grossOut = vi.vault.deposit(amountTake, address(this)); } else { grossOut = vi.vault.redeem(amountTake, address(this), address(this)); } if (grossOut == 0) revert ZeroOutput(); if (grossOut > MAX_SWAP_AMOUNT) revert AmountOutTooLarge(); uint256 fee = Math.mulDiv(grossOut, feePips, PIPS); amountSettle = grossOut - fee; if (amountSettle == 0) revert ZeroOutput(); // …Liquidity can’t be added directly
Nobody can add liquidity to its pools through Uniswap directly. Liquidity only comes in through the hook’s own code.
Only approved callers create pools
New pools with this hook can only be created by approved callers, for example its own factory or launcher.
The code that does this (beforeInitialize):function _beforeInitialize(address, PoolKey calldata key, uint160) internal override returns (bytes4) { if (key.currency0.isAddressZero() || key.currency1.isAddressZero()) revert NativeCurrencyNotSupported(); if (key.fee != LPFeeLibrary.DYNAMIC_FEE_FLAG || key.tickSpacing != CANONICAL_TICK_SPACING) { revert InvalidPoolParams(); } address t0 = Currency.unwrap(key.currency0); address t1 = Currency.unwrap(key.currency1); VaultInfo memory vi = pairVault[t0][t1]; if (address(vi.vault) == address(0)) revert PairNotAllowed(); if (isInitializedPair[t0][t1]) revert PairAlreadyInitialized(); isInitializedPair[t0][t1] = true; PoolId pid = key.toId(); poolIdToVault[pid] = vi; IERC20(vi.asset).forceApprove(address(vi.vault), type(uint256).max); emit AggregatorPoolRegistered(pid); return IHooks.beforeInitialize.selector; }Simple trades only
Trades must state the amount going in, not the amount coming out.
The code that does this (rawQuote):function _rawQuote(bool zeroToOne, int256 amountSpecified, PoolId poolId) internal view override returns (uint256 amountUnspecified) { if (amountSpecified >= 0) revert ExactOutputNotSupported(); uint256 amountIn = uint256(-amountSpecified); if (amountIn == 0) revert AmountInZero(); if (amountIn > MAX_SWAP_AMOUNT) revert AmountInTooLarge(); VaultInfo memory vi = poolIdToVault[poolId]; if (address(vi.vault) == address(0)) revert InvalidPoolId(); bool isDeposit = (zeroToOne == vi.token0IsAsset); uint256 grossOut = isDeposit ? vi.vault.previewDeposit(amountIn) : vi.vault.previewRedeem(amountIn); if (grossOut == 0) revert ZeroOutput(); uint256 fee = Math.mulDiv(grossOut, feePips, PIPS); amountUnspecified = grossOut - fee; if (amountUnspecified == 0) revert ZeroOutput(); }
Who controls it: Nobody. The hook has no admin functions, and the code cannot be changed.
Based on the hook’s published code.What do these labels mean?
Safety report
Before you build on it. Automated checks, not an auditvault on every trade.What it can do
Its code executes inside each trade in pools that use it.
It can take or add tokens during a swap. Fees, burns and custom curves work this way, and so do scams.
Pools using it let the hook choose the swap fee instead of a fixed tier.
It checks every deposit before it goes in.
It runs when a pool is created, often to lock in that pool’s settings.
Hook history
- Registered an aggregator pool 8 times
Latest transactions
- 0xbcb4aeb7…5870c0 block 26,480,649
- 0x6777188a…1ce8d8 block 26,480,648
- 0x9e4e900a…70c83e block 26,480,647
- 0x9292bf02…315cd0 block 26,480,646
- 0x6304f45d…196028 block 26,480,645
- 0xb86ecce6…762bea block 26,480,644
- 0x87c946bc…72164e block 26,480,643
- 0xd98fb32d…f1e8d0 block 26,480,642
Counted from what the hook recorded on-chain across all its pools, for every action in its published code, plus token transfers in and out of it.