getPriceNoOlderThan
This method returns a Pyth price object containing the last updated price for the given price feed identifier if it has been updated sufficiently recently.
The caller provides an age
argument which specifies how old the price can be at most.
Arguments
This method expects the following arguments:
Argument | Description |
---|---|
| Unique Pyth price feed identifier. See Supported Price Feeds. |
| How many seconds the latest price feed update may be in the past. |
Returned Price
The Pyth price object contains the following fields:
Field | Description |
---|---|
| Latest price of the price feed. |
| Confidence level of the price feed. |
| Exponent of the price feed. |
| Time when the price feed was last updated. |
A sample price object returned by this method may look as follows:
The price above is of the format price * 10 ^ expo
.
So, the above price represents the number 123456789 * 10(-8) = 1.23456789
in this case.
Error Response
This method can return the following error response:
Error | Description |
---|---|
| The specified price feed has never received a price update or does not exist. |
| The latest prices update time exceeds the caller specified maximum age. |
Last updated