Servicing and Default

This page describes the process for servicing debt and handling defaults.

Once a loan request has been cleared, an active loan exists. For the duration of the loan, the borrower can choose to repay or roll their loan. Once the loan has expired, the lender can take the loan collateral.

Repayment is relatively simple. While a loan remains active, the borrower can repay an amount of debt tokens to reclaim a pro-rata share of their collateral. For example, if a borrower requested and was lent 1,000 DAI with 2% interest, they could repay 1,020 DAI (1,000 + 2%) for all of their collateral back, 510 DAI for half their collateral back, or any other amount at the same proportions.

Repayment occurs when the borrower calls the repay() function, specifying the loan and amount of debt tokens to repay.

/// @notice repay a loan to recoup collateral
/// @param loanID index of loan to repay
/// @param repaid debt tokens to repay
function repay (uint256 loanID, uint256 repaid) {}

A borrower can also choose to roll their loan. This extends the loan at origination terms. This is done by calling the roll() function and specifying the loan identifier.

/// @notice roll a loan over
/// @notice uses terms from request
function roll (uint256 loanID) external {}

Rollover can be blocked by the lender by calling the toggleRoll() function. The current ability to roll a loan can be checked on the loans array by querying loans[loanID]. If 'rollable' is true, calling toggleRoll() as the lender will prevent the loan from being rolled over; the same is true in the inverse.

/// @notice change 'rollable' status of loan
/// @return bool new 'rollable' status
function toggleRoll(uint256 loanID) external returns (bool) {}

When the loan's expiry timestamp has eclipsed, the loan is considered to be in default. At this point, the borrower can no longer repay their loan to reclaim the collateral. The borrower will retain the debt tokens and the lender will claim their collateral. This is done by calling the defaulted() function and specifying the loan identifier. This function returns the amount of collateral claimed.

/// @notice send collateral to lender upon default
/// @param loanID of defaulted loan
/// @return uint256 collateral amount
function defaulted (uint256 loanID) external returns (uint256) {}

Last updated