BasePricing
Inherits: Pricing
Functions
validate
function validate(Starport.Loan calldata loan) external view virtual override returns (bytes4);
getPaymentConsideration
function getPaymentConsideration(Starport.Loan calldata loan)
public
view
virtual
override
returns (SpentItem[] memory repayConsideration, SpentItem[] memory carryConsideration);
getInterest
Computes the interest for a given loan
function getInterest(
Starport.Loan calldata loan,
uint256 rate,
uint256 start,
uint256 end,
uint256 index,
uint256 decimals
) public pure returns (uint256);
Parameters
Name | Type | Description |
---|---|---|
loan | Starport.Loan | The loan to compute the interest for |
rate | uint256 | The interest rate |
start | uint256 | The start time frame |
end | uint256 | The end time frame |
index | uint256 | The index of the debt to compute the interest for |
decimals | uint256 | The decimals of the debt asset |
calculateInterest
Computes the interest
function calculateInterest(uint256 delta_t, uint256 amount, uint256 rate, uint256 decimals)
public
pure
virtual
returns (uint256);
Parameters
Name | Type | Description |
---|---|---|
delta_t | uint256 | The time delta |
amount | uint256 | The amount to compute the interest for |
rate | uint256 | The interest rate |
decimals | uint256 | The decimals of the base asset |
Structs
Details
struct Details {
uint256 rate;
uint256 carryRate;
uint256 decimals;
}