Structs

This page details the data structures of a Cooler.

Cooler's have two data structures, the Request and the Loan.

Requests store terms for a potential loan.

Request[] public requests;
struct Request { // A loan begins with a borrow request. It specifies:
    uint256 amount; // the amount they want to borrow,
    uint256 interest; // the percentage they will pay as interest,
    uint256 loanToCollateral; // the loan-to-collateral ratio they want,
    uint256 duration; // and the length of time until the loan defaults.
    bool active; // Any lender can clear an active loan request.
} 

Loans store terms for an active loan.

Loan[] public loans;
struct Loan { // A request is converted to a loan when a lender clears it.
    Request request; // The terms of the loan are saved, along with:
    uint256 amount; // the amount of debt owed,
    uint256 collateral; // the amount of collateral pledged,
    uint256 expiry; // the time when the loan defaults,
    bool rollable; // whether the loan can be rolled over,
    address lender; // and the lender's address.
}

Last updated