UmiaHookV2
BaseUmiaHookV2 is a Uniswap v4 hook on Base. Brand new: its first pool went live today. Still in use: 5 trades in the last week, and 1 new pool this week.
- Contract name
- UmiaHookV2
How this hook works
Venture launch poolUmia launches new ventures with a token sale and then a trading pool. This hook guards those pools: only Umia's launch contract can create one, only two set operators can add liquidity, and it records a price history other Umia contracts read.
Only Umia can open pools
A pool can only be created by the launch contract that registered it, so nobody can set up a copycat pool on this hook.
The code that does this (beforeInitialize):function beforeInitialize(address sender, PoolKey calldata key, uint160) external view onlyPoolManager returns (bytes4) { address launcher = pools[key.toId()].launcher; if (sender != launcher) revert UnauthorizedLauncher(sender, launcher); return IHooks.beforeInitialize.selector; }Liquidity only from operators
Only two set addresses can add liquidity. One may only add across the full price range, which keeps a base of liquidity in place.
The code that does this (beforeAddLiquidity):function beforeAddLiquidity( address sender, PoolKey calldata key, ModifyLiquidityParams calldata params, bytes calldata ) external onlyPoolManager returns (bytes4) { PoolConfig storage cfg = pools[key.toId()]; if (sender == cfg.anchorOperator) { if ( params.tickLower != TickMath.minUsableTick(key.tickSpacing) || params.tickUpper != TickMath.maxUsableTick(key.tickSpacing) ) revert OnlyFullRangePositions(); } else if (sender != cfg.activeOperator) { revert UnauthorizedLiquidityOperator(sender); } _writeObservation(key); return IHooks.beforeAddLiquidity.selector; }Built-in price history
Before every trade and liquidity change the hook saves the price, so other contracts can read a fair average price over time.
The code that does this (_writeObservation):function _writeObservation(PoolKey calldata key) internal { PoolId id = key.toId(); ObservationState storage state = oracleStates[id]; (, int24 tick,,) = poolManager.getSlot0(id); uint128 liquidity = poolManager.getLiquidity(id); uint16 tickAreaRemainder = tickAreaRemainders[id]; (state.index, state.cardinality, tickAreaRemainder) = observations[id].write( state.index, uint32(block.timestamp), tick, liquidity, state.cardinality, state.cardinalityNext, tickAreaRemainder ); tickAreaRemainders[id] = tickAreaRemainder; ObservationState storage coarseState = coarseOracleStates[id]; uint32 lastCoarseTs = coarseObservations[id][coarseState.index].blockTimestamp; if (lastCoarseTs / COARSE_INTERVAL != uint32(block.timestamp) / COARSE_INTERVAL) { // Snapshot the per-block cumulative, not a resampled tick (must not be `write`). (coarseState.index, coarseState.cardinality) = coarseObservations[id].writeSnapshot( coarseState.index, observations[id][state.index], coarseState.cardinality, coarseState.cardinalityNext ); } }No extra fees
The hook takes nothing from trades. Traders pay only the pool's normal fee.
Who controls it: Nothing in the hook can be changed after setup. Its factory and links were set once, pools are registered only by Umia's launch contracts, and the code can't be upgraded.
Based on the hook’s published code.What do these labels mean?
Safety report
Before you build on it. Automated checks, not an auditWhat it can do
Its code executes inside each trade in pools that use it.
It runs before liquidity is removed, so it can delay or refuse LP exits.
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
- Linked a pool to the one it replaced, carrying over its price history 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.