LendingHookV5 on Ethereum

Uniswap v4 Hook Contract 0x08a43193535877aa218a013463adf909ebea3acc on Ethereum · Liquidity management · Verified contract

Volume (24h)
$0
Value locked (TVL)
<$0.01
All-time volume
$300.15K
Pools using this hook
1
Swaps (24h)
0 (0 traders)
Total swaps
4,673

What it does

A community-funded ETH/TOKEN lending pool where LP deposits back a single full-range Uniswap v4 position, borrowers lock TOKEN collateral to borrow ETH at 40 percent LTV, and liquidators can buy underwater collateral at a 2.5 percent discount.

How it works step by step

  • Holds a single full-range V4 LP position that mirrors LP deposits, lending liquidity and reserve tokens
  • Lets LPs deposit ETH and token for ERC20 share tokens and withdraw pro-rata against the effective pool
  • Lends ETH against locked TOKEN collateral at 40 percent LTV with a utilization-based interest rate locked per borrow
  • Liquidates positions whose collateral value falls below 150 percent of debt at a 2.5 percent discount to the liquidator
  • Splits swap fees and origination fees between LPs and a hardcoded FeeCollector
Swap behaviour
Swaps are routed through the V4 pool; buys skim half of the total swap fee to FeeCollector in beforeSwap and sells skim it in afterSwap via the unspecified delta. External swaps are rejected in any block where a liquidation occurred, and price snapshots are updated on the first swap per block.
Liquidity behaviour
Deposits mint ERC20 LP shares against the effective pool (realETH plus totalDebt, realToken plus loan-reserve token) and add full-range V4 liquidity; a bootstrap branch sets the opening ratio when the pool is empty. Withdrawals burn shares, require a two-block share holding period and revert if the pool's ETH is currently lent out. Borrowing and repaying move liquidity out of and back into the V4 position.
Fee behaviour
Swap fee tier is fixed at construction (TOTAL_SWAP_FEE_PIPS, even, at most 10 percent). Half goes to LPs via the V4 pool fee, half is skimmed in beforeSwap (buys) or afterSwap (sells) and sent to a hardcoded FeeCollector. Borrowers pay a 1 percent origination fee, of which 50 percent goes to FeeCollector and 50 percent is donated to the LP position. Interest accrues on debt at a utilization-based rate locked per borrow.
Owner & admin controls
Only the deployer role can call setDeployer to transfer or burn the role; the deployer is set to the factory at construction and no other function is gated. No pausing, upgrade proxy, or parameter-setter functions exist: fee tier, LTV, rates and caps are immutable or constant. initializePool is permissionless but one-shot.

Enabled Uniswap v4 callbacks

beforeInitialize, afterInitialize, beforeAddLiquidity, beforeRemoveLiquidity, beforeSwap, afterSwap, beforeSwapReturnDelta, afterSwapReturnDelta

beforeInitialize: enforces the canonical PoolKey (ETH/token, this hook). afterInitialize: no-op. beforeAddLiquidity and beforeRemoveLiquidity: block any liquidity change not initiated by the hook itself. beforeSwap: captures price snapshots, blocks swaps in liquidation blocks and skims protocol fee on ETH-in buys. afterSwap: syncs real reserves from V4 state and skims protocol fee on sells (via unspecified delta). beforeSwapReturnDelta and afterSwapReturnDelta: allow the hook to take the protocol fee as a return delta.

Security & trust assessment

Risk level: medium (verified source, high confidence).

Who controls it: The deployer role can only hand off or burn itself; it cannot move funds, change fees, pause or upgrade. The FeeCollector address is hardcoded and receives protocol fees and any rounding dust, so the security of that address is an external dependency. The overall design is non-custodial and admin-free after deployment.

Risk to user funds: The hook holds the entire pool position (ETH and token) and borrower collateral, so user funds are held by the contract. No privileged path can directly drain them. Risk comes from oracle manipulation in lending and liquidation logic, from interest and collateral mis-pricing, and from rounding or bad-debt edge cases rather than admin theft.

Security findings

  • [medium] Oracle is the pool's own spot price with lag windows: Bootstrap and reset logic lets a depositor set the oracle price only when the pool holds no ETH, token or debt, with a BOOTSTRAP_COOLDOWN before borrows or liquidations use the new price. The UNI-style exploit path (drain to dust, re-bootstrap, borrow) is explicitly fenced, but the price oracle is still derived from the pool's own reserves and remains manipulable within the SAFE_LAG window.
  • [medium] Lending on a thin self-hosted AMM price: Borrows and liquidations price collateral using min(lagged snapshot, live ratio) and read a stale prevSnap inside a two-block window. Attackers able to move the pool for multiple consecutive blocks at reasonable cost could still mis-price collateral, relying on utilization caps (70 percent) to bound extractable debt.
  • [low] Same-block liquidation lockout freezes trading: Liquidation and deposit/withdraw are blocked in the same block as a liquidation and swaps are blocked too, which mitigates cross-pool bundling but also means a liquidation forces a temporary freeze on pool trading and LP exits.
  • [low] Hardcoded fee sink is a trust point: The hook sends protocol fees and rounding dust to a hardcoded FeeCollector and holds its own ETH and token balances; if FeeCollector is malicious or lost, protocol revenue and dust are affected but user principal held in the V4 position is not directly redirected.
  • [info] LP exits depend on borrower repayment liquidity: Withdrawals can revert when the pool's ETH is lent out, so LPs cannot exit until borrowers repay or are liquidated.

Contract details

Verified source
Yes (LendingHookV5)
Compiler
solc 0.8.26+commit.8a97fa7a
Bytecode size
24,511 bytes
Upgradeable proxy
No
Detected patterns
donates, erc20, liquidity-management, moves-currency, return-delta, self-unlock

Pools using LendingHookV5