💎Vault
Vault contract is used to protect funds and perform swaps.
Types
ActionType
SwapDataExecution
Name | Type | Description |
---|---|---|
| bytes[] | swap data transaction |
| uint256[] | list of vault asset balances before the swap |
| uint256[] | list of vault positions |
| uint256 | share or base token amount swapped |
| uint256 | total supply of shares |
View Methods
getConstantProps
Returns the Constant properties of the vault.
Refer to the VLib's data structure for more information
getHistoryProps
Returns the History properties of the vault.
Refer to the VLib's data structure for more information
getConfigProps
Returns the Config properties of the vault.
Refer to the VLib's data structure for more information
getFeesProps
Returns the Fees properties of the vault.
Refer to the VLib's data structure for more information
getSecurityProps
Returns the Security properties of the vault.
Refer to the VLib's data structure for more information
tokensLength
Returns the number of different tokens in the vault.
Return Value:
Type | Description |
---|---|
uint256 | number of different assets in the vault |
getLatestPrice
Returns the last price of a chainlink price feed.
Call Parameters:
Name | Type | Description |
---|---|---|
| address | address of the price feed |
Return Value:
Type | Description |
---|---|
uint256 | last price of the price feed |
getVaultBalances
Returns the balances of each assets of the vault.
Return Value:
Name | Type | Description |
---|---|---|
| uint256[] | balances of vault assets |
getVaultStatus
Returns the status of the vault.
Return Values:
Name | Type | Description |
---|---|---|
| uint256[] | vault's position |
| uint256 | vault's valorization in USD |
| uint256 | price of one vault's share |
getManagementFees
Returns the amount of management fees to harvest.
Return Values:
Name | Type | Description |
---|---|---|
| uint256 | amount of shares to mint |
| uint256 | share price |
getPerformanceFees
Returns the amount of performance fees to harvest.
Return Values:
Name | Type | Description |
---|---|---|
| uint256 | amount of shares to mint |
| uint256 | share price |
Write Methods
deposit
Deposits an amount of base token in the vault.
Call Parameters:
Name | Type | Description |
---|---|---|
| uint256 | amount to deposit |
| bytes[] | payload to interact with paraswap's contracts |
redeem
Redeems an amount from the vault and receive in the same currency as deposit.
Call Parameters:
Name | Type | Description |
---|---|---|
| uint256 | amount to redeem |
| bytes[] | payload to interact with paraswap's contracts |
redeemEach
Redeems each parts of the assets in proportion to the shares burned.
Call Parameters:
Name | Type | Description |
---|---|---|
| uint256 | shares amount to redeem |
redeemForced
Redeems each parts of the assets in proportion to the shares burned to a user.
This method can only be called by address with DEFAULT_ADMIN_ROLE.
Call Parameters:
Name | Type | Description |
---|---|---|
| address | address of the user |
| uint256 | shares amount to redeem |
rebalance
Rebalances the vault.
This method can only be called by address with STRATEGIST_ROLE.
Call Parameters:
Type | Description | |
---|---|---|
| uint256 | vault in [BTC ETH] signal in bps : [3000, 7000] |
| bytes[] | payload to interact with paraswap's contracts |
harvestManagementFees
Mints share in proportion of management fees, based on current fees ratio and last withdraw timestamp.
This method can only be called by address with STRATEGIST_ROLE.
harvestPerformanceFees
Mints share in proportion of performance fees, based on current fees ratio and last withdraw timestamp.
This method can only be called by address with STRATEGIST_ROLE.
approveForSwap
Modifies approvals for assets managed by the vault.
This method can only be called by address with DEFAULT_ADMIN_ROLE.
Call Parameters:
Name | Type | Description |
---|---|---|
| uint256[] | amounts to approve |
addVaultAsset
Adds a new asset to the vault.
This method can only be called by address with STRATEGIST_ROLE.
Call Parameters:
Name | Type | Description |
---|---|---|
| address | address of the token to add |
setShareTransferability
Settles the new share transferability status.
This method can only be called by address with DEFAULT_ADMIN_ROLE.
Call Parameters:
Name | Type | Description |
---|---|---|
| bool | true if the share is transferable |
setConfigProps
Settles ConfigProps.
Refer to the VLib's data structure for more information. Only callable by the admin.
This method can only be called by address with DEFAULT_ADMIN_ROLE.
setSecurityProps
Settles SecurityProps.
Refer to the VLib's data structure for more information.
This method can only be called by address with DEFAULT_ADMIN_ROLE.
setFeesProps
Settles FeesProps.
Refer to the VLib's data structure for more information
This method can only be called by address with DEFAULT_ADMIN_ROLE.
Last updated