Vault Operations
Strategy Operating Payment Token (SOPT)
Basically, it is a token following the ERC20 standard which wrap the gas token of the chain where the protocol is deployed and it is not transferable.
In addition of ERC20 function there is some additional functions to dedicate funds to the operation of a vault with approveOperation
function which is working like a traditional ERC20 approval.
where:
_spender
is the address of the vault_amount
is the amount of SOPT you want to allocate to the vault
For the operations payment, the StrategOperatorProxy
contract call the following function:
where:
_for
is the address of the vault_operator
is the address of the operator executing the transaction_amount
is the amount of SOPT to pay for the operation
Operators
Operators are whitelisted entities who perform various actions on the vaults when necessary, using the StrategOperatorProxy
contract. These actions include:
Rebalancing strategies
Rebalancing position managers
Harvesting strategies
Stopping strategies
For these actions to be executed by operators, vaults must have available gas (gas costs of operations are supported tiers party) via the SOPT.
To know if a vault operation to be rebalanced, operator call the StrategOperatorDataAggregator
contract with the following function
The returned struct contain an aggregated data of current configuration and state of the vault. Operator will compute it to determine if an operation is needed on it.
Operations
vaultRebalance
To rebalance the vault, operators have to call this function:
where:
_vault
is the vault address_payer
is the address which will pay for operation gas cost_gasCost
is the estimated gas cost_dynParamsIndexEnter
is the ordered list of block index which need dynamic parameters_dynParamsEnter
is the ordered list of bytes containing dynamic parameters to execute the enter execution_dynParamsIndexExit
is the ordered list of block index which need dynamic parameters_dynParamsExit
is the ordered list of bytes containing dynamic parameters to execute the exit execution
vaultHarvest
Executes the harvest function on the strategy vault when the harvest fees cover 2 SOPT when they are swapped.
To harvest the vault, operators have to call this function:
where:
_vault
is the vault address_payer
is the address which will pay for operation gas cost_gasCost
is the estimated gas cost_dynParamsIndex
is the ordered list of harvest block index which need dynamic parameters_dynParams
is the ordered list of bytes containing dynamic parameters to execute the harvest execution_portalPayload
is the dynamic parameters to swap harvest fees to SOPT
stopStrategy
Exit all assets from the strategy.
This function is called when the vault dosn't have sufficient SOPT to be maintained or when a critical issue has been detected on a protocol used on the vault strategy.
To stop the strategy, operators have to call this function:
where:
_vault
is the vault address_payer
is the address which will pay for operation gas cost_gasCost
is the estimated gas cost_dynParamsIndex
is the ordered list of harvest block index which need dynamic parameters_dynParams
is the ordered list of bytes containing dynamic parameters to execute the harvest execution
vaultWithdrawalRebalance
The withdrawal rebalance function is the only one function which is not restricted to operators and can be called by vault shares owner. The gas cost of this transaction is charged to the user, no SOPT will be charged to the vault gas payer
If the strategy's blocks doesn't need dynamic params to be executed, it can be called by users without particular permissions.
In the case where dynamic parameters are needed, dynamic parameters have to be provided and signed by an operator. if the signature isn't provided, the transaction will revert.
The hash to sign have to be computed like the following:
To execute this function, users have to call this function on the StrategUserInteractions
contract:
where:
_vault
is the vault address_deadline
is the execution deadline of the transaction_amount
is the amount of shares to withdraw_signature
the signature of the hash generated on dynamic parameters if needed_portalPayload
the portal payload if the user want to swap withdrawed assets to another asset_permitParams
the permit payload if the user want to use permit to make his approval on his vault shares_dynParamsIndex
is the ordered list of harvest block index which need dynamic parameters_dynParams
is the ordered list of bytes containing dynamic parameters to execute the harvest execution
positionManagerRebalance
The function is used to rebalance a borrow or a leverage done in a strategy with position manager of the borrow module.
The positon manager have an exclusive access to the following function on the vault:
This function allow a position manager to execute partially the vault strategy to retrieve borrowed assets before rebalancing the position manager or to execute enter function of next blocks if more assets are borrowed.
Block to execute on partial strategy function is computed by the operators in function of the provided strategy design.
To execute a position manager, you have to call the following function on the StrategOperatorProxy
contract:
where:
_positionManager
is the position manager address_payer
is the address which will pay for operation gas cost_gasCost
is the estimated gas cost_payload
the payload needed by the position manager to be rebalanced
Guardians functions
This function has to be called when there is an issue of protocol used by a vault.
When it's happen, guardians have to lock vault. When a vault is locked, operators will call the stop operation to exit vault's liquidity from its strategy and secure funds in the buffer
lockVaults
unlockVaults
Last updated