SolidlyV2Aggregator
BaseHookSolidlyV2Aggregator is a Uniswap v4 hook on Base. Brand new: its first pool went live today. Still in use: 4 trades in the last week, and 10 new pools this week.
- Contract name
- SolidlyV2Aggregator
How this hook works
Trading taxA trading tax hook. It takes a cut of every trade, limits some actions to approved addresses and stops liquidity being added directly.
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 fee is paid out in the same trade.
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 (settleCurrency.isAddressZero() || takeCurrency.isAddressZero()) revert NativeCurrencyNotSupported(); if (params.amountSpecified == 0) revert AmountZero(); if (params.amountSpecified > 0) revert ExactOutputNotSupported(); amountTake = uint256(-params.amountSpecified); if (amountTake > MAX_SWAP_AMOUNT) revert AmountTooLarge(); address poolAddr = _activePool(poolId); uint256 gross = ISolidlyV2Pool(poolAddr).getAmountOut(amountTake, Currency.unwrap(takeCurrency)); if (gross == 0) revert UnexpectedSwapOutputDelta(); if (gross > MAX_SWAP_AMOUNT) revert AmountTooLarge(); poolManager.take(takeCurrency, poolAddr, amountTake); poolManager.sync(settleCurrency); ISolidlyV2Pool(poolAddr).swap( params.zeroForOne ? 0 : gross, params.zeroForOne ? gross : 0, address(poolManager), "" ); if (poolManager.settle() != gross) revert UnexpectedSwapOutputDelta(); uint256 authorFee = feeOnOutput(gross); amountSettle = gross - authorFee; if (amountSettle == 0) revert UnexpectedSwapOutputDelta(); // …Approved addresses only
Some actions are limited to addresses on an approved list.
The code that does this (beforeInitialize):function _beforeInitialize(address sender, PoolKey calldata key, uint160 sqrtPriceX96) 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 ExternalPoolMismatch(); } address t0 = Currency.unwrap(key.currency0); address t1 = Currency.unwrap(key.currency1); address poolAddr = pairPool[t0][t1]; if (poolAddr == address(0) || !isAllowedExternalPool[poolAddr]) revert ExternalPoolNotAllowed(); PoolKey memory existing = _canonicalPoolKeyByAddress[poolAddr]; if (address(existing.hooks) != address(0)) { revert PairAlreadyHasCanonicalPool(existing.toId()); } _canonicalPoolKeyByAddress[poolAddr] = key; poolIdToExternalPool[key.toId()] = poolAddr; _initializedPools.push(key); return super._beforeInitialize(sender, key, sqrtPriceX96); }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 sender, PoolKey calldata key, uint160 sqrtPriceX96) 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 ExternalPoolMismatch(); } address t0 = Currency.unwrap(key.currency0); address t1 = Currency.unwrap(key.currency1); address poolAddr = pairPool[t0][t1]; if (poolAddr == address(0) || !isAllowedExternalPool[poolAddr]) revert ExternalPoolNotAllowed(); PoolKey memory existing = _canonicalPoolKeyByAddress[poolAddr]; if (address(existing.hooks) != address(0)) { revert PairAlreadyHasCanonicalPool(existing.toId()); } _canonicalPoolKeyByAddress[poolAddr] = key; poolIdToExternalPool[key.toId()] = poolAddr; _initializedPools.push(key); return super._beforeInitialize(sender, key, sqrtPriceX96); }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 AmountZero(); if (amountSpecified > 0) revert ExactOutputNotSupported(); uint256 amountIn = uint256(-amountSpecified); if (amountIn > MAX_SWAP_AMOUNT) revert AmountTooLarge(); address poolAddr = _activePool(poolId); address tokenIn = zeroToOne ? ISolidlyV2Pool(poolAddr).token0() : ISolidlyV2Pool(poolAddr).token1(); uint256 gross = ISolidlyV2Pool(poolAddr).getAmountOut(amountIn, tokenIn); if (gross == 0) revert UnexpectedSwapOutputDelta(); amountUnspecified = gross - feeOnOutput(gross); if (amountUnspecified == 0) revert UnexpectedSwapOutputDelta(); if (amountUnspecified > MAX_SWAP_AMOUNT) revert AmountTooLarge(); }
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 auditpoolAddr 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
Across all its pools, the hook handled a trade: $4.7k, and took its fee from a trade: $0.0112.
- Handled a trade 4 times, worth $4.7k
Latest transactions
- 0xc2c0e446…041985 block 66,022,766
- 0x9d43b93f…0218ad block 66,013,345
- 0x2e57cbf0…d7f25e block 66,006,472
- 0xc5a26100…7104fa block 66,003,270
- Took its fee from a trade 4 times, worth $0.0112
Latest transactions
- 0xc2c0e446…041985 block 66,022,766 · 0.00000561 WETH
- 0x9d43b93f…0218ad block 66,013,345 · 34.36 EDEL
- 0x2e57cbf0…d7f25e block 66,006,472 · 0.00000170 WETH
- 0xc5a26100…7104fa block 66,003,270 · 34.91 EDEL
- Registered an aggregator pool 10 times
Latest transactions
- 0xb135ca2f…ce18ed block 65,957,402
- 0x231d81f2…bba74b block 65,957,368
- 0x453af17a…f1b7af block 65,957,336
- 0xd9fe23ef…6eda2a block 65,957,304
- 0xd1862b1e…181764 block 65,957,268
- 0xeb49a9aa…74a3ac block 65,957,194
- 0x2cd3d07d…ee00bc block 65,957,158
- 0x23629994…6ffd81 block 65,957,126
- 0xc4fdb0b7…dd16ac block 65,957,090
- 0xcbe77a0e…41adde block 65,957,057
Settings changes: changed the token jar (1 time).
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. Dollar values count the amounts paid in ETH, stablecoins, BNB and BTC, at today’s prices.