ProtocolConfig
This contract defines a set of configurable parameters that are used throughout the protocol. It also defines a set of setter functions for these parameters that can be called by the contract owner.
State Variables
The state variables of this contract are as follows:
feeManager
: an instance of theIFeeManager
interface that manages the fees charged by the protocol.depositFee
: auint256
that represents the deposit fee charged by the protocol as a percentage of the deposited amount (default is 0.5% or 50 basis points).withdrawFee
: auint256
that represents the withdrawal fee charged by the protocol as a percentage of the withdrawn amount (default is 0.5% or 50 basis points).rewardFee
: auint256
that represents the reward fee charged by the protocol as a percentage of the total reward amount (default is 10% or 1000 basis points).withdrawVaultFee
: auint256
that represents the withdrawal fee charged by the protocol's liquidity vault (default is 1% or 100 basis points).withdrawVaultFeeWindow
: auint256
that represents the time window during which the withdrawal fee charged by the protocol's liquidity vault is applied (default is 60 days).withdrawVaultFeeWindowStartTime
: auint256
that represents the start time of the window during which the withdrawal fee charged by the protocol's liquidity vault is applied (default is 0).maxSlippageOfClose
: auint256
that represents the maximum slippage of converting withdrawn reserves to debt tokens when closing a position (default is 3% or 300 basis points).treasuryFeeRate
: auint256
that represents the percentage of the deposit/withdraw fee that is directed to the protocol's treasury (default is 0.15% or 30 basis points). *NOT UTILIZED IN THIS VERSION YET*blbStablePoolFeeRate
: auint256
that represents the percentage of the deposit/withdraw fee that is directed to the protocol's stability pool (default is 0.175% or 35 basis points). *NOT UTILIZED IN THIS VERSION YET*treasury
: anaddress
that represents the wallet address of the protocol's treasury.blbUsdcIchiVault
: anaddress
that represents the address of the protocol's fee split for ICHI vault. *NOT UTILIZED IN THIS VERSION YET*blbStabilityPool
: anaddress
that represents the address *NOT UTILIZED IN THIS VERSION YET*
Functions
initialize
This function is the initializer function which is called once when the contract is deployed. It sets the initial values for the contract's state variables such as depositFee, withdrawFee, rewardFee, treasuryFeeRate, blbStablePoolFeeRate, blbIchiVaultFeeRate, withdrawVaultFee, maxSlippageOfClose, and treasury. The treasury_
argument is used to set the treasury address for the contract.
startVaultWithdrawFee
This function is called by the owner to start the timer for the vault withdraw fee window. It sets the withdrawVaultFeeWindowStartTime
to the current block timestamp.
setDepositFee
This function is called by the owner to set the deposit fee on isolated collateral provided when opening a leverage position. It sets the deposit fee to the specified depositFee_
argument, which is capped at 20%.
setWithdrawFee
This function is called by the owner to set the withdraw fee on isolated collateral provided when opening a leverage position. It sets the withdraw fee to the specified withdrawFee_
argument, which is capped at 20%.
setWithdrawVaultFeeWindow
This function is called by the owner to set the withdraw fee window for vaults on collateral supplied to vaults. It sets the window to the specified withdrawVaultFeeWindow_
argument, which is capped at 60 days.
setMaxSlippageOfClose
This function is called by the owner to set the maximum slippage of converting withdrawn reserves to debt tokens when closing position. It sets the maxSlippageOfClose
to the specified slippage_
argument, which is capped at 20%.
setRewardFee
This function is called by the owner to set the reward fee. This fee applies to any rewards that are earned through a leverage position. It sets the reward fee to the specified rewardFee_
argument, which is capped at 20%.
setFeeDistribution *Not Used in this version yet*
This function is called by the owner to set the fee distribution rates. It sets the treasuryFeeRate
, blbStablePoolFeeRate
, and blbIchiVaultFeeRate
variables to the specified arguments, and checks that the sum of these values is equal to the DENOMINATOR
constant defined in the BlueBerryConst.sol
library.
setTreasuryWallet
This function is called by the owner to set the treasury address for the contract. It sets the treasury
variable to the specified treasury_
argument.
setFeeManager
This function is called by the owner to set the fee manager address for the contract. It sets the feeManager
variable to the specified feeManager_
argument.
setBlbUsdcIchiVault *Not used in this version yet*
This function is called by the owner to set the $BLB liquidity pool against stablecoins address for the contract. It sets the blbUsdcIchiVault
variable to the specified vault_
argument.
setBlbStabilityPool *Not used in this version yet*
This function is called by the owner to set the $BLB liquidity pool against stablecoins address for the contract. It sets the blbStabilityPool
variable to the specified pool_
argument.
Last updated