Overview
LidoDepositHook is an implementation of the IHook interface that acts as a conversion adapter for incoming deposits. It standardizes various ETH-like assets into wstETH for use in downstream vault logic. The hook supports ETH, WETH, and stETH as input formats and ensures conversion to wstETH before optionally forwarding execution to a downstream nextHook.
Primary Purpose
- Converts ETH, WETH, or stETH into
wstETHon deposit. - Ensures compatibility with protocols that expect
wstETH. - Provides composable hooks by chaining into a downstream
IHook(nextHook).
Constructor Parameters
Key Function
callHook(address asset, uint256 assets)
Handles conversion of an input asset into wstETH and optionally delegates the call to a downstream hook.
Supported Input Types:
wstETH— forwarded directlystETH— wrapped intowstETHviaIWSTETH(wsteth).wrap()WETH— unwrapped into ETH viaIWETH(weth).withdraw(), then deposited intowstETHETH(i.e.address(0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE)) — directly deposited intowstETH
- If
asset == wstETH: do nothing - If
asset == stETH:- Approves
wstETHto pullstETH - Calls
wrap()onwstETHto convert towstETH
- Approves
- If
asset == WETH:- Unwraps to ETH using
withdraw() - Sends ETH to
wstETHcontract to mintwstETH
- Unwraps to ETH using
- If
asset == ETH:- Sends ETH directly to
wstETH
- Sends ETH directly to
- After conversion:
- Calculates how much new
wstETHwas received - If
nextHookis configured, delegatescallHook(wstETH, amount)to it
- Calculates how much new
Errors
UnsupportedAsset(address asset)— Thrown if the provided asset is neitherwstETH,stETH,WETH, norETH
Assumptions:
It is assumed this hook will not triggerSTAKE_LIMIT or other limit-related errors in the Lido contracts. If such errors do occur, the vault admin can reconfigure the system to bypass the automated staking hook. In this case, RedirectingDepositHook can be assigned to the relevant queues, delegating staking responsibilities to the vault curator via manual liquidity management.