LoanTermsConsensus Contracts
Contracts for validating consensus for loan terms
Teller utilizes nodes in order to sign borrower and lender requests before they can be accepted on-chain. The consensus contracts for Teller validate responses from the nodes in congruence with the borrower's request, this allows them to then facilitate or disburse the loan.
The main external function for both of these contracts is the processRequest()
method that processes the loan request, or the request for accrued interest, to ensure it is in line with current protocol settings and response variability.
Internally, the contract calls the _getConsensus()
method that checks if all the node values are within the tolerance set on the platform in order to retrieve the average of those values and set them on-chain.
The loan terms consensus contracts handle all borrower requests for loans and the related responses from the nodes handling Loan Terms
processLoanTerms()
function(
TellerCommon.LoanRequest calldata request,
TellerCommon.LoanResponse[] calldata responses,
)
TellerCommon.LoanRequest
is a request struct/object that is sent to the Teller Nodes and subsequently on-chain, with all the required entries such as:
Variable | Type | Description |
|
| The wallet address of the borrower |
|
| The address where funds will be sent, only applicable in over collateralized loans |
|
| The address of the Teller loan consensus contract to which the request should be sent |
|
| The nonce of the borrower wallet address required for authentication |
|
| The number of tokens requested by the borrower for the loan |
|
| The length of time in seconds that the loan has been requested for |
|
| The timestamp at which the loan was requested |
TellerCommon.LoanResponse[]
is an array of signed response structs/objects that are returned from registered Teller nodes. These signed response structs/objects need to be passed on-chain in order to register the loan terms on-chain.
Variable | Type | Description |
|
| The wallet address of the signer validating the interest request of the lender |
|
| The address of the Teller loan consensus contract to which the request should be sent |
|
| The timestamp at which the response was sent |
|
| The signed interest rate generated by the signer's Credit Risk Algorithm (CRA) |
|
| The ratio of collateral to loan amount that is generated by the signer's Credit Risk Algorithm (CRA) |
|
| The largest amount of tokens that can be taken out in the loan by the borrower |
|
| The signature generated by the signer in the format of the below Signature struct |
Last updated