Skip to main content

Overview

Hooks are extension points in the Aera V3 protocol that allow custom logic to run at specific moments during vault operations. The vault owner configures hooks, and they execute automatically as part of the vault’s normal operation flow. Hooks can enforce constraints (slippage bounds, position limits), calculate fees, validate parameters, or perform any other custom logic without modifying core vault contracts. For a conceptual overview of how hooks work, see Aera V3 Hooks. This page documents the specific hook interfaces that contracts must implement.

IBeforeTransferHook

Transfer hooks run before token transfers within MultiDepositorVault vaults. They enforce transfer restrictions, blocklists, compliance requirements, or lock-up periods on vault unit transfers between addresses.

Functions

beforeTransfer

Called before every vault unit transfer. The hook can revert to prevent the transfer. Signature:
function beforeTransfer(address from, address to, uint256 amount) external
ParameterTypeDescription
fromaddressAddress sending vault units
toaddressAddress receiving vault units
amountuint256Number of vault units being transferred

ISubmitHooks

Submit hooks run before and after an entire guardian submission batch. They operate on the full batch of operations and are useful for batch-level accounting, aggregate position checks, or state snapshots. The vault owner configures submit hooks via setSubmitHooks on the BaseVault.

IBeforeSubmitHook

beforeSubmit

Called once before the guardian’s operation batch executes. Can perform batch-level validation or pre-processing. Signature:
function beforeSubmit(Operation[] calldata operations) external
ParameterTypeDescription
operationsOperation[]The full batch of operations about to execute

IAfterSubmitHook

afterSubmit

Called once after all operations in the batch complete. Used for post-processing such as fee snapshots, position tracking, or state verification. Signature:
function afterSubmit(Operation[] calldata operations) external
ParameterTypeDescription
operationsOperation[]The batch of operations that just executed

IOperationHook

Operation hooks run during individual operations within a submission batch. They are encoded in the guardian’s Merkle tree alongside the operation.

IBeforeOperationHook

beforeOperation

Called before an individual operation’s target call executes. Typically validates calldata parameters — for example, checking swap slippage against the OracleRegistry. Signature:
function beforeOperation(address target, bytes calldata data, bytes calldata hookData) external
ParameterTypeDescription
targetaddressTarget contract of the operation
databytesCalldata for the operation
hookDatabytesAdditional context from the Merkle tree

IAfterOperationHook

afterOperation

Called after an individual operation completes. Verifies post-conditions such as no residual token approvals or expected balance changes. Signature:
function afterOperation(address target, bytes calldata data, bytes calldata hookData) external
ParameterTypeDescription
targetaddressTarget contract of the operation
databytesCalldata that was executed
hookDatabytesAdditional context from the Merkle tree

IBeforeClaimHook

Claim hooks run before fee claims or other claim operations. They can enforce additional validation on who can claim and under what conditions.

Functions

beforeClaim

Called before a fee claim executes. Can revert to prevent the claim. Signature:
function beforeClaim(address claimer, address token, uint256 amount) external
ParameterTypeDescription
claimeraddressAddress attempting the claim
tokenaddressToken being claimed
amountuint256Amount being claimed

Common Use Cases

HookUse CaseExample
IBeforeOperationHookSlippage enforcementCheck swap output against OracleRegistry prices
IAfterOperationHookApproval cleanupVerify no residual ERC-20 approvals after operations
IBeforeSubmitHookPosition limitsCheck aggregate exposure before batch executes
IAfterSubmitHookFee snapshotsSnapshot vault state for fee calculation
IBeforeTransferHookTransfer restrictionsEnforce compliance blocklists on vault unit transfers
IBeforeClaimHookClaim validationEnforce timing or authorization on fee claims
This page was manually created as a baseline. Run the contract reference generation pipeline to update with complete NatSpec documentation from the Solidity source.