LendingHookV2 on Ethereum
Uniswap v4 Hook Contract 0x0ee5685892791cb392b8258feee201137a46facc on Ethereum · Limit orders · Verified contract
- Volume (24h)
- $9.95
- Value locked (TVL)
- $13.23K
- All-time volume
- $17.37M
- Pools using this hook
- 1
- Swaps (24h)
- 1 (1 traders)
- Total swaps
- 21,925
What it does
LendingHookV2 turns a Uniswap v4 pool of ETH and LOOP into a lending market where users post LOOP collateral to borrow ETH from seeded liquidity bands, with swaps charged a 1% fee.
How it works step by step
- Seeds the v4 pool with 100 single-sided LOOP liquidity bands (initializePool and seedBands), each covering 30 ETH of pool depth.
- Borrow locks LOOP collateral and removes ETH liquidity from the band nearest the projected liquidation price, giving the user 40% LTV minus a 1% origination fee.
- Repay returns collateral pro-rata and refills the bound band with the repaid ETH as ETH-only liquidity.
- Liquidate, once a position is below 150% collateralization, sells the collateral through the pool, pays a capped 1% bounty to the liquidator, and refills surplus ETH into a band above spot.
- Charges a 1% fee on every swap via beforeSwap (buys) and afterSwap (sells), forwarding it to FeeCollector through return deltas.
- Blocks third-party liquidity provision by reverting beforeAddLiquidity and beforeRemoveLiquidity for any sender other than the hook.
- Swap behaviour
- Buys and sells each carry a 1% ETH fee taken in beforeSwap or afterSwap and sent to FeeCollector; hook-internal swaps from liquidation bypass the fee and set lastSwapBlock.
- Liquidity behaviour
- Liquidity is only added or removed by the hook itself (beforeAddLiquidity and beforeRemoveLiquidity revert for any sender other than the hook). Borrow removes ETH-side liquidity from a band to lend ETH; repay and liquidation refill that band with ETH-only single-sided liquidity.
- Fee behaviour
- Charges a 1% (SWAP_FEE_BPS) fee on every swap: on buys via beforeSwap returning a specified-side delta and on sells via afterSwap, both forwarded to FeeCollector. Borrows charge a 1% origination fee (ORIG_FEE_BPS) on debt routed to FeeCollector. Repay surplus and liquidation surplus that cannot be refilled are also sent to FeeCollector.
- Owner & admin controls
- Owner (immutable address set at deploy) can call initializePool once and seedBands in batches; owner is set immutably and there is no transferOwnership or upgrade path in the source, so ownership cannot change. No pause or fee-parameter setter found; all fee and LTV constants are compile-time constants.
Enabled Uniswap v4 callbacks
beforeInitialize, afterInitialize, beforeAddLiquidity, beforeRemoveLiquidity, beforeSwap, afterSwap, beforeSwapReturnDelta, afterSwapReturnDelta
beforeInitialize and afterInitialize validate the pool key and record launch state. beforeAddLiquidity and beforeRemoveLiquidity restrict LP to the hook. beforeSwap and afterSwap take the 1% fee via poolManager.take. beforeSwapReturnDelta and afterSwapReturnDelta let the hook take fee amounts as hook deltas.
Security & trust assessment
Risk level: medium (verified source, high confidence).
Who controls it: The owner can only initialize the pool and seed bands; it cannot move user collateral or debt, pause, or change fees. Its privileges are limited to setup, so centralization risk is low apart from the immutable owner key being used to seed liquidity.
Risk to user funds: The hook holds all LOOP collateral and ETH lent out and refilled from band liquidity; users depend on its band accounting and spot-derived LTV for solvency. Owner cannot directly seize user funds from the source, but the hook can hold, move and redirect ETH and LOOP through take, settle and transfers to FeeCollector.
Security findings
- [medium] Band accounting can diverge from the bound band: Borrow and liquidate use a single bound band; if spot moves so the band is entirely below current tick, _resolveBorrowBand and _refillBoundBand fall back to other bands or send surplus to FeeCollector, so refills may not return ETH to the band that was lent from.
- [medium] Spot-price dependent collateral valuation: Pricing relies on a closed-form constant-product model with a fixed virtual 20 ETH and a sqrt(0.6) liquidation constant; liquidation depends on spot-derived collateral value, so large trades or thin liquidity can be used to manipulate the liquidation threshold and borrowing capacity.
- [medium] Hook controls all pool inventory: The hook is the sole LP and holds all band liquidity; it takes tokens from pool reserves via take and settle and returns deltas, so it controls the pool's ETH and LOOP inventory.
- [low] Same-block lockout limits but does not stop manipulation: Borrow, repay and liquidate use nonReentrant, and borrow/liquidate revert in the same block as a swap (SwapInSameBlock), limiting same-block manipulation but not multi-block price manipulation.
- [info] Owner is immutable: Owner is set immutably in the constructor with no transfer path; the source contains an OwnerTransferred event but no function to change ownership.
Contract details
- Verified source
- Yes (LendingHookV2)
- Compiler
- solc 0.8.26+commit.8a97fa7a
- Bytecode size
- 17,061 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 $9.95, TVL $13.23K, 1 swaps today