I failed to use api-reference.pyth.network

Hi mates,

I tried to use this api (https://api-reference.pyth.network/price-feeds/evm/getPriceNoOlderThan) on the docs directly but failed with following error.

ContractFunctionExecutionError: The contract function "getPriceNoOlderThan" reverted. Error: PriceFeedNotFound() Contract Call: address: 0x4305FB66699C3B2702D4d05CF36551390A4c69C6 function: getPriceNoOlderThan(bytes32 id, uint256 age) args: (0x7e990daa483e54a9a2b25ed3312285c867a049b5b3c84d27fe8c2ad9e0d24c57, 60) Docs: readContract · Viem Version: viem@2.34.0

Not sure what the cause is. I tried several times with different networks and priceIds, but same result.

How can I make successful calls?

Thanks.

Hi @unipine , welcome to pyth dev-forum.

The PriceFeedNotFound() error emits when feed has never been updated or the feed Id you are entering is wrong. I would recommend you to update the price feed first.

Hi @Aditya520, thanks for your reply.

I noticed that I need to pay gas fee when updating price feed.

Should I do this frequently?

Best

Yes you need to pay the fees everytime you update the prices.

Since Pyth oracle follows a pull design. You need to do this if you need latest real-time prices.