Updated DefaultInterestRateStrategy

This commit is contained in:
The3D 2020-11-19 17:17:11 +01:00
parent 56d25e81cb
commit 3f5822f5f6
5 changed files with 3289 additions and 1630 deletions

View File

@ -31,7 +31,7 @@ contract ATokensAndRatesHelper is Ownable {
function initDeployment(
address[] calldata tokens,
string[] calldata symbols,
uint256[5][] calldata rates,
uint256[][6] calldata rates,
address incentivesController
) external onlyOwner {
require(tokens.length == symbols.length, 't Arrays not same length');
@ -55,7 +55,8 @@ contract ATokensAndRatesHelper is Ownable {
rates[i][1],
rates[i][2],
rates[i][3],
rates[i][4]
rates[i][4],
rates[i][5]
)
)
);

View File

@ -23,7 +23,7 @@ contract DefaultReserveInterestRateStrategy is IReserveInterestRateStrategy {
* @dev this constant represents the utilization rate at which the pool aims to obtain most competitive borrow rates
* expressed in ray
**/
uint256 public constant OPTIMAL_UTILIZATION_RATE = 0.8 * 1e27;
uint256 public immutable OPTIMAL_UTILIZATION_RATE;
/**
* @dev this constant represents the excess utilization rate above the optimal. It's always equal to
@ -31,7 +31,7 @@ contract DefaultReserveInterestRateStrategy is IReserveInterestRateStrategy {
* expressed in ray
**/
uint256 public constant EXCESS_UTILIZATION_RATE = 0.2 * 1e27;
uint256 public immutable EXCESS_UTILIZATION_RATE;
LendingPoolAddressesProvider public immutable addressesProvider;
@ -52,12 +52,16 @@ contract DefaultReserveInterestRateStrategy is IReserveInterestRateStrategy {
constructor(
LendingPoolAddressesProvider provider,
uint256 optimalUtilizationRate,
uint256 baseVariableBorrowRate,
uint256 variableRateSlope1,
uint256 variableRateSlope2,
uint256 stableRateSlope1,
uint256 stableRateSlope2
) public {
OPTIMAL_UTILIZATION_RATE = optimalUtilizationRate;
EXCESS_UTILIZATION_RATE = WadRayMath.ray().sub(optimalUtilizationRate);
addressesProvider = provider;
_baseVariableBorrowRate = baseVariableBorrowRate;
_variableRateSlope1 = variableRateSlope1;

View File

@ -321,12 +321,8 @@ export enum EthereumNetwork {
}
export interface IProtocolGlobalConfig {
OptimalUtilizationRate: BigNumber;
ExcessUtilizationRate: BigNumber;
ApprovalAmountLendingPoolCore: string;
TokenDistributorPercentageBase: string;
MockUsdPriceInWei: string;
EthereumAddress: tEthereumAddress;
UsdAddress: tEthereumAddress;
NilAddress: tEthereumAddress;
OneAddress: tEthereumAddress;

View File

@ -33,12 +33,8 @@ export const CommonsConfig: ICommonConfiguration = {
ConfigName: 'Commons',
ProviderId: 0,
ProtocolGlobalParams: {
OptimalUtilizationRate: new BigNumber(0.8).times(RAY),
ExcessUtilizationRate: new BigNumber(0.2).times(RAY),
ApprovalAmountLendingPoolCore: '1000000000000000000000000000',
TokenDistributorPercentageBase: '10000',
MockUsdPriceInWei: '5848466240000000',
EthereumAddress: '0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE',
UsdAddress: '0x10F7Fc1F91Ba351f9C629c5947AD69bD03C05b96',
NilAddress: '0x0000000000000000000000000000000000000000',
OneAddress: '0x0000000000000000000000000000000000000001',

4898
package-lock.json generated

File diff suppressed because it is too large Load Diff