StaticInterestRateOracle
Inherits: IInterestRateOracle
Title: StaticInterestRateOracle
Author: SocksNFlops
The StaticInterestRateOracle contract is a contract that returns a static interest rate for new Mortgages being originated.
State Variables
BPS_DECIMALS
The number of decimals for basis points
int8 public constant BPS_DECIMALS = 4
PAYMENT_PLAN_SPREAD
The spread for mortgages with a payment plan
uint16 public constant PAYMENT_PLAN_SPREAD = 100
NO_PAYMENT_PLAN_SPREAD
The spread for mortgages without a payment plan
uint16 public constant NO_PAYMENT_PLAN_SPREAD = 200
baseRate
The base rate (excluding spread)
uint16 public immutable baseRate
Functions
constructor
Constructor
constructor(uint16 baseRate_) ;
Parameters
| Name | Type | Description |
|---|---|---|
baseRate_ | uint16 | The base rate (excluding spread) |
interestRate
Returns the interest rate (in basis points) for a given total periods and amortization status
treasuryRate + 100 BPS spread (for mortgages with a payment plan)
treasuryRate + 200 BPS spread (for mortgages without a payment plan)
function interestRate(uint8 totalPeriods, bool hasPaymentPlan) external view override returns (uint16 rate);
Parameters
| Name | Type | Description |
|---|---|---|
totalPeriods | uint8 | The total number of periods for the mortgage |
hasPaymentPlan | bool | Whether the mortgage has a payment plan |
Returns
| Name | Type | Description |
|---|---|---|
rate | uint16 | The interest rate |
Errors
InvalidTotalPeriods
The error thrown when the total periods are invalid and not supported by the InterestRateOracle
error InvalidTotalPeriods(uint8 totalPeriods);
Parameters
| Name | Type | Description |
|---|---|---|
totalPeriods | uint8 | The total periods |