Loan

Loan Structures

LoanSupplyData Struct

This struct represents initial information related to a loan when collateral is supplied to a lender within Concrete protocol.

This information is set in SetSupplyDataAction (link pending)

Pointer: USER_INDEX_TO_LOANSUPPLYDATA

Definition

struct LoanSupplyData {
        uint256 loanId;
        address loanHolder;
        uint256 portfolioId;
        uint256 startDate;
        string lender;
        uint256 suppliedAmount;
        address collateralAddress;
        address lenderTokenAddress;
        uint256 decimals;
        uint256 chainId;
    }

Fields

  • loanId: A unique identifier for the loan within the protocol.

  • loanHolder The address of the user holding the loan.

  • portfolioId: A unique Identifier for the portfolio associated with the loan.

  • startDate: The timestamp indicating when the loan was created.

  • lender: The identification of the lender involved (Aave, Compound, etc).

  • collateralAddress: The address of the collateral associated.

  • lenderTokenAddress: The lender platforms interest token.

  • decimals: The decimals of the supplied token.

  • chainId: The chain id of the loans position.


LoanUpdate Struct

This struct provides information related to the modification and status of a collateralized loan within Concrete protocol. This information is set in SetLoanUpdateAction (link pending)

Pointer: USER_INDEX_TO_LOANUPDATE

Definition

struct LoanUpdate {
        uint256 loanId;
        uint256 portfolioId;
        address debtTokenAddress;
        uint256 collateralBalance;
        uint256 currentLoanBalance;
        LoanStatus loanStatus;
    }

Fields

  • loanId: A unique identifier for the loan within the protocol.

  • portfolioId: A unique Identifier for the portfolio associated with the loan.

  • debtTokenAddress: The address of the debt token associated.

  • collateralBalance: The current balance of collateral associated with the loan.

  • currentLoanBalance: The current balance of the loan.

  • loanStatus: see LoanStatus


LoanStatus Enum

An enum representing the current status of the loan.

Definition

enum LoanStatus {
    INITIATED,
    COVERED,
    UNCOVERED,
    CLAIM_INITIATED,
    CONCRETE_MANAGED,
    SUCCESSFULLYCLOSED,
    LIQUIDATED,
    FORECLOSURE
}

UpdateField Enum

An enum representing the field to be updated in LoanUpdate.

This value is send as an argument inSetLoanUpdateAction (link pending).

Definition

enum UpdateField {
    COLLATERAL_BALANCE,
    CURRENT_LOAN_BALANCE,
    LOAN_STATUS,
    ALL
}

Values

  • COLLATERAL_BALANCE: Updates collateralBalance.

  • CURRENT_LOAN_BALANCE: Updates currentLoanBalance.

  • LOAN_STATUS: Updates loanStatus.

  • ALL: Updates all three fields.


LoanBorrowData Struct

This struct represents information related to a borrow associated with a loan within the Concrete protocol.

This information is set in SetBorrowDataAction (link pending)

Pointer: USER_INDEX_TO_BORROWDATA

Definition

struct LoanBorrowData {
        uint256 loanId;
        uint256 portfolioId;
        address loanHolder;
        uint256 startDate;
        address debtTokenAddress;
        uint256 loanAmount;
        uint256 rateMode;
        uint8 decimals;
        uint256 foreclosureFee;
    }

Fields

  • loanId: A unique identifier for the loan within the protocol.

  • loanHolder The address of the user holding the loan.

  • portfolioId: A unique Identifier for the portfolio associated with the loan.

  • startDate: The timestamp indicating when the borrow was created.

  • debtTokenAddress: The address of the debt token associated.

  • rateMode: The rate mode of the loan, indicating whether it is a fixed or variable-rate loan.

  • decimals: The decimals of the borrowed token.

  • foreclosureFee: The fee associated with a users' loan when foreclosed.


LoanInitialData Struct

This struct in a partial version of LoanSupplyData to represent initial supply data to avoid 'Stack Too Deep' error.

This struct is send as an argument inSetSupplyDataAction (link pending)

Definition

struct InitialLoanData {
        address loanHolder;
        string lender;
        uint256 suppliedAmount;
        address collateralAddress;
        address lenderTokenAddress;
        uint256 decimals;
        uint256 chainId;
    }

Fields

  • loanHolder The address of the user holding the loan.

  • lender: The identification of the lender involved (Aave, Compound, etc).

  • suppliedAmount: The amount of assets supplied to the lender.

  • collateralAddress: The address of the collateral associated.

  • lenderTokenAddress: The lender platforms interest token.

  • decimals: The decimals of the supplied token.

  • chainId: The chain id of the loans position.

Last updated