Protocol Governance parameters
Protocol Governance manages the global parameters of the protocol.| Parameter | Description | Unit | Default value |
|---|---|---|---|
| maxTokensPerVault | Maximum different tokens that a vault can manage | # | 10 |
| governanceDelay | The delay that has to pass for updating a certain class of params (delayed) | secs | 86400 |
| protocolTreasury | The treasury address for protocol fees | address | |
| forceAllowMask | If a bit in this mask is set, the permission is allowed for all addresses | bitmask (uint256) | 0 |
| withdrawLimit | The maximum withdrawal per block. The hardcoded minimum value is 200_000 USD | USD | 200_000 |
| unitPrices | Token price estimates, used for withdrawLimit. For new token can be set immediately, for updates a cool-down period of 14 days is used. | address (token) => units of token per 1 USD | USDC => 10 ^ 6 ETH => 10 ^ 18 / 3000 BTC => 10 ^ 8 / 45000 |
Vault Governances parameters
Any Vault kind is governed by a Vault Governance contract. This contract is responsible for governing the parameters for this Vault kind. There are several types of parameters of any governance.- InternalParams are parameters common for all Vault Governances, to be staged in a constructor of a corresponding Vault Governance and to be updated with a delay by the Governance of the protocol, which are:
- delayedStrategyParams are parameters different for each Vault Governance and for each vault instance (typically being some parameters of the strategy set for an ERC20RootVault instance of this strategy), which may be updated with a delay by a Strategist or Governance
- protocolPerVaultParams are parameters different for each Vault Governance and for each vault instance (typically being some protocol parameters of a single vault), which may be updated with a delay by the Governance
- protocolParams are parameters common for all vaults of the Vault kind, which may be updated immediately by the Governance
- delayedProtocolParams are parameters common for all vaults of the Vault kind, which may be updated with a delay by the Governance
- operatorParams are parameters common for all vaults of the Vault kind, which may be updated immediately by a Strategist or Governance
Getting and setting parameters
There are, therefore, three types of parameters that are to be stated for all vaults of the Vault kind, and three types of parameters that are unique for each vault. These unique parameters are to be set and get not for a vault’s address, but for a vault’s NFT in the VaultRegistry. An example of getting (the same works for setting) parameters having just the address of a vault:- Take a deployed VaultRegistry contract and call
nftForVault(address), whereaddressis the address of your vault. If the address is correct, you get an NFTnft - Take a corresponding Vault Governance contract and get the wanted parameters. For example, if your vault is ERC20RootVault, you can take the ERC20RootVaultGovernance deployed contract and call
delayedStrategyParams(nft), getting stated strategyParams for this vault
Aave VaultGovernance
delayedProtocolParams:UniV3 VaultGovernance
delayedProtocolParams:Yearn VaultGovernance
delayedProtocolParams:
As can be seen, Vault kinds on top of the other protocols have only delayedProtocolParams in which we set some basic addresses connected with those protocols which are needed to be called for all instances of this Vault kind.
ERC20 VaultGovernance and Mellow VaultGovernance have no parameters.
ERC20Root VaultGovernance
You might want to see what ERC20Root Vault serves for. strategyParams:
delayedStrategyParams:
protocolPerVaultParams:
delayedProtocolParams:
operatorParams: