mirror of
https://github.com/Instadapp/aave-protocol-v2.git
synced 2024-07-29 21:47:30 +00:00
Fixed deprecated /test/ test suite
This commit is contained in:
parent
d131afb6a0
commit
5fe4603e3d
|
@ -1243,29 +1243,29 @@ export const calcExpectedInterestRates = (
|
|||
];
|
||||
|
||||
let stableBorrowRate: BigNumber = marketStableRate;
|
||||
let variableBorrowRate: BigNumber = new BigNumber(reserveConfiguration.baseVariableBorrowRate);
|
||||
let variableBorrowRate: BigNumber = new BigNumber(reserveConfiguration.strategy.baseVariableBorrowRate);
|
||||
|
||||
const optimalRate = new BigNumber(reserveConfiguration.optimalUtilizationRate);
|
||||
const optimalRate = new BigNumber(reserveConfiguration.strategy.optimalUtilizationRate);
|
||||
const excessRate = new BigNumber(RAY).minus(optimalRate);
|
||||
if (utilizationRate.gt(optimalRate)) {
|
||||
const excessUtilizationRateRatio = utilizationRate
|
||||
.minus(reserveConfiguration.optimalUtilizationRate)
|
||||
.minus(reserveConfiguration.strategy.optimalUtilizationRate)
|
||||
.rayDiv(excessRate);
|
||||
|
||||
stableBorrowRate = stableBorrowRate
|
||||
.plus(reserveConfiguration.stableRateSlope1)
|
||||
.plus(reserveConfiguration.strategy.stableRateSlope1)
|
||||
.plus(
|
||||
new BigNumber(reserveConfiguration.stableRateSlope2).rayMul(excessUtilizationRateRatio)
|
||||
new BigNumber(reserveConfiguration.strategy.stableRateSlope2).rayMul(excessUtilizationRateRatio)
|
||||
);
|
||||
|
||||
variableBorrowRate = variableBorrowRate
|
||||
.plus(reserveConfiguration.variableRateSlope1)
|
||||
.plus(reserveConfiguration.strategy.variableRateSlope1)
|
||||
.plus(
|
||||
new BigNumber(reserveConfiguration.variableRateSlope2).rayMul(excessUtilizationRateRatio)
|
||||
new BigNumber(reserveConfiguration.strategy.variableRateSlope2).rayMul(excessUtilizationRateRatio)
|
||||
);
|
||||
} else {
|
||||
stableBorrowRate = stableBorrowRate.plus(
|
||||
new BigNumber(reserveConfiguration.stableRateSlope1).rayMul(
|
||||
new BigNumber(reserveConfiguration.strategy.stableRateSlope1).rayMul(
|
||||
utilizationRate.rayDiv(new BigNumber(optimalRate))
|
||||
)
|
||||
);
|
||||
|
@ -1273,7 +1273,7 @@ export const calcExpectedInterestRates = (
|
|||
variableBorrowRate = variableBorrowRate.plus(
|
||||
utilizationRate
|
||||
.rayDiv(optimalRate)
|
||||
.rayMul(new BigNumber(reserveConfiguration.variableRateSlope1))
|
||||
.rayMul(new BigNumber(reserveConfiguration.strategy.variableRateSlope1))
|
||||
);
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user