To facilitate a smooth borrower's user experience, the TellerV2 Protocol has the following methods to help make repayments easier.
T=timestamp−lastRepaidTimestamp
P=loanPrincipal−repaidPrincipal
I= 365 daysT∗P∗APR
Get total amount owed
Borrowers can find out the total amount owed back to the protocol for their loan, through the calculateAmountOwed method, which returns the total principal plus interest owed on a loan.
/** * @notice Calculates the total amount owed for a bid. * @param _bidId The id of the loan bid to calculate the owed amount for. */functioncalculateAmountOwed(uint256_bidId)
Get minimum amount due
The minimum amount due is how much the borrower must pay back by the next due date in order to keep their loan in good standing. Each loan has a payment cycle duration which defines the length of time between payments.
/** * @notice Calculates the minimum payment amount due for a loan. * @param _bidId The id of the loan bid to get the payment amount for. */functioncalculateAmountDue(uint256_bidId)
Get next payment due date
Borrowers can manage their cash flow and budgets by calling the calculateNextDueDate , which will return the timestamp at which the next payment is due for their loan (before the loan is considered Delinquent).
/** * @notice Returns the next due date for a loan payment. * @param _bidId The id of the loan bid. */functioncalculateNextDueDate(uint256_bidId)
Check payment status
Borrowers can also check if their payment is late by calling the isPaymentLate method, which returns a boolean indicating if the borrower is delinquent or not.
/** * @notice Checks to see if a borrower is delinquent. * @param _bidId The id of the loan bid to check for. */functionisPaymentLate(uint256_bidId)