Skip to main content

Hooks

Introduction

Hooks provide a way for vault governors to customise and control vault operations on Euler. By installing a hook configuration, governors can specify a hook target (a smart contract) and define which vault operations the hook should affect.

Hooks can be used to enable, disable, or modify certain vault functions based on predefined conditions. If a hook is triggered during an operation, the vault will call the hook target contract before completing the transaction. If the hook fails, the vault operation also fails.

Use Cases for Hooks

Hooks are primarily used to impose additional rules on vaults, ensuring compliance, security, or specific operational constraints. Examples include:

Pause Guardian – Allows a contract to pause or unpause specific vault functions to prevent exploits or manage crises. Synthetic Asset Vaults – Restricts deposits to only the underlying asset and disables certain operations. Permissioned/RWA Vaults – Controls who can deposit or borrow, useful for compliance or undercollateralised lending. Flash Loan Fees – Implements fees on flash loans, which are otherwise free by default. Utilisation Caps – Prevents a vault’s utilisation from exceeding a set threshold. Minimum Debt Sizes – Blocks transactions that create dust positions too small to liquidate profitably. Collateral Limits – Restricts the number of collateral assets an account can enable. By default, all hooks are enabled when a vault is created, but the vault governor must disable unnecessary hooks before the vault becomes operational. This prevents unintended interactions before proper configurations, such as supply caps, are set.

Hooks provide an additional layer of flexibility and risk management, allowing vaults to be tailored for different use cases while maintaining security and compliance.