MorphoBoostedDelegate

The MorphoBoostedDelegate is the implementation contract for markets that route idle liquidity to Morpho Blue Vaults. It extends the standard `PErc20Delegate` with ERC-4626 integration.

🛠️ Key Functions & Parameters

vaultTotalAssets()

Returns the total assets currently managed by the underlying Morpho Vault belonging to this market.

  • Returns:

    • uint256: Amount of underlying asset (e.g., USDC).

_setVaultBuffer(uint256 newMantissa)

Admin-only function to set the percentage of assets kept locally (not deposited in Morpho).

  • Parameters:

    • newMantissa: The percentage scaled by 1e18 (e.g., 1e17 = 10%).

⚙️ Internal Mechanics

_rebalanceVault()

Automatically called during mint, redeem, borrow, and repay. Checks if the local cash matches the target buffer.

  • Excess Cash: Deposited into Morpho.

  • Shortfall: Withdrawn from Morpho.

_vaultWithdrawable()

Safe wrapper to check liquidity available in Morpho before attempting a withdrawal, preventing reverts if the external vault is paused or illiquid.

Last updated