interface IPriceProviderAggregator
setTokenAndPriceProvider (0xf913ab66)
function setTokenAndPriceProvider(
address token,
address priceProvider,
uint8 priceDecimals
) external
Sets price provider to token and its corresponding price provider.
Parameters:
the address of price provider. Should implement the interface of PriceProvider.
the decimals of token price.
changeActive (0x3651084e)
Allows the moderator to change the active status of a price provider for a specific token.
Parameters:
The address of the price provider to change the active status for.
The address of the token to change the active status for.
The new active status to set for the price provider.
updateMultiFinalPrices (0x1e5f85e6)
Calculates and update multiple the final TWAP prices of a token.
Parameters:
The token array needs to update the price.
updatePrices (0x0aa9adbc)
Perform a price update if the price is no longer valid.
Parameters:
The priceIds need to update.
The updateData provided by PythNetwork.
getTokensUpdateFinalPrices (0xef290120)
This function is called when performing operations using token prices, to determine which tokens will need to update their final price.
Parameters:
Address of the project token.
Address of the lending token.
Whether getting the list of tokens for updateFinalPrices is related to the borrowing operation or not.
Return values:
Array of tokens that need to update final price.
tokenPriceProvider (0xa33540f1)
Returns priceProvider address.
Parameters:
The address of token which address of priceProvider is to return.
getPrice (0x41976e09)
Returns the most recent TWAP price of a token.
Parameters:
The address of the token.
Return values:
The decimals of the price.
The last updated timestamp of the price.
The collateral price of the token.
The capital price of the token.
getEvaluation (0x81fd01ea)
returns the most TWAP price in USD evaluation of token by its tokenAmount
Parameters:
the address of token to evaluate
the amount of token to evaluate
Return values:
the USD evaluation of token by its tokenAmount in collateral price
the USD evaluation of token by its tokenAmount in capital price