LimitOrderHookV1
BaseLimitOrderHookV1 is a Uniswap v4 hook on Base. Runs code on every swap. Runs at pool creation.
- Contract name
- LimitOrderHookV1
Pools
1
Last new pool
4h
Code size
15,464 B
How this hook works
Liquidity managerA liquidity manager hook. It manages its own liquidity.
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 (handlePlaceCallback):function _handlePlaceCallback(PlaceCallbackData memory placeData) internal virtual { OrderInfo storage orderInfo = _orderInfos[placeData.orderId]; UserInfo storage userInfo = orderInfo.userInfo[placeData.owner]; uint128 newUserLiquidity = userInfo.liquidity + placeData.liquidity; // add the out of range liquidity to the pool (BalanceDelta callerDelta, BalanceDelta feesAccrued) = poolManager.modifyLiquidity( placeData.key, ModifyLiquidityParams({ tickLower: placeData.tickLower, tickUpper: placeData.tickLower + placeData.key.tickSpacing, liquidityDelta: int256(uint256(placeData.liquidity)), salt: _getPositionSalt(placeData.zeroForOne) }), ZERO_BYTES ); // collect the fees the position accrued into the order, over the liquidity that earned them _collectFees(orderInfo, uint256(uint128(feesAccrued.amount0())), uint256(uint128(feesAccrued.amount1()))); // checkpoint the placer against the order's accumulators, over the liquidity they end up holding (uint256 owed0, uint256 owed1) = _feesOwed(orderInfo, userInfo); userInfo.feeCheckpoint0X128 = _feeCheckpoint(orderInfo.accFee0PerLiqX128, owed0, newUserLiquidity); userInfo.feeCheckpoint1X128 = _feeCheckpoint(orderInfo.accFee1PerLiqX128, owed1, newUserLiquidity); // update the order liquidity accounting unchecked { orderInfo.liquidityTotal += placeData.liquidity; userInfo.liquidity = newUserLiquidity; } // …
Who controls it: It has an admin address, but no admin-only settings in its own code. The code cannot be changed.
Based on the hook’s published code.
What it can do
Runs code on every swap
Its code executes inside each trade in pools that use it.
Runs at pool creation
It runs when a pool is created, often to lock in that pool’s settings.
Hook history
- Place 7 times
Latest transactions
- 0xa87cfd1e…c714e7 block 55,768,231
- 0xd47bd250…6584b1 block 55,768,218
- 0x9bccb50b…ad3a1c block 55,766,496
- 0xa12d7e39…8debab block 55,766,486
- 0xa84e13d2…40f5c6 block 55,766,474
- 0x975974c1…efa8f3 block 55,766,463
- 0x36a6c34b…077160 block 55,766,454
- Fill 3 times
Latest transactions
- 0x16c4a0be…e6099b block 55,797,836
- 0x6eabffc0…e8e953 block 55,766,994
- 0x6eabffc0…e8e953 block 55,766,994
- Paid out a withdrawal 2 times
Latest transactions
- 0x145ed8b7…b17ba0 block 55,767,042
- 0x69881bfb…4a2100 block 55,767,032
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.
Pools
1 totalPairCreatedTrades · 7dPool ID