Offer types
1. Summary
A lender can choose between two types while making an offer. Basic and flexible.
2. Offer Types Detailed
Basic
The Basic offer is where the lender sets all loan parameters up-front and the borrower has an option to accept or not. Nothing else.
Offer
struct has these properties:
Type | Name | Comment |
---|---|---|
|
| Address of an asset used as a collateral |
|
| Category of an asset used as a collateral (0 == ERC20, 1 == ERC721, 2 == ERC1155) |
|
| The Amount of tokens used as collateral, in the case of ERC721 should be 1 |
|
| Token id of an asset used as collateral, in the case of ERC20 should be 0 |
|
| Address of an asset which is lent to a borrower |
|
| Amount of tokens which is offered as a loan to a borrower |
|
| Amount of tokens that acts as a lender's loan interest. Borrower has to pay back borrowed amount + yield |
|
| Loan duration in seconds |
|
| Offer expiration timestamp in seconds |
|
| Address of a lender. This address has to sign an offer to be valid |
|
| Additional value to enable identical offers in time. Without it, it would be impossible to make again an offer, which was once revoked |
With the flexible offer struct, we change the collateralId
, loanAmount
, loanYield
and duration
parameters to a range of these parameters.
Flexible
With flexible offers, lenders can give borrowers additional flexibility by not providing concrete values but rather giving borrower ranges for several parameters. When accepting an offer, a borrower has to provide concrete values to proceed. This increases a lender's chance of accepting their offer as it could be accepted by more borrowers.
FlexibleOffer
struct has these properties:
Type | Name | Comment |
---|---|---|
|
| Address of an asset used as a collateral |
|
| Category of an asset used as a collateral (0 == ERC20, 1 == ERC721, 2 == ERC1155) |
|
| The Amount of tokens used as collateral, in the case of ERC721 should be 0 |
|
| Root of a merkle tree constructed on an array of whitelisted collateral ids |
|
| Address of an asset which is lent to a borrower |
|
| Max amount of tokens which is offered as a loan to borrower |
|
| Min amount of tokens which is offered as a loan to borrower |
|
| Amount of tokens which acts as a lender's loan interest for max duration. |
|
| Maximal loan duration in seconds |
|
| Minimal loan duration in seconds |
|
| Offer expiration timestamp in seconds |
|
| Address of a lender. This address has to sign an offer to be valid. |
|
| Additional value to enable identical offers in time. Without it, it would be impossible to make again an offer, which was once revoked |
Flexible offers enable lenders to create an offer for a whole NFT collection.
Don't know what a merkle tree is? Read this article for more information.
Flexible offer values
When a borrower decides to accept a flexible offer they have to provide a specific representation of the offer. They do this by providing FlexibleOfferValues
struct as the second argument for the createLoanFlexible
function.
FlexibleOfferValues
struct has these properties:
Type | Name | Comment |
---|---|---|
|
| Collateral token id. Ignored if it’s not a collection offer |
|
| Loan asset amount (always ERC20) in range <loanAmountMin; loanAmountMax> |
|
| Offered loan duration in range <durationMin; durationMax> |
|
| Proof that selected collateralId is indeed in the Merkle tree with root in signed flexible offer |
How is the loan repay amount calculated?
loanAmount
- Loan asset amount (always ERC20) in range <loanAmountMin; loanAmountMax>loanYieldMax
- Amount of tokens which acts as a lender's loan interest for max durationduration
- Offered loan duration in range <durationMin; durationMax>durationMax
- Maximum loan duration in seconds
Last updated