CompoundedInterest
Constants
ONE_YEAR
uint96 internal constant ONE_YEAR = 365 days;
Functions
continuouslyCompounded
Calculate the continuously compounded interest given by: Pₜ = P₀eʳᵗ
function continuouslyCompounded(
uint256 principal,
uint256 elapsedSecs,
uint96 interestRatePerYear
) internal pure returns (uint256 result);
Parameters
| Name | Type | Description |
|---|---|---|
| principal | uint256 | The principal amount, in 18 decimal places |
| elapsedSecs | uint256 | The elapsed seconds |
| interestRatePerYear | uint96 | The interest rate per year, in 18 decimal places |
Returns
| Name | Type | Description |
|---|---|---|
| result | uint256 |