Lending
Smart Contract:[ThemisLendCompound.sol](Solidity-Open-Source/ThemisLendCompound.sol at main · Themis-protocol/Solidity-Open-Source · GitHub)
mapping(address => uint256) public tokenOfPid;
Get
token address
and its pool id
Parameters:
Name | Type | Description |
---|---|---|
address | address | token address |
CompoundLendPool[] public lendPoolInfo;
Get info of the lending pool
Parameters:
Name | Type | Description |
---|---|---|
pid | uint256 | Pool Id of the token |
Returns:
Name | Type | Description |
---|---|---|
token | address | Token Address |
spToken | address | SP Token Address |
curSupply | uint256 | current supply in pool |
curBorrow | uint256 | current borrowing of pool |
totalRecvInterests | uint256 | User receives interest |
function userLend(
uint256 _pid,
uint256 _amount) public nonReentrant whenNotPaused
Borrowing
Token
from the Lendingpool contractParameters:
Name | Type | Description |
---|---|---|
_pid | uint256 | Pool Id of the token |
_amount | uint256 | the amount to lend |
function userRedeem(
uint256 _pid,
uint256 _amount) public nonReentrant whenNotPaused
returns(uint256)
Repay the loan
Parameters:
Name | Type | Description |
---|---|---|
_pid | uint256 | Pool Id of the token |
_amount | uint256 | the repayent amount |
function pendingRedeemInterests(
uint256 _pid,
address _user)
public view returns(
uint256 _lendInterests,
uint256 _platFormInterests)
Query the pending redeemed Interests of a
user address
Parameters:
Name | Type | Description |
---|---|---|
_pid | uint256 | Pool Id of the token |
_user | address | Wallet address of a user |
function getPoolLength()
external view returns(uint256 poolLength)
Get the pool length of pool
function getLendPoolIdsOfOwner(
address owner) external view returns (uint256[] memory)
Get the lend
pool ids
of ownerParameters:
Name | Type | Description |
---|---|---|
owner | address | Wallet address of a user |
Last modified 1yr ago