Review Loan Requests

In order to gather information for a submitted loan that can be accepted, call the method bids(uint256) on the TellerV2 contract where the input parameter is the bid Id. This will return a 'Bid' data structure which contains the following:

/**
 * @notice Details about a loan request.
 * @param borrower Account address who is requesting a loan.
 * @param receiver Account address who will receive the loan amount.
 * @param lender Account address who accepted and funded the loan request.
 * @param marketplaceId ID of the marketplace the bid was submitted to.
 * @param metadataURI ID of off chain metadata to find additional information of the loan request.
 * @param loanDetails Struct of the specific loan details.
 * @param terms Struct of the loan request terms.
 * @param state Represents the current state of the loan.
 */
struct Bid {
    address borrower;
    address receiver;
    address lender; // if this is the LenderManager address, we use that .owner() as source of truth
    uint256 marketplaceId;
    bytes32 _metadataURI; // DEPRECATED
    LoanDetails loanDetails;
    Terms terms;
    BidState state;
    PaymentType paymentType;
}

/**
 * @notice Details about the loan.
 * @param lendingToken The token address for the loan.
 * @param principal The amount of tokens initially lent out.
 * @param totalRepaid Payment struct that represents the total principal and interest amount repaid.
 * @param timestamp Timestamp, in seconds, of when the bid was submitted by the borrower.
 * @param acceptedTimestamp Timestamp, in seconds, of when the bid was accepted by the lender.
 * @param lastRepaidTimestamp Timestamp, in seconds, of when the last payment was made
 * @param loanDuration The duration of the loan.
 */
struct LoanDetails {
    ERC20 lendingToken;
    uint256 principal;
    Payment totalRepaid;
    uint32 timestamp;
    uint32 acceptedTimestamp;
    uint32 lastRepaidTimestamp;
    uint32 loanDuration;
}

/**
 * @notice Information on the terms of a loan request
 * @param paymentCycleAmount Value of tokens expected to be repaid every payment cycle.
 * @param paymentCycle Duration, in seconds, of how often a payment must be made.
 * @param APR Annual percentage rating to be applied on repayments. (10000 == 100%)
 */
struct Terms {
    uint256 paymentCycleAmount;
    uint32 paymentCycle;
    uint16 APR;
}

Last updated