Origination

This page describes the process for originating a new Cooler loan.

Cooler Loan origination begins with the borrower.

First, a borrower will create a Cooler for their desired collateral and debt token, given one does not exist already. They do so with the generate() function in the CoolerFactory:

/// @notice creates a new Escrow contract for collateral and debt tokens
function generate (ERC20 collateral, ERC20 debt) external returns (address cooler) {}

Note that calling generate() for a collateral/debt pair that already exists for the borrower will simply return the address of the escrow that they previously deployed.

Next, the borrower will create a loan Request. The Request specifies the loan terms that the borrower is looking for, including: the amount of debt tokens they wish to borrow, the percent of that amount they will pay as interest, the loan-to-collateral ratio they will back the loan with, and the duration of time until the loan must be repaid. Collateral is transferred into the Cooler when the loan Request is made.

/// @notice request a loan with given parameters
/// @notice collateral is taken at time of request
/// @param amount of debt tokens to borrow
/// @param interest to pay (annualized % of 'amount')
/// @param loanToCollateral debt tokens per collateral token pledged
/// @param duration of loan tenure in seconds
/// @return reqID requests index
function request (
    uint256 amount,
    uint256 interest,
    uint256 loanToCollateral,
    uint256 duration
) external returns (uint256 reqID) {}

A borrower can rescind their Request at any time before it has been cleared. They do this by calling the rescind() function and specifying the request ID.

/// @notice cancel a loan request and return collateral
function rescind (uint256 reqID) external {}

Finally, a loan is created when a lender clears a loan request. By doing so, the lender implicitly agrees to the requested terms. Debt tokens are transferred from the lender to the borrower, and the borrowers collateral is locked in the Cooler until the loan has been repaid.

/// @notice fill a requested loan as a lender
function clear (uint256 reqID) external returns (uint256 loanID) {

Last updated