IPyth
Title: Pyth Network Interface (minimal)
Minimal interface for reading Pyth price feeds.
Functions
getPriceUnsafe
Returns the price without staleness checks.
function getPriceUnsafe(
bytes32 id
) external view returns (PythStructs.Price memory price);
Parameters
| Name | Type | Description |
|---|---|---|
id | bytes32 | The Pyth price feed ID. |
Returns
| Name | Type | Description |
|---|---|---|
price | PythStructs.Price | The price data. |
getPriceNoOlderThan
Returns the price if it’s no older than age seconds.
function getPriceNoOlderThan(
bytes32 id,
uint256 age
) external view returns (PythStructs.Price memory price);
Parameters
| Name | Type | Description |
|---|---|---|
id | bytes32 | The Pyth price feed ID. |
age | uint256 | Maximum acceptable age in seconds. |
Returns
| Name | Type | Description |
|---|---|---|
price | PythStructs.Price | The price data. |
updatePriceFeeds
Updates price feeds with signed data from Pyth.
function updatePriceFeeds(
bytes[] calldata updateData
) external payable;
Parameters
| Name | Type | Description |
|---|---|---|
updateData | bytes[] | Array of price update data. |
getUpdateFee
Returns the fee required to update price feeds.
function getUpdateFee(
bytes[] calldata updateData
) external view returns (uint256 feeAmount);
Parameters
| Name | Type | Description |
|---|---|---|
updateData | bytes[] | Array of price update data. |
Returns
| Name | Type | Description |
|---|---|---|
feeAmount | uint256 | The required fee in wei. |