PriceProviderAggregator
Overview
License: MIT
The PriceProviderAggregator contract is the contract that provides the functionality of getting the latest price from different price providers.
Contract that provides the functionality of getting the latest price from different price providers.
Events info
SetTokenAndPriceProvider
Emitted when the price provider is set to a token.
Parameters:
SetPriceOracle
Emitted when the priceOracle is set.
Parameters:
SetPrimaryLendingPlatform
Emitted when the primary lending platform address is set.
Parameters:
ChangeActive
Emitted when the active status of a token changes.
Parameters:
Constants info
MODERATOR_ROLE (0x797669c9)
State variables info
priceOracle (0x2630c12f)
primaryLendingPlatform (0x92641a7c)
tokenPriceProvider (0xa33540f1)
Modifiers info
onlyModerator
Modifier to check if the caller has the MODERATOR_ROLE.
Functions info
initialize (0xc4d66de8)
This function should only be called once during contract deployment. Initializes the contract by setting up the access control roles and assigning the default and moderator roles to the contract deployer.
Parameters:
setTokenAndPriceProvider (0x072f27b0)
Sets price provider to token
and its corresponding price provider.
Requirements:
The caller must be the moderator.
token
cannot be the zero address.priceProvider
cannot be the zero address.
Parameters:
setPriceOracle (0x530e784f)
Sets new priceOracle contract. Requirements:
The caller must be the moderator.
newPriceOracle
cannot be the zero address.
Parameters:
setPrimaryLendingPlatform (0xe801734a)
Sets the address of the primary lending platform contract.
Parameters:
Requirements:
plp
cannot be the zero address. |
changeActive (0x3651084e)
Allows the moderator to change the active status of a price provider for a specific token.
Requirements:
The caller must be the moderator.
The token's current price provider must match the provided price provider address.
Parameters:
updateMultiFinalPrices (0x1e5f85e6)
Calculates and update multiple the final TWAP prices of a token.
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:
getPrice (0x41976e09)
Returns the most recent TWAP price or non-TWAP price of a token.
Formula: price = priceMantissa / (10 ** priceDecimals)
Parameters:
Return values:
getEvaluation (0x81fd01ea)
returns the most TWAP price or non-TWAP price in USD evaluation of token by its tokenAmount
Parameters:
Return values:
getMostEvaluation (0x894b23cd)
returns the last stored TWAP price in USD evaluation of token by its tokenAmount
Parameters:
Return values:
Last updated