Skip to content

DDMetaMorpho

senamakel edited this page Jul 20, 2024 · 3 revisions

Solidity API

DDMetaMorpho

A direct deposit module that manages a morpho vault

vault

contract IMetaMorpho vault

initialize

function initialize(address _hub, address _zai, address _vault) external

deposit

function deposit(uint256 wad) external

https://github.com/morpho-org/metamorpho/blob/fcf3c41d9c113514c9af0bbf6298e88a1060b220/src/MetaMorpho.sol#L531

If the external pool requires a different amount to be passed in, the conversion should occur here as the Hub passes ZAI amounts. msg.sender must be the hub.

Parameters

Name Type Description
wad uint256

withdraw

function withdraw(uint256 wad) external

https://github.com/morpho-org/metamorpho/blob/fcf3c41d9c113514c9af0bbf6298e88a1060b220/src/MetaMorpho.sol#L557

If the external pool requires a different amount to be passed in the conversion should occur here as the Hub passes ZAI amounts. msg.sender must be the hub.

Parameters

Name Type Description
wad uint256

preDebtChange

function preDebtChange() external

Some external pools require actions before debt changes

postDebtChange

function postDebtChange() external

Some external pools require actions after debt changes

assetBalance

function assetBalance() external view returns (uint256)

Balance of assets this pool "owns".

This could be greater than the amount the pool can withdraw due to lack of liquidity.

Return Values

Name Type Description
[0] uint256 uint256 number of assets in ZAI

maxDeposit

function maxDeposit() external view returns (uint256)

Maximum number of assets the pool could deposit at present.

Return Values

Name Type Description
[0] uint256 uint256 number of assets in ZAI

maxWithdraw

function maxWithdraw() external view returns (uint256)

Maximum number of assets the pool could withdraw at present.

Return Values

Name Type Description
[0] uint256 uint256 number of assets in ZAI

redeemable

function redeemable() external view returns (address)

returns address of redeemable tokens (if any)

Clone this wiki locally