LendingHookV2 on Ethereum
Uniswap v4 Hook Contract 0xb0cc755b03abf0b981dd57a0fb12b8a54e08facc on Ethereum · Liquidity management · Verified contract
- Volume (24h)
- $0
- Value locked (TVL)
- $61.41K
- All-time volume
- $7.57M
- Pools using this hook
- 1
- Swaps (24h)
- 0 (0 traders)
- Total swaps
- 14,333
What it does
A Uniswap v4 lending hook that lets users borrow ETH against LOOP collateral by withdrawing ETH from single-sided liquidity bands, with liquidations that sell collateral back into the pool and refill it.
How it works step by step
- Seeds 100 single-sided LOOP liquidity bands across the pool via the hook's own V4 positions
- Borrow: locks LOOP collateral, removes ETH from the band near the liquidation price and pays out debt at 40% LTV minus a 1% origination fee
- Repay: returns debt ETH to the band above spot and releases collateral pro rata
- Liquidate: when collateral falls below 150% of debt, sells collateral via V4 swap, pays a capped bounty and refills surplus ETH
- Charges a fixed 1% fee on swaps in both directions and forwards it to FeeCollector
- Swap behaviour
- Charges a 1% ETH fee on buys (beforeSwap) and sells (afterSwap) routed to FeeCollector; blocks public swaps before start() and in blocks with a liquidation.
- Liquidity behaviour
- Only the hook itself may add or remove liquidity (beforeAddLiquidity/beforeRemoveLiquidity revert for other senders). Liquidity is seeded as 100 single-sided LOOP bands; borrows remove ETH-side liquidity from a band, repays and liquidations re-add ETH-only liquidity above spot.
- Fee behaviour
- Fixed 1% SWAP_FEE_BPS skimmed on every swap (buys in beforeSwap, sells in afterSwap) and forwarded to FeeCollector; 1% origination fee on borrows and a bounty of 1% of debt (capped at 0.01 ETH) paid to liquidators. Pool fee field is 0 and no LP fee is shared.
- Owner & admin controls
- Owner (set at deploy, not immutable) can call initializePool, seedBands, ownerBootstrapBuy (pre-launch only), start (one-way gate opening public swaps) and renounceOwnership (permanent, owner becomes address(0)). No pause, no upgradeability, no fee-rate setter; fee constants are hardcoded.
Enabled Uniswap v4 callbacks
beforeInitialize, afterInitialize, beforeAddLiquidity, beforeRemoveLiquidity, beforeSwap, afterSwap, beforeSwapReturnDelta, afterSwapReturnDelta
beforeInitialize/afterInitialize validate pool key and pool setup; beforeAddLiquidity/beforeRemoveLiquidity restrict LP to the hook; beforeSwap takes a 1% ETH fee on buys, blocks external swaps before start() and in blocks with a liquidation; afterSwap records lastSwapBlock and takes a 1% ETH fee on sells; beforeSwapReturnDelta and afterSwapReturnDelta let the hook claim fee deltas from swaps.
Security & trust assessment
Risk level: medium (verified source, high confidence).
Who controls it: The owner controls the launch sequence (seeding, bootstrap buy, start) and can renounce. Once started, owner has no power over user funds or fees; renouncing removes all privileged access. Before renouncement, the owner can seed bands and buy LOOP at the initial curve ahead of public trading.
Risk to user funds: The hook holds deposited LOOP collateral and ETH liquidity and moves both through V4 modifyLiquidity, take and settle. Users can be liquidated when price moves, and swaps can be temporarily blocked in liquidation blocks. No pause or upgrade path exists, so funds are not withdrawable by the owner after renouncement.
Security findings
- [medium] Launch gated by owner: Swaps are gated by a started flag and a 'swap blocked in liquidation blocks' rule; if owner never calls start(), the pool is unusable for the public. Owner must call renounceOwnership only after start().
- [low] Fee routed to external FeeCollector: The hook takes 1% of every swap via beforeSwap/afterSwap return deltas and take() to FeeCollector; the fee recipient is an external contract that could change behaviour if it is itself upgradeable or owned.
- [medium] Swap blocking after liquidations: Liquidation sells collateral via the hook's own pool and refills ETH into bands; external swaps are blocked in any block with a liquidation, so traders can be locked out of the pool for that block and bad debt or price manipulation can be engineered around the bounty and refill logic.
- [medium] Hook custodies collateral and pool liquidity: The hook holds LOOP collateral and ETH reserves and can move them through modifyLiquidity, take and settle during borrow, repay and liquidate. User collateral and pool liquidity are custodied by the contract itself.
- [info] Complex custom accounting: Liquidation logic depends on sqrtPrice math and band resolution fallbacks (refill into alternative bands, surplus to FeeCollector); edge cases in these computations could misprice debt or leave bands under-funded.
Contract details
- Verified source
- Yes (LendingHookV2)
- Compiler
- solc 0.8.26+commit.8a97fa7a
- Bytecode size
- 18,613 bytes
- Upgradeable proxy
- No
- Detected patterns
- launchpad, liquidity-management, moves-currency, return-delta, self-unlock
Pools using LendingHookV2
- ETH / LO0P (0.00% fee) — 24h volume $0, TVL $61.41K, 0 swaps today