Getting Loan Information

To facilitate a smooth borrower's user experience, the TellerV2 Protocol has the following methods to help make repayments easier.

T=timestamplastRepaidTimestampT = timestamp - lastRepaidTimestamp
P=loanPrincipalrepaidPrincipalP = loanPrincipal - repaidPrincipal
I=TPAPR 365 daysI = \dfrac{ T * P * APR }{ \text{ 365 days} }

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.
 */
function calculateAmountOwed(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.
 */
function calculateAmountDue(uint256 _bidId)
Due=min(P+I,cyclePayment)Due = \min{ (P + I, cyclePayment) }

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.
 */
function calculateNextDueDate(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.
 */
function isPaymentLate(uint256 _bidId)

Last updated