Borrowing
Smart Contract:[ThemisBorrowCompound.sol](Solidity-Open-Source/ThemisBorrowCompound.sol at main · Themis-protocol/Solidity-Open-Source · GitHub)
Functions
getUserMaxBorrowAmount
Get the max borrow amount of a user when the user trying to collateral the NFT
Parameters:
Name | Type | Description |
---|---|---|
pid | uint256 | the ID of borrowing pool |
tokenId | uint256 | NFT ID to collateral |
borrowAmount | uint256 | input of borrow amount |
_user | address | Wallet address of a user |
Returns:
Name | Type | Description |
---|---|---|
_maxBorrowAmount | uint256 | Max borrow amount |
_flag | bool | Over loan amount |
v3NFTBorrow
Parameters:
Name | Type | Description |
---|---|---|
pid | uint256 | Pool ID |
tokenId | uint256 | NFT ID to collateral |
borrowAmount | uint256 | borrow amount |
userReturn
Repayment the loan
Parameters:
Name | Type | Description |
---|---|---|
bid | uint256 | Borrow ID |
repayAmount | uint256 | repay amount |
getBorrowPoolIdsOfOwner
Get the pid of a user
Parameters:
Name | Type | Description |
---|---|---|
owner | address | wallet address of a user |
getBorrowIdsOfOwnerAndPoolId
Get the borrow id of the owner form pid when user get a loan
Parameters:
Name | Type | Description |
---|---|---|
owner | address | Wallet address of owner |
pid | uint256 | Owner's pid |
borrowInfo
Get the borrow id info
Parameters:
Name | Type | Description |
---|---|---|
bid | uint256 | borrow id |
Returns
Name | Type | Description |
---|---|---|
user | address | wallet address of user |
pid | uint256 | pool id of a loan |
tokenId | uint256 | Collateralized NFT token ID |
Last updated