Skip to main content

IAdapter

Interface that all vault adapters must implement to integrate with Morpho Vault V2.
interface IAdapter

Functions

allocate

function allocate(bytes memory data, uint256 assets, bytes4 selector, address sender)
    external
    returns (bytes32[] memory ids, int256 change);
Allocates assets to underlying markets or strategies.
ids
bytes32[]
Array of market identifiers affected by the allocation
change
int256
The net change in assets on the affected markets

deallocate

function deallocate(bytes memory data, uint256 assets, bytes4 selector, address sender)
    external
    returns (bytes32[] memory ids, int256 change);
Deallocates assets from underlying markets or strategies.
ids
bytes32[]
Array of market identifiers affected by the deallocation
change
int256
The net change in assets on the affected markets

realAssets

function realAssets() external view returns (uint256 assets);
Returns the current value of all investments managed by the adapter.
assets
uint256
The total value of investments in underlying asset units