Vault Deployment
Last updated
Last updated
The vault creation is done by calling deployNewVault
on the StrategUserInteractions
contract:
where
_name
and _symbol
are ERC20 corresponding attributes
_asset
is the vault asset
_middlewareStrategy
, _creatorFees
and _harvestFees
are vault configuration described
_ipfsHash
IPFS hash of the file containing vault's metadatas
When a vault is created, an ERC3525 contract is also deployed. This ERC3525 token is used for defining the current owner of the vault (tokenId 1), who has the authority to modify vaults parameters and manage the distribution of creator fees through the values assigned to different tokenIds of the ERC3525.
If the need need position manager(s) in its strategy, they have to be deployed after the vault deployment to set the vault as the owner of itself.
To have more informations about position managers, check in
Each vault's strategy comprises two lists of blocks: one for executing the strategy itself and another for executing the harvest process.
A "block" is a standardized contract that performs a specific action on a DeFi protocol. There are two types of blocks: StrategyBlock and HarvestBlock, each dedicated to execution in their respective block lists.
For blocks to be utilized in vaults, they must first be registered in the block registry.
So, after being deployed, a vault need to have a strategy configured by calling setVaultStrategy
on the StrategUserInteractions
contract
where:
_vault
is the vault's address
_positionManagers
: List of position managers owned by the vault. This addresses have the possibility to call protected function in the position manager rebalance context.
_stratBlocks
: Ordered list of block addresses executed on the strategy execution.
_stratBlocksParameters
: Ordered list of bytes containing encoded parameters of block in the same index in _stratBlocks
list
_isFinalBlock
: Ordered list of boolean to set a block in the stratBlocks as a final block. This is used only on strategy exit. When a block is a final block, it will receive the real percent to exit else it will receive 100% as exit percentage.
_harvestBlocks
: Ordered list of block addresses executed on the harvest execution.
_harvestBlocksParameters
: Ordered list of bytes containing encoded parameters of block in the same index in harvestBlocks list
NB: Since the vault strategy is setup, it will be immutable.
where:
_vault
is the vault's address
_settings
is the ordered list of setting ids to edits
_data
is the ordered list of settings data to apply on the vault
The gas cost of vaults operations isn't handle by the protocol.
To be operated, a vault need to have a minimal operation approval from an address holding StrategOperatingPaymentToken tokens.
A Vault has many configuration editable by its owner (described ) and to change them after the vault deployment, the vault owner have to call the following function:
Basically, SOPT is a wrapped gas token giving the possibility to operator to get refunded of operation gas cost. See this to have more information