Skip to main content
Hooks let a vault run custom asset logic whenever a queue moves assets in or out. Typical uses are routing deposits into subvaults, wrapping assets, and pulling liquidity back for redemptions.

How hooks are called

  • Every hook implements IHook.callHook(address asset, uint256 assets).
  • Queues trigger hooks through ShareModule.callHook(assets). The vault resolves the hook for the calling queue and runs it with delegatecall, so the hook code executes in the vault’s context.
  • Each queue uses its custom hook if one is set with setCustomHook(queue, hook). Otherwise it falls back to defaultDepositHook or defaultRedeemHook. Changing hooks requires SET_HOOK_ROLE.
  • For redeem queues, the vault transfers assets to the queue after the hook returns, or straight away if the queue has no hook.

Redeem hooks

Redeem hooks also implement IRedeemHook.getLiquidAssets(address asset). Redeem queues call ShareModule.getLiquidAssets() to find out how much they can pay out, and the vault answers with the hook’s getLiquidAssets. Without a redeem hook, only the vault’s own balance counts as liquid.

Hook contracts

In this directory, you will find a detailed per-contract overview of the “Hooks” contract category, including the following hooks: BasicRedeemHook LidoDepositHook RedirectingDepositHook TransferDepositHook