Meta Vault of Convex 3Crv Vaults

ERC-4626 vault with Curve's 3Pool liquidity provider token (3Crv) as an asset. The 3Crv is invested in underlying Convex 3Crv Basic Vaults.

Deposits of assets (3Crv) are allocated to the underlying vaults based on weights set by the Vault Manager. Withdraw of assets (3Crv) are proportionally withdrawn from the underlying assets. This may not match the weights set by the Vault Manager.

Capabilities

  • ERC-4626 compliant tokenized vault.

  • ERC-20 compliant token.

  • Assets are invested across multiple underlying ERC-4626 vaults of the same asset type.

  • Investment of deposited assets to the underlying vaults is batched in a settle process.

  • deposit and mint use minimal gas as the investment is done separately.

  • The VaultManager directs the deposited assets to the underlying vaults.

  • Assets in underlying vaults can be redistributed by the VaultManager.

  • Small withdrawals are taken from a single configured underlying vault to save gas.

  • Large withdraws are proportionally taken from all underlying vaults.

  • Performance fee periodically charged on assets per share increases.

  • Vault operations are pausable by the Governor.

  • Vault configuration is controlled by a protocol Governor. This includes:

    • Which underlying vaults are used.

    • Which vault small withdrawals are taken from.

    • The threshold for large withdraws as a percentage of shares.

    • Setting the account that receives the performance fee.

  • Initially the Governor can upgrade the contracts via a proxy without a time delay. After 6 weeks, this will be changed to a one week time delay.

Contract Interface

See the Metavaults github repository for contract diagrams and process diagrams.

See General ERC-4626 Vault Interface for the standard ERC-4626 functions.

Structs

Settlement

struct Settlement {
  uint256 vaultIndex;
  uint256 assets;
}

AssetSourcingParams

struct AssetSourcingParams {
  uint32 singleVaultSharesThreshold;
  uint32 singleSourceVaultIndex;
}

Swap

struct Swap {
  uint256 fromVaultIndex;
  uint256 toVaultIndex;
  uint256 shares;
  uint256 assets;
}

Variables

sourceParams

struct AssetSourcingParams sourceParams

Params related to sourcing of assets.

assetsTransferred

uint256 assetsTransferred

Amount of assets that are transferred from/to the vault.

assetPerShareUpdateThreshold

uint256 assetPerShareUpdateThreshold

Threshold amount of transfers to/from for assetPerShareUpdate.

performanceFee

uint256 performanceFee

Performance fee scaled to 6 decimal places. 1% = 10000, 0.01% = 100

perfFeesAssetPerShare

uint256 perfFeesAssetPerShare

Assets per shares used to calculate performance fees scaled to 26 decimal places.

feeReceiver

address feeReceiver

Account that receives the performance fee as shares.

Functions

settle

function settle(struct PeriodicAllocationAbstractVault.Settlement[] settlements) external virtual

Invests the assets sitting in the vault from previous deposits and mints into the nominated underlying vaults.

Parameters

NameTypeDescription

settlements

struct PeriodicAllocationAbstractVault.Settlement[]

A list of asset amounts and underlying vault indices to deposit the assets sitting in the vault.

setSingleVaultSharesThreshold

function setSingleVaultSharesThreshold(uint32 _singleVaultSharesThreshold) external

Governor sets the threshold for large withdrawals that withdraw proportionally from all underlying vaults instead of just from a single configured vault. This means smaller redeem and withdraw txs pay a lot less gas.

Parameters

NameTypeDescription

_singleVaultSharesThreshold

uint32

Percentage of shares being redeemed in basis points. eg 20% = 2000, 5% = 500

setSingleSourceVaultIndex

function setSingleSourceVaultIndex(uint32 _singleSourceVaultIndex) external

Governor sets the underlying vault that small withdrawals are redeemed from.

Parameters

NameTypeDescription

_singleSourceVaultIndex

uint32

the underlying vault's index position in underlyingVaults. This starts from index 0.

