hey guys,
what do you recommend to do the link (programmatically) between a solana price account (or feed id) to the symbol?
It’s doable on the UI here https://www.pyth.network/developers/price-feed-ids#solana-price-feed-accounts to search for an account and see the symbol but I need to do it in code.
Gm sir. You can find the API mapping here: Swagger UI
Unfortunately there’s no on-chain mapping, you will need to hard code the mapping in your program.
Sadly, this API only offers the opposite of what I need and now Pyth website doesn’t offer the option anymore. We have a product using a pyth price and an account onchain storing the pyth account pubkey. I want to be able to tell the user what pyth price is used and give a link the price page.
Now I can’t even do this reverse search myself manually…
Ah, you want to go from Solana price account to symbol. Can you read the account and get the feed ID from it? The account is a PriceUpdateV2, which contains PriceFeedMessage. This contains feed_id. You can use our Benchmarks API to go from feed_id to symbol.
You can also manually look it up here: https://docs.pyth.network/price-feeds/price-feeds#feed-ids
Thx this API works for me.