InterestRateModel lets you:
- Compute the per-second borrow rate for a given utilization and book
- Round interest up so debt never accrues slower than the curve
- Reject utilization above 100% or an invalid kink
InterestRateModel is a Solidity library. It is linked into the contracts that use it and has no address of its own.
The source code is src/core/InterestRateModel.sol on GitHub. The ABI is /abis/InterestRateModel.json.
Pure functions
rate
baseRate + slopeBelowKink * u / kink. Above it the rate is baseRate + slopeBelowKink + slopeAboveKink * (u - kink) / (1 - kink). Reverts with UtilizationAboveWad above 1e18 and InvalidKink unless 0 < kink < 1e18.
Internal function. Divisions round up against the borrower. Parameters are already per-second; the library does not convert from APY.
Return values
_mulDivUp
ceil(a * b / d). Borrow interest rounds against the borrower.
Return values