LaunchHook
BaseHookLaunchHook is a Uniswap v4 hook on Base. Brand new: its first pool went live today. Still in use: 31 trades in the last week, and 1 new pool this week.
- Contract name
- LaunchHook
How this hook works
Liquidity managerA liquidity manager hook. It changes its fee over time, manages its own liquidity and trades on its own.
Fee changes over time
Instead of a fixed fee, it sets the fee itself and changes it over time, for example starting high at launch and coming down. The fee goes to liquidity providers; the hook keeps nothing for itself.
The code that does this (beforeSwap):function beforeSwap(address, PoolKey calldata key, IPoolManager.SwapParams calldata, bytes calldata) external onlyPoolManager returns (bytes4, BeforeSwapDelta, uint24) { TokenConfig storage c = _launched(Currency.unwrap(key.currency1)); PriceObs storage o = _obs[Currency.unwrap(key.currency1)]; uint256 elapsed = block.timestamp - o.lastTimestamp; if (elapsed != 0 && o.lastTimestamp != 0) { (, int24 tickNow,,) = poolManager.getSlot0(key.toId()); o.tickCumulative += int256(tickNow) * int256(elapsed); o.lastTimestamp = uint64(block.timestamp); } return ( IHooks.beforeSwap.selector, BeforeSwapDeltaLibrary.ZERO_DELTA, _feeAt(c) | LPFeeLibrary.OVERRIDE_FEE_FLAG ); }Manages its own liquidity
It adds and removes liquidity itself, so it can own part or all of the pool.
The code that does this (unlockCallback):function unlockCallback(bytes calldata data) external onlyPoolManager returns (bytes memory) { (uint8 action, address token, uint256 ethIn, address creator) = abi.decode(data, (uint8, address, uint256, address)); TokenConfig storage c = _config[token]; PoolKey memory key = _poolKey(token); if (action == _ACTION_COLLECT) { (BalanceDelta delta,) = poolManager.modifyLiquidity( key, IPoolManager.ModifyLiquidityParams({ tickLower: TICK_LOWER, tickUpper: c.startTick, liquidityDelta: 0, salt: bytes32(0) }), "" ); // With liquidityDelta == 0 the caller delta is exactly the fees owed to the position (>= 0). uint256 fees0 = uint256(uint128(delta.amount0())); uint256 fees1 = uint256(uint128(delta.amount1())); if (fees0 != 0) poolManager.take(key.currency0, address(this), fees0); if (fees1 != 0) poolManager.take(key.currency1, address(this), fees1); return abi.encode(fees0, fees1); } // _ACTION_LAUNCH: add the single-sided position, then the optional initial buy. (BalanceDelta added,) = poolManager.modifyLiquidity( key, IPoolManager.ModifyLiquidityParams({ tickLower: TICK_LOWER, // …Trades on its own
It makes trades itself, for example to convert the fees it collected.
The code that does this (unlockCallback):function unlockCallback(bytes calldata data) external onlyPoolManager returns (bytes memory) { (uint8 action, address token, uint256 ethIn, address creator) = abi.decode(data, (uint8, address, uint256, address)); TokenConfig storage c = _config[token]; PoolKey memory key = _poolKey(token); if (action == _ACTION_COLLECT) { (BalanceDelta delta,) = poolManager.modifyLiquidity( key, IPoolManager.ModifyLiquidityParams({ tickLower: TICK_LOWER, tickUpper: c.startTick, liquidityDelta: 0, salt: bytes32(0) }), "" ); // With liquidityDelta == 0 the caller delta is exactly the fees owed to the position (>= 0). uint256 fees0 = uint256(uint128(delta.amount0())); uint256 fees1 = uint256(uint128(delta.amount1())); if (fees0 != 0) poolManager.take(key.currency0, address(this), fees0); if (fees1 != 0) poolManager.take(key.currency1, address(this), fees1); return abi.encode(fees0, fees1); } // _ACTION_LAUNCH: add the single-sided position, then the optional initial buy. (BalanceDelta added,) = poolManager.modifyLiquidity( key, IPoolManager.ModifyLiquidityParams({ tickLower: TICK_LOWER, // …Rewards to claim
It keeps track of what people have earned, and they claim it themselves.
The code that does this (claim):function _claim(Currency currency, address to) internal returns (uint256 amount) { amount = owed[msg.sender][currency]; if (amount == 0) revert NothingToClaim(); owed[msg.sender][currency] = 0; totalCredited[currency] -= amount; emit Claimed(msg.sender, currency, to, amount); currency.transfer(to, amount); }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 the hook creates its pools
Nobody can create a pool with this hook directly. Pools are only created through the hook’s own code.
Anyone can trigger payouts
Anyone can collect the fees it has built up, so nobody has to wait on the hook developer.
The code that does this (collect):function _collect(address token) internal returns (uint256 ethFees, uint256 tokenFees) { TokenConfig storage c = _launched(token); (ethFees, tokenFees) = abi.decode(poolManager.unlock(abi.encode(_ACTION_COLLECT, token, 0, address(0))), (uint256, uint256)); address creator = c.creator; uint256 protocolBps = c.protocolBps; uint256 protocolEth = _credit(CurrencyLibrary.ADDRESS_ZERO, creator, ethFees, protocolBps); uint256 protocolTokens = _credit(Currency.wrap(token), creator, tokenFees, protocolBps); emit Collected(token, creator, ethFees, tokenFees, protocolEth, protocolTokens); }
Who controls it: The hook developer can change the wallets that receive its fees and the fee. The hook developer can also change: protocol bps, mcap bounds. The hook developer can also call: launch existing, claim protocol. The pool creator can change: metadata uri. The pool creator can also call: transfer creator. The hook developer can pause it. 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 auditclaimProtocolWhat it can do
Its code executes inside each trade in pools that use it.
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
- Launched existing 1 time
Latest transactions
- 0xc57bab2b…8a98cd block 64,288,514 · 40.00M GOURDES
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.