PrimaryLendingPlatformLeverageCore
Overview
License: MIT
The PrimaryLendingPlatformLeverageCore contract is the core contract for the leverage functionality of the primary lending platform.
Contract that allows users to leverage their positions using the exchange aggregator.
Enums info
LeverageType
Structs info
Ratio
Events info
SetExchangeAggregator
Emitted when the exchange aggregator and registry aggregator addresses are set.
Parameters:
LeveragedBorrow
Emitted when a user leverages their borrowing position.
Parameters:
SetPrimaryLendingPlatform
Emitted when the primary lending platform address is set.
Parameters:
Constants info
MODERATOR_ROLE (0x797669c9)
BUFFER_PERCENTAGE (0x952038c2)
State variables info
isLeveragePosition (0x3226d284)
primaryLendingPlatform (0x92641a7c)
exchangeAggregator (0x60df4f35)
registryAggregator (0xf38cb29a)
typeOfLeveragePosition (0x4118a1bd)
Modifiers info
onlyModerator
Modifier to restrict access to only the contract moderator.
isProjectTokenListed
Modifier to check if the given project token is listed on the primary lending platform.
Parameters:
isLendingTokenListed
Modifier to check if the given lending token is listed on the primary lending platform.
Parameters:
isPrimaryLendingPlatform
Modifier to check if the caller is the primary lending platform contract.
onlyRelatedContracts
Modifier to check if the caller is a related contract of the primary lending platform.
Functions info
initialize (0xc4d66de8)
Initializes the contract with the given parameters. This function is called only once when deploying the contract.
Parameters:
setExchangeAggregator (0x3c4841b4)
Updates the Exchange Aggregator contract and registry contract addresses.
Requirements:
The caller must be the moderator.
exchangeAggregatorAddress
must not be the zero address.registryAggregatorAddress
must be a valid Augustus contract if it is not the zero address.
Parameters:
setPrimaryLendingPlatformAddress (0xcec5a0b0)
Sets the address of the primary lending platform contract.
Requirements:
Only the moderator can call this function.
The new primary lending platform address cannot be the zero address.
Parameters:
getTokenPrice (0xd02641a0)
Returns the price of a given token in USD.
Parameters:
Return values:
calculateLendingTokenCount (0xcc65e637)
Calculates the lending token count for a given notional value.
Parameters:
Return values:
deleteLeveragePosition (0x0614a25a)
Deletes a leverage position for a user and project token. The caller must be the primary lending platform.
Parameters:
calculateAddingAmount (0x545c5699)
Calculates the additional collateral amount needed for the specified user and project token.
Parameters:
Return values:
getLeverageType (0x68faa77f)
Gets type of Leverage Position for given borrower and projectToken.
Parameters:
Return values:
Last updated