> ## Documentation Index
> Fetch the complete documentation index at: https://metavaults.mellow.finance/llms.txt
> Use this file to discover all available pages before exploring further.

# Hooks

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.

| Queue | When the hook runs |
| - | - |
| `DepositQueue` | When an oracle report processes pending deposits |
| `SignatureDepositQueue` | Inside the signed deposit transaction |
| `SyncDepositQueue` | Inside the deposit transaction |
| `RedeemQueue` | When `handleBatches` settles priced batches |
| `SignatureRedeemQueue` | Inside the signed redemption transaction |
| `SyncRedeemQueue` | Inside the redemption transaction |

### 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:&#x20;

[BasicRedeemHook](/architecture/hooks/basicredeemhook)

[LidoDepositHook](/architecture/hooks/lidodeposithook)

[RedirectingDepositHook](/architecture/hooks/redirectingdeposithook)

[TransferDepositHook](/architecture/hooks/transferdeposithook)


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.