Skip to content

Commit

Permalink
fix: Add getter for _stableRateExcessOffset
Browse files Browse the repository at this point in the history
  • Loading branch information
LHerskind committed Jan 21, 2022
1 parent 755abf7 commit 3586ebb
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -151,6 +151,15 @@ contract DefaultReserveInterestRateStrategy is IReserveInterestRateStrategy {
return _stableRateSlope2;
}

/**
* @notice Returns the stable rate excess offset
* @dev An additional premium applied to the stable when stable debt > OPTIMAL_STABLE_TO_TOTAL_DEBT_RATIO
* @return The stable rate excess offset
*/
function getStableRateExcessOffset() external view returns (uint256) {
return _stableRateExcessOffset;
}

/**
* @notice Returns the base stable borrow rate
* @return The base stable borrow rate
Expand Down
3 changes: 3 additions & 0 deletions test-suites/rate-strategy.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -377,6 +377,9 @@ makeSuite('InterestRateStrategy', (testEnv: TestEnv) => {
expect(await strategyInstance.MAX_EXCESS_STABLE_TO_TOTAL_DEBT_RATIO()).to.be.eq(
BigNumber.from(1).ray().sub(rateStrategyStableTwo.optimalStableToTotalDebtRatio)
);
expect(await strategyInstance.getStableRateExcessOffset()).to.be.eq(
rateStrategyStableTwo.stableRateExcessOffset
);
});

it('Deploy an interest rate strategy with optimalUsageRatio out of range (expect revert)', async () => {
Expand Down

0 comments on commit 3586ebb

Please sign in to comment.