Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

MetaMorphoVaultAssertion

Git Source

Inherits: ERC4626SharePriceAssertion, ERC4626PreviewAssertion, ERC4626CumulativeOutflowAssertion

Title: MetaMorphoVaultAssertion

Author: Phylax Systems

Example ERC-4626 assertion bundle for MetaMorpho vaults.

MetaMorpho vaults typically deploy deposited assets into Morpho Blue markets, so vault-held ERC-20 balance does not need to equal totalAssets(). This bundle intentionally omits ERC4626AssetFlowAssertion and keeps the ERC-4626 checks that fit computed-asset vaults: share price, preview consistency, and cumulative underlying outflow. The three inherited assertions cover different failure modes:

  • per-call share price protects existing depositors from dilution during deposit, mint, withdraw, or redeem calls;
  • preview consistency checks that the pre-call ERC-4626 quote matches the shares/assets actually returned by the triggered call;
  • cumulative outflow acts as a rolling-window breaker for vault asset exits that are each individually valid but collectively risky. A failure points to an externally visible vault-accounting problem: holders were diluted, users received a result inconsistent with ERC-4626 previews, or the configured outflow budget was breached.

Functions

constructor

constructor(
    address vault_,
    address asset_,
    uint256 sharePriceToleranceBps_,
    uint256 outflowThresholdBps_,
    uint256 outflowWindowDuration_
)
    ERC4626BaseAssertion(vault_, asset_)
    ERC4626SharePriceAssertion(sharePriceToleranceBps_)
    ERC4626CumulativeOutflowAssertion(outflowThresholdBps_, outflowWindowDuration_);

Parameters

NameTypeDescription
vault_addressMetaMorpho vault instance whose selectors this bundle will monitor.
asset_addressUnderlying ERC-20 asset of the vault.
sharePriceToleranceBps_uint256Max share-price drift tolerated by ERC4626SharePriceAssertion, in basis points.
outflowThresholdBps_uint256Cumulative net-outflow limit as bps of TVL enforced by ERC4626CumulativeOutflowAssertion over the rolling window.
outflowWindowDuration_uint256Rolling window, in seconds, used by the outflow assertion.

triggers

Registers the ERC-4626 selectors against the MetaMorpho-safe assertion set.

The selector set comes from the inherited ERC-4626 protections. We do not register the asset-flow assertion because a healthy MetaMorpho vault can hold less on-hand USDC than totalAssets() while its funds are allocated into Morpho markets.

function triggers() external view override;