Skip to main content

IVaultV2

The main interface for Morpho Vault V2, extending the ERC4626 tokenized vault standard and ERC2612 permit functionality.
interface IVaultV2 is IERC4626, IERC2612

Structs

Caps

Defines allocation and cap constraints for adapters.
struct Caps {
    uint256 allocation;
    uint128 absoluteCap;
    uint128 relativeCap;
}

State variables

virtualShares

function virtualShares() external view returns (uint256);
Returns the number of virtual shares used for exchange rate calculations.
uint256
The virtual shares amount

owner

function owner() external view returns (address);
Returns the vault owner address.
address
The owner address

curator

function curator() external view returns (address);
Returns the curator address who manages vault parameters.
address
The curator address

receiveSharesGate

function receiveSharesGate() external view returns (address);
Returns the gate contract for receiving shares.
address
The receive shares gate address

sendSharesGate

function sendSharesGate() external view returns (address);
Returns the gate contract for sending shares.
address
The send shares gate address

receiveAssetsGate

function receiveAssetsGate() external view returns (address);
Returns the gate contract for receiving assets.
address
The receive assets gate address

sendAssetsGate

function sendAssetsGate() external view returns (address);
Returns the gate contract for sending assets.
address
The send assets gate address

adapterRegistry

function adapterRegistry() external view returns (address);
Returns the adapter registry contract address.
address
The adapter registry address

isSentinel

function isSentinel(address account) external view returns (bool);
Checks if an account has sentinel privileges.
bool
True if the account is a sentinel

isAllocator

function isAllocator(address account) external view returns (bool);
Checks if an account has allocator privileges.
bool
True if the account is an allocator

firstTotalAssets

function firstTotalAssets() external view returns (uint256);
Returns the total assets at the first interest accrual.
uint256
The first total assets amount

_totalAssets

function _totalAssets() external view returns (uint128);
Returns the internal total assets tracker.
uint128
The internal total assets amount

lastUpdate

function lastUpdate() external view returns (uint64);
Returns the timestamp of the last interest accrual.
uint64
The last update timestamp

maxRate

function maxRate() external view returns (uint64);
Returns the maximum allowed interest rate.
uint64
The maximum rate

adapters

function adapters(uint256 index) external view returns (address);
Returns the adapter at the given index.
address
The adapter address at the index

adaptersLength

function adaptersLength() external view returns (uint256);
Returns the total number of adapters.
uint256
The number of adapters

isAdapter

function isAdapter(address account) external view returns (bool);
Checks if an address is a registered adapter.
bool
True if the address is an adapter

allocation

function allocation(bytes32 id) external view returns (uint256);
Returns the current allocation for a market ID.
uint256
The current allocation amount

absoluteCap

function absoluteCap(bytes32 id) external view returns (uint256);
Returns the absolute cap for a market ID.
uint256
The absolute cap amount

relativeCap

function relativeCap(bytes32 id) external view returns (uint256);
Returns the relative cap for a market ID.
uint256
The relative cap percentage

forceDeallocatePenalty

function forceDeallocatePenalty(address adapter) external view returns (uint256);
Returns the penalty for force deallocating from an adapter.
uint256
The penalty amount

liquidityAdapter

function liquidityAdapter() external view returns (address);
Returns the current liquidity adapter address.
address
The liquidity adapter address

liquidityData

function liquidityData() external view returns (bytes memory);
Returns the liquidity adapter configuration data.
bytes
The liquidity data

timelock

function timelock(bytes4 selector) external view returns (uint256);
Returns the timelock duration for a function selector.
uint256
The timelock duration in seconds

abdicated

function abdicated(bytes4 selector) external view returns (bool);
Checks if the curator has abdicated control of a function.
bool
True if abdicated

executableAt

function executableAt(bytes memory data) external view returns (uint256);
Returns the timestamp when a timelocked call becomes executable.
uint256
The executable timestamp

performanceFee

function performanceFee() external view returns (uint96);
Returns the performance fee percentage.
uint96
The performance fee

performanceFeeRecipient

function performanceFeeRecipient() external view returns (address);
Returns the performance fee recipient address.
address
The performance fee recipient

managementFee

function managementFee() external view returns (uint96);
Returns the management fee percentage.
uint96
The management fee

managementFeeRecipient

function managementFeeRecipient() external view returns (address);
Returns the management fee recipient address.
address
The management fee recipient

Gating

canSendShares

function canSendShares(address account) external view returns (bool);
Checks if an account can send shares.
bool
True if the account can send shares

canReceiveShares

function canReceiveShares(address account) external view returns (bool);
Checks if an account can receive shares.
bool
True if the account can receive shares

canSendAssets

function canSendAssets(address account) external view returns (bool);
Checks if an account can send assets.
bool
True if the account can send assets

canReceiveAssets

function canReceiveAssets(address account) external view returns (bool);
Checks if an account can receive assets.
bool
True if the account can receive assets

Multicall

multicall

function multicall(bytes[] memory data) external;
Executes multiple function calls in a single transaction.

Owner functions

setOwner

function setOwner(address newOwner) external;
Sets a new vault owner.

setCurator

function setCurator(address newCurator) external;
Sets a new curator.

setIsSentinel

function setIsSentinel(address account, bool isSentinel) external;
Grants or revokes sentinel privileges.

setName

function setName(string memory newName) external;
Sets a new vault name.

setSymbol

function setSymbol(string memory newSymbol) external;
Sets a new vault symbol.

Timelocks for curator functions

submit

function submit(bytes memory data) external;
Submits a timelocked function call.

revoke

function revoke(bytes memory data) external;
Revokes a pending timelocked function call.

Curator functions

setIsAllocator

function setIsAllocator(address account, bool newIsAllocator) external;
Grants or revokes allocator privileges.

setReceiveSharesGate

function setReceiveSharesGate(address newReceiveSharesGate) external;
Sets the receive shares gate contract.

setSendSharesGate

function setSendSharesGate(address newSendSharesGate) external;
Sets the send shares gate contract.

setReceiveAssetsGate

function setReceiveAssetsGate(address newReceiveAssetsGate) external;
Sets the receive assets gate contract.

setSendAssetsGate

function setSendAssetsGate(address newSendAssetsGate) external;
Sets the send assets gate contract.

setAdapterRegistry

function setAdapterRegistry(address newAdapterRegistry) external;
Sets the adapter registry contract.

addAdapter

function addAdapter(address account) external;
Adds a new adapter to the vault.

removeAdapter

function removeAdapter(address account) external;
Removes an adapter from the vault.

increaseTimelock

function increaseTimelock(bytes4 selector, uint256 newDuration) external;
Increases the timelock duration for a function.

decreaseTimelock

function decreaseTimelock(bytes4 selector, uint256 newDuration) external;
Decreases the timelock duration for a function.

abdicate

function abdicate(bytes4 selector) external;
Abdicates curator control of a function.

setPerformanceFee

function setPerformanceFee(uint256 newPerformanceFee) external;
Sets the performance fee percentage.

setManagementFee

function setManagementFee(uint256 newManagementFee) external;
Sets the management fee percentage.

setPerformanceFeeRecipient

function setPerformanceFeeRecipient(address newPerformanceFeeRecipient) external;
Sets the performance fee recipient.

setManagementFeeRecipient

function setManagementFeeRecipient(address newManagementFeeRecipient) external;
Sets the management fee recipient.

increaseAbsoluteCap

function increaseAbsoluteCap(bytes memory idData, uint256 newAbsoluteCap) external;
Increases the absolute cap for a market.

decreaseAbsoluteCap

function decreaseAbsoluteCap(bytes memory idData, uint256 newAbsoluteCap) external;
Decreases the absolute cap for a market.

increaseRelativeCap

function increaseRelativeCap(bytes memory idData, uint256 newRelativeCap) external;
Increases the relative cap for a market.

decreaseRelativeCap

function decreaseRelativeCap(bytes memory idData, uint256 newRelativeCap) external;
Decreases the relative cap for a market.

setMaxRate

function setMaxRate(uint256 newMaxRate) external;
Sets the maximum allowed interest rate.

setForceDeallocatePenalty

function setForceDeallocatePenalty(address adapter, uint256 newForceDeallocatePenalty) external;
Sets the penalty for force deallocating from an adapter.

Allocator functions

allocate

function allocate(address adapter, bytes memory data, uint256 assets) external;
Allocates assets to an adapter.

deallocate

function deallocate(address adapter, bytes memory data, uint256 assets) external;
Deallocates assets from an adapter.

setLiquidityAdapterAndData

function setLiquidityAdapterAndData(address newLiquidityAdapter, bytes memory newLiquidityData) external;
Sets the liquidity adapter and its configuration data.

Exchange rate

accrueInterest

function accrueInterest() external;
Accrues interest and updates the vault’s exchange rate.

accrueInterestView

function accrueInterestView()
    external
    view
    returns (uint256 newTotalAssets, uint256 performanceFeeShares, uint256 managementFeeShares);
Simulates interest accrual without state changes.
newTotalAssets
uint256
The projected total assets after accrual
performanceFeeShares
uint256
The performance fee shares to be minted
managementFeeShares
uint256
The management fee shares to be minted

Force deallocate

forceDeallocate

function forceDeallocate(address adapter, bytes memory data, uint256 assets, address onBehalf)
    external
    returns (uint256 penaltyShares);
Force deallocates assets from an adapter with a penalty.
penaltyShares
uint256
The number of penalty shares minted to the caller