Skip to content

Commit

Permalink
Merge pull request #6 from DODOEX/rate-check
Browse files Browse the repository at this point in the history
fix borrowRate limit
  • Loading branch information
Attens1423 authored Jan 9, 2024
2 parents 86bb2be + df9a87b commit e944ca7
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions contracts/DODOV3MM/D3Vault/periphery/D3RateManager.sol
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,8 @@ contract D3RateManager is Ownable {
/// @param utilizationRatio Token utilization rate.
function getBorrowRate(address token, uint256 utilizationRatio) public view returns (uint256 rate) {
RateStrategy memory s = rateStrategyMap[token];
// notice! limit utilizationRatio <= 100%
utilizationRatio = utilizationRatio > 1e18 ? 1e18 : utilizationRatio;
if (utilizationRatio <= s.optimalUsage) {
rate = s.baseRate + utilizationRatio.mul(s.slope1);
} else {
Expand Down

0 comments on commit e944ca7

Please sign in to comment.