Opening a pool and adding liquidity

A HookCat pool pairs native ETH with any ERC-20: USDG, a tokenized stock or a Pons coin. Its key is fixed: currency0 = ETH, fee = 0x800000 (dynamic), tickSpacing = 60, hooks = HookCat.

Open

HookCat.open(key, sqrtPriceX96, catId) returns (PoolId)

The hook records the caller as the pool's keeper, sets the cat and calls PoolManager.initialize itself. beforeInitialize refuses any pool the hook did not open, any key without the dynamic fee flag and any pair without native ETH as currency0. The open page does this in one transaction and defaults to the top cat of the 7-day leaderboard.

Adopt and hand over

The keeper can switch cats at any time with adopt(poolId, catId); the next swap uses the new cat. transferKeeper(poolId, to) hands the role over. Nobody else, the hook's owner included, can change a pool's cat.

Liquidity

LPs add and remove liquidity through Uniswap's v4 PositionManager (0x58daec3116aae6d93017baaea7749052e8a04fa7) exactly as for any v4 pool: approve the token for Permit2, let the PositionManager spend it through Permit2, then modifyLiquidities with MINT_POSITION, SETTLE_PAIR and SWEEP. The position is an ERC-721 in the LP's wallet. The hook has no liquidity callbacks: it never holds a position and never blocks an add or a remove.

Trading

Traders and routers see a normal v4 pool. Swaps go through Universal Router 2.1.1 (0x8876789976dEcBfCbBbe364623C63652db8C0904) with Permit2 (0x000000000022D473030F116dDEE9F6B43aC78BA3); the fee they will pay is readable before sending with quoteFee.