Skip to content
Original file line number Diff line number Diff line change
Expand Up @@ -7,20 +7,19 @@ slug: /price-feeds/core/troubleshoot/evm
This reference page is designed to help you troubleshoot common issues you may encounter when using Pyth Price Feeds on EVM chains.
Follow the steps provided below to diagnose and resolve the issue.

#### getPrice() reverts with `StalePrice()` or `0x19abf40e` error
#### getPriceNoOlderThan() reverts with `StalePrice()` or `0x19abf40e` error

This error occurs when the requested price feed has not been updated in the last `validTimePeriod`.
The valid time period for the feed can queried using the [`getValidTime()`](https://github.com/pyth-network/pyth-crosschain/blob/main/target_chains/ethereum/sdk/solidity/AbstractPyth.sol#L22) method.
This error occurs when the requested price feed has not been updated within the specified `age` parameter.

To resolve this issue:

- Update the prices by calling [`updatePriceFeeds()`]("https://github.com/pyth-network/pyth-crosschain/blob/main/target_chains/ethereum/sdk/solidity/AbstractPyth.sol#L88")
- Update the prices by calling [`updatePriceFeeds()`](https://github.com/pyth-network/pyth-crosschain/blob/9825470036fc24de3d52b139087ea0cd4117624a/target_chains/ethereum/sdk/solidity/AbstractPyth.sol#L90)
by passing the latest updateData from [Hermes](https://hermes.pyth.network/docs/#/rest/latest_vaas).
- Another method to fetch the price is [`getPriceUnsafe()`](https://github.com/pyth-network/pyth-crosschain/blob/main/target_chains/ethereum/sdk/solidity/AbstractPyth.sol#L41)
- Another method to fetch the price is [`getPriceUnsafe()`](https://github.com/pyth-network/pyth-crosschain/blob/9825470036fc24de3d52b139087ea0cd4117624a/target_chains/ethereum/sdk/solidity/AbstractPyth.sol#L43)
If the price feed is available, the method will return the latest prices with timestamp of last update.
NOTE: `getPriceUnsafe()` method does not check the freshness of the price.

#### getPrice() reverts with `PriceFeedNotFound()` or `0x14aebe68` error
#### getPriceNoOlderThan() reverts with `PriceFeedNotFound()` or `0x14aebe68` error

This error occurs when the requested price feed has not been updated on-chain, or the price feed id is incorrect.

Expand All @@ -35,5 +34,5 @@ To resolve this issue:
This error occurs when the fee provided for updating the price feed is insufficient.
To resolve this issue:

- Fetch the latest fee by calling [`getUpdateFee()`](https://github.com/pyth-network/pyth-crosschain/blob/main/target_chains/ethereum/sdk/solidity/IPyth.sol#L112) method and
provide the required fee to `msg.value` when calling [`updatePriceFeeds()`](https://github.com/pyth-network/pyth-crosschain/blob/main/target_chains/ethereum/sdk/solidity/IPyth.sol#L112) method.
- Fetch the latest fee by calling [`getUpdateFee()`](https://github.com/pyth-network/pyth-crosschain/blob/9825470036fc24de3d52b139087ea0cd4117624a/target_chains/ethereum/sdk/solidity/IPyth.sol#L93) method and
provide the required fee to `msg.value` when calling [`updatePriceFeeds()`](https://github.com/pyth-network/pyth-crosschain/blob/9825470036fc24de3d52b139087ea0cd4117624a/target_chains/ethereum/sdk/solidity/AbstractPyth.sol#L90) method.