Create Commitment
Lenders can pre-commit capital using specific collateralization requirements so that borrowers can instantly create loans using that capital without having to wait for the lender to manually accept.
Create a Loan Commitment
A new commitment will be created using the specified parameters. This commitment represents the lenders (msg sender) willingness to provide principal towards loans.
Commitment Data Structure
maxPrincipal
- The amount of capital to commit, specified in base units of the principal token.
principalTokenAddress
- The contract address of the principal token currency
marketId
- The id for the Teller lending market that this commitment may be used for
lender
- The address of the lender (must be msg.sender when creating new commitments)
maxDuration
- The duration for loans which are created using this commitment
minInterestRate
- The interest rate for loans which are created using this commitment
expiration
- The unix timestamp (seconds) after which time no new loans can be created using this commitment
collateralTokenAddress
- The contract address of the collateral token
collateralTokenType
- The type of collateral, specified by an Enum (see CommitmentCollateralType)
collateralTokenId
- The tokenId of the collateral, used if the type is ERC721 or ERC1155
maxPrincipalPerCollateralAmount
- The amount of principal that a loan is allowed to borrow per the collateral amount provided. This amount is expanded by both the principal token decimals and the collateral token decimals. Use the helper function in ‘Teller Math Lib’ to help compute this value.
Commitment Collateral Type
NONE
- This commitment requires no collateralization
ERC20
- The collateral is a standard ERC20 token
ERC721
- The collateral is a standard ERC712 token and a specific tokenId is required
ERC1155
- The collateral is a standard ERC 1155 token and a specific tokenId is required
ERC721_ANY_ID
- The collateral is a standard ERC712 token and any tokenId can be used (tokenId is ignored)
ERC1155_ANY_ID
- The collateral is a standard ERC1155 token and any tokenId can be used (tokenId is ignored)
Last updated