IPythAdapter
IPythAdapter
registerPriceFeed
Registers a new Pyth price feed
Parameters
Name | Type | Description |
---|---|---|
_asset | address | ERC-20 token address |
_priceFeedId | bytes32 | Pyth price feed id |
Return Values
Name | Type | Description |
---|---|---|
success | bool | Confirmation of success |
updatePriceFeeds
Updates one or more Pyth price feeds
This function needs to be called right before calling getAssetPrice()
Parameters
Name | Type | Description |
---|---|---|
_priceUpdateData | bytes[] | Pyth price update data |
Return Values
Name | Type | Description |
---|---|---|
success | bool | Confirmation of success |
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 updateAssetPrice()
Parameters
Name | Type | Description |
---|---|---|
_asset | address | ERC-20 token address |
Return Values
Name | Type | Description |
---|---|---|
assetPrice | uint256 | Asset price in USD with 18 decimal places |
isPriceFeedRegistered
Check if Pyth price feed is registered
Parameters
Name | Type | Description |
---|---|---|
_asset | address | ERC-20 token address |
Return Values
Name | Type | Description |
---|---|---|
isRegistered | bool | Confirmation of registration |
getUpdateFee
Returns the required fee to update an array of price updates
Parameters
Name | Type | Description |
---|---|---|
_updateData | bytes[] | Array of price update data |
Return Values
Name | Type | Description |
---|---|---|
updateFee | uint256 | Update fee in Wei |
Last updated