PythAdapter
Price oracle adapter that uses Pyth price feeds (https://pyth.network)
Events
PythContractAddressSet
PriceFeedRegistered
PriceFeedUnregistered
PriceMaxAgeSet
PriceMinConfidenceRatioSet
PriceFeedsUpdated
Functions
updatePriceFeeds
Updates one or more Pyth price feeds
This function needs to be called right before calling getAssetPrice()
Parameters
Return Values
getAssetPrice
Returns the asset price
This function reverts with a StalePrice error if the on-chain price has not been updated within the last getValidTimePeriod() seconds via updatePriceFeeds()
Parameters
Return Values
getPythContractAddress
Returns the Pyth contract address
Return Values
isPriceFeedRegistered
Check if Pyth price feed is registered
Parameters
Return Values
getPriceFeedIdByAsset
Returns the Pyth price feed id for an asset
Parameters
Return Values
getUpdateFee
Returns the required fee to update an array of price updates
Parameters
Return Values
getValidTimePeriod
Returns the period (in seconds) that a price feed is considered valid since its publish time
Return Values
getPriceMaxAge
Returns the maximum age of a price feed in seconds
Return Values
getPriceMinConfidenceRatio
Returns the minimum confidence ratio for an asset
Parameters
Return Values
Last updated