Skip to content

Commit

Permalink
refactor: remove bounded average
Browse files Browse the repository at this point in the history
  • Loading branch information
MerlinEgalite committed Nov 13, 2023
1 parent abf841b commit 08a6921
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/SpeedJumpIrm.sol
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,7 @@ contract AdaptativeCurveIrm is IIrm {
avgBorrowRate = uint256((int256(endBorrowRate) - int256(startBorrowRate)).wDivDown(linearAdaptation));
}

return (avgBorrowRate.bound(MIN_RATE_AT_TARGET, MAX_RATE_AT_TARGET), endRateAtTarget);
return (avgBorrowRate, endRateAtTarget);
}
}

Expand Down
2 changes: 1 addition & 1 deletion test/SpeedJumpIrmTest.sol
Original file line number Diff line number Diff line change
Expand Up @@ -252,7 +252,7 @@ contract AdaptativeCurveIrmTest is Test {
avgBorrowRate =
uint256((int256(newBorrowRate) - int256(_curve(rateAtTarget, err))).wDivDown(linearAdaptation));
}
return avgBorrowRate.bound(irm.MIN_RATE_AT_TARGET(), irm.MAX_RATE_AT_TARGET());
return avgBorrowRate;
}

function _curve(uint256 rateAtTarget, int256 err) internal pure returns (uint256) {
Expand Down

0 comments on commit 08a6921

Please sign in to comment.