IPrimaryLendingPlatform
Overview
License: MIT
Structs info
Ratio
ProjectTokenInfo
LendingTokenInfo
DepositPosition
BorrowPosition
Functions info
grantRole (0x2f2ff15d)
Grants the role to a new account.
Parameters:
revokeRole (0xd547741f)
Revokes the moderator role from an account.
Parameters:
setPrimaryLendingPlatformModeratorModerator (0xa0290239)
Sets the address of the new moderator contract by the admin.
Parameters:
setPriceOracle (0x530e784f)
Sets the address of the new price oracle by the moderator contract.
Parameters:
setPrimaryLendingPlatformLeverage (0xa1ab5419)
Sets the address of the new primary index token leverage contract by the moderator contract.
Parameters:
setRelatedContract (0xdcb4252a)
Sets whether an address is a related contract or not by the moderator contract.
Parameters:
removeProjectToken (0x3af44bfa)
Removes a project token from the list by the moderator contract.
Parameters:
removeLendingToken (0xc1ab02ee)
Removes a lending token from the list by the moderator contract.
Parameters:
setBorrowLimitPerCollateralAsset (0x8e85cdfa)
Sets the borrow limit per collateral by the moderator contract.
Parameters:
setBorrowLimitPerLendingAsset (0x92a39190)
Sets the borrow limit per lending asset by the moderator contract.
Parameters:
setProjectTokenInfo (0x4a5333bc)
Sets the parameters for a project token
Parameters:
setLendingTokenInfo (0x821363a0)
Sets the bLendingToken and paused status of a lending token.
Parameters:
deposit (0x47e7ef24)
Deposits project tokens and calculates the deposit position.
Parameters:
depositFromRelatedContracts (0xbf423b75)
Deposits project tokens on behalf of a user from a related contract and calculates the deposit position.
Parameters:
calcAndTransferDepositPosition (0x556d4704)
Decreases the deposited project token amount of the user's deposit position by the given amount, transfers the given amount of project tokens to the receiver, and returns the amount transferred.
Parameters:
Return values:
calcDepositPosition (0xdf5e6bed)
Calculates the deposit position for a user's deposit of a given amount of a project token.
Parameters:
withdraw (0xf3fef3a3)
Allows a user to withdraw a given amount of a project token from their deposit position.
Parameters:
withdrawFromRelatedContracts (0x1132a65f)
Allows a related contract to initiate a withdrawal of a given amount of a project token from a user's deposit position.
Parameters:
Return values:
withdraw (0x127b642e)
Allows a user to withdraw a given amount of a project token from their deposit position.
Parameters:
withdrawFromRelatedContracts (0x9afab2ec)
Allows a related contract to initiate a withdrawal of a given amount of a project token from a user's deposit position.
Parameters:
Return values:
borrow (0xf6c0b770)
Allows a user to borrow lending tokens by providing project tokens as collateral.
Parameters:
borrowFromRelatedContract (0x07f4a25c)
Allows a related contract to borrow lending tokens on behalf of a user by providing project tokens as collateral.
Parameters:
Return values:
borrow (0x5224372c)
Allows a user to borrow lending tokens by providing project tokens as collateral.
Parameters:
borrowFromRelatedContract (0x284a211e)
Allows a related contract to borrow lending tokens on behalf of a user by providing project tokens as collateral.
Parameters:
Return values:
getCollateralAvailableToWithdraw (0x72620613)
Calculates the collateral available for withdrawal based on the loan-to-value ratio of a specific project token.
Parameters:
Return values:
supply (0xd07ab026)
Supplies a specified amount of a lending token to the platform.
Allows a user to supply a specified amount of a lending token to the platform.
Parameters:
Requirements:
The lending token is listed.
The lending token is not paused.
The lending token amount is greater than 0.
Minting the bLendingTokens is successful and the minted amount is greater than 0.
Effects:
Mints the corresponding bLendingTokens and credits them to the user. |
supplyFromRelatedContract (0xac160433)
Supplies a certain amount of lending tokens to the platform from a specific user.
Requirements:
The lending token is listed.
Called by a related contract.
The lending token is not paused.
The lending token amount is greater than 0.
Minting the bLendingTokens is successful and the minted amount is greater than 0.
Effects:
Mints the corresponding bLendingTokens and credits them to the user.
Parameters:
redeem (0xe9bae8a8)
Redeems a specified amount of bLendingToken from the platform.
Function that performs the redemption of bLendingToken and returns the corresponding lending token to user.
Requirements:
The lendingToken is listed.
The lending token should not be paused.
The bLendingTokenAmount should be greater than zero.
The redemption of bLendingToken should not result in a redemption error.
Effects:
Burns the bLendingTokens from the user.
Transfers the corresponding lending tokens to the user.
Parameters:
redeemFromRelatedContract (0xa62b7bd7)
Function that performs the redemption of bLendingToken on behalf of a user and returns the corresponding lending token to the user by related contract.
Requirements:
The lendingToken is listed. _ - Called by a related contract.
The lending token should not be paused.
The bLendingTokenAmount should be greater than zero.
The redemption of bLendingToken should not result in a redemption error.
Effects:
Burns the bLendingTokens from the user.
Transfers the corresponding lending tokens to the user.
Parameters:
redeemUnderlying (0xb78deb78)
Redeems a specified amount of lendingToken from the platform.
Function that performs the redemption of lending token and returns the corresponding underlying token to user.
Requirements:
The lending token is listed.
The lending token should not be paused.
The lendingTokenAmount should be greater than zero.
The redemption of lendingToken should not result in a redemption error.
Effects:
Transfers the corresponding underlying tokens to the user.
Parameters:
redeemUnderlyingFromRelatedContract (0x3898b641)
Function that performs the redemption of lending token on behalf of a user and returns the corresponding underlying token to the user by related contract.
Requirements:
The lending token is listed.
Called by a related contract.
The lending token should not be paused.
The lendingTokenAmount should be greater than zero.
The redemption of lendingToken should not result in a redemption error.
Effects:
Transfers the corresponding underlying tokens to the user.
Parameters:
calcBorrowPosition (0x2dfee307)
Allows a related contract to calculate the new borrow position of a user.
Parameters:
getLendingAvailableToBorrow (0x07445b52)
Calculates the lending token available amount for borrowing.
Parameters:
Return values:
repay (0x1da649cf)
Allows a borrower to repay their outstanding loan for a given project token and lending token.
Parameters:
Return values:
repayFromRelatedContract (0xf432e4e2)
Allows a related contract to repay the outstanding loan for a given borrower's project token and lending token.
Parameters:
Return values:
updateInterestInBorrowPositions (0x9a812edd)
This function is called to update the interest in a borrower's borrow position.
Parameters:
getTokensUpdateFinalPrices (0xef290120)
This function is called when performing operations using token prices, to determine which tokens will need to update their final price.
Parameters:
Return values:
priceOracle (0x2630c12f)
return address of price oracle with interface of PriceProviderAggregator
projectTokens (0xb269449f)
return address project token in array projectTokens
Parameters:
lendingTokens (0x6f5f74f2)
return address lending token in array lendingTokens
Parameters:
projectTokenInfo (0x85f4da5c)
Returns the info of the project token.
Return values:
lendingTokenInfo (0x3299093b)
Returns the address of the lending token.
Return values:
getRelatedContract (0x2060128e)
Returns whether an address is a related contract or not.
Parameters:
Return values:
borrowLimitPerLendingToken (0x9f9184db)
Returns the borrow limit per lending token.
Return values:
borrowLimitPerCollateral (0x739d7547)
Returns the borrow limit per collateral token.
Return values:
totalDepositedProjectToken (0xef867f0f)
return total amount of deposited project token
Parameters:
totalBorrow (0xb090cf22)
return total borrow amount of lendingToken
by projectToken
Parameters:
pit (0x72d456af)
Returns the PIT (primary index token) value for a given account and position after a position is opened
Parameters:
Return values:
pitCollateral (0x1893be9f)
Returns the PIT (primary index token) value for a given account and collateral before a position is opened
Parameters:
Return values:
getLendingToken (0x2ce36230)
Returns the actual lending token of a user's borrow position for a specific project token
Parameters:
Return values:
pitRemaining (0xd1a3d2ae)
Returns the remaining PIT (primary index token) of a user's borrow position
Parameters:
Return values:
totalOutstanding (0xac15382f)
Returns the total outstanding amount of a user's borrow position for a specific project token and lending token
Parameters:
Return values:
healthFactor (0xcc224bff)
Returns the health factor of a user's borrow position for a specific project token and lending token
Parameters:
Return values:
getTokenEvaluation (0x3598a7a9)
Returns the evaluation of a specific token amount in USD
Parameters:
Return values:
lendingTokensLength (0x2412b575)
Returns the length of the lending tokens array
Return values:
projectTokensLength (0x4a41d29e)
Returns the length of the project tokens array
Return values:
getPosition (0x713390f5)
Returns the details of a user's borrow position for a specific project token and lending token
Parameters:
Return values:
getDepositedAmount (0x0fefc251)
Returns the amount of project tokens deposited by a user for a specific project token and collateral token
Parameters:
Return values:
getTotalBorrowPerCollateral (0x65647a59)
Get total borrow amount in USD per collateral for a specific project token
Parameters:
Return values:
getTotalBorrowPerLendingToken (0x961540e1)
Get total borrow amount in USD for a specific lending token
Parameters:
Return values:
totalOutstandingInUSD (0xb189b70a)
Convert the total outstanding amount of a user's borrow position to USD
Parameters:
Return values:
getLoanToValueRatio (0xe84dc1b3)
Get the loan to value ratio of a position taken by a project token and a lending token
Parameters:
Return values:
pitCollateralWithUpdatePrices (0x902b6286)
Returns the PIT (primary index token) value for a given account and collateral before a position is opened after update price.
Parameters:
Return values:
pitRemainingWithUpdatePrices (0xe662d5c5)
Returns the remaining PIT (primary index token) of a user's borrow position after update price.
Parameters:
Return values:
estimatedPitRemainingWithUpdatePrices (0x0c0e14a3)
Returns the estimated remaining PIT (primary index token) of a user's borrow position
Parameters:
Return values:
getTokenEvaluationWithUpdatePrices (0x4d247b46)
Returns the evaluation of a specific token amount in USD after update price.
Parameters:
Return values:
getPositionWithUpdatePrices (0xa767ebd3)
Returns the details of a user's borrow position for a specific project token and lending token after update price
Parameters:
Return values:
totalEstimatedOutstandingInUSDWithUpdatePrices (0x7b78a351)
Returns the total estimated outstanding amount of a user's borrow position to USD after update price.
Parameters:
Return values:
convertPitRemainingWithUpdatePrices (0x07a0e36c)
Convert the remaining pit amount to the corresponding lending token amount after update price.
Parameters:
Return values:
convertEstimatedPitRemainingWithUpdatePrices (0x7200b1ef)
Convert the estimated remaining pit amount to the corresponding lending token amount after update price.
Parameters:
Return values:
getCollateralAvailableToWithdrawWithUpdatePrices (0x45f0219c)
Calculates the collateral available for withdrawal based on the loan-to-value ratio of a specific project token after update price.
Parameters:
Return values:
getLendingAvailableToBorrow (0xdc8b040b)
Calculates the lending token available amount for borrowing after update price.
Parameters:
Return values:
Last updated