setAssetPerShareUpdateThreshold

function setAssetPerShareUpdateThreshold(uint256 _assetPerShareUpdateThreshold) external

Governor sets the threshold asset amount of cumulative transfers to/from the vault before the assets per share is updated.

Parameters

NameTypeDescription

_assetPerShareUpdateThreshold

uint256

cumulative asset transfers amount.

chargePerformanceFee

function chargePerformanceFee() external virtual

Vault Manager charges a performance fee since the last time a fee was charged.

As an example, if the assets per share increased by 0.1% in the last week and the performance fee is 4%, the vault shares will be increased by 0.1% * 4% = 0.004% as a fee. If there was 100,000 vault shares, 4 (100,000 * 0.004%) vault shares will be minted as a performance fee. This dilutes the assets per shares of the existing vault shareholders by 0.004%. No performance fee is charged if the assets per share drops.

setPerformanceFee

function setPerformanceFee(uint256 _performanceFee) external

Sets a new performance fee after charging to now using the old performance fee.

Parameters

NameTypeDescription

_performanceFee

uint256

Performance fee scaled to 6 decimal places. 1% = 10000, 0.01% = 100

activeUnderlyingVaults

function activeUnderlyingVaults() external view virtual returns (uint256 activeVaults)

Returns the active number of underlying vaults. This excludes any vaults that have been removed.

Return Values

NameTypeDescription

activeVaults

uint256

The number of active underlying vaults.

totalUnderlyingVaults

function totalUnderlyingVaults() external view virtual returns (uint256 totalVaults)

Returns the total number of underlying vaults, both active and inactive. The next vault added will have a vault index of this value.

Return Values

NameTypeDescription

totalVaults

uint256

The number of active and inactive underlying vaults.

resolveVaultIndex

function resolveVaultIndex(uint256 vaultIndex) public view virtual returns (contract IERC4626Vault vault)

Resolves a vault index to an active underlying vault address. This only works for active vaults. A Inactive vault error will be thrown if the vault index has not been used or the underlying vault is now inactive.s

Parameters

NameTypeDescription

vaultIndex

uint256

External vault index used to identify the underlying vault.

Return Values

NameTypeDescription

vault

contract IERC4626Vault

Address of the underlying vault.

rebalance

function rebalance(struct SameAssetUnderlyingsAbstractVault.Swap[] swaps) external virtual

VaultManager rebalances the assets in the underlying vaults. This can be moving assets between underlying vaults, moving assets in underlying vaults back to this vault, or moving assets in this vault to underlying vaults.

addVault

function addVault(address _underlyingVault) external

Adds a new underlying ERC-4626 compliant vault. This Meta Vault approves the new underlying vault to transfer max assets. There is a limit of 15 active underlying vaults. If more vaults are needed, another active vaults will need to be removed first. There is also a limit of 62 underlying vaults that can be used by this Meta Vault over its lifetime. That's both active and inactive vaults.

Parameters

NameTypeDescription

_underlyingVault

address

Address of a ERC-4626 compliant vault.

removeVault

function removeVault(uint256 vaultIndex) external

Removes an underlying ERC-4626 compliant vault. All underlying shares are redeemed with the assets transferred to this vault.

Parameters

NameTypeDescription

vaultIndex

uint256

Index of the underlying vault starting from 0.

setFeeReceiver

function setFeeReceiver(address _feeReceiver) external

Called by the protocol Governor to set the fee receiver address.

Parameters

NameTypeDescription

_feeReceiver

address

Address that will receive the fees.

updateAssetPerShare

function updateAssetPerShare() external

VaultManager can update the assetPerShare.

calculateAssetPerShare

function calculateAssetPerShare() public view returns (uint256 assetsPerShare_, uint256 totalAssets_)

calculates current assetsPerShare

Return Values

NameTypeDescription

assetsPerShare_

uint256

current assetsPerShare

totalAssets_

uint256

totalAssets of the vault

Last updated