I’m working on integrating Pyth price feeds into our integration tests using solana test validator, and I would like to request your support in clarifying the steps needed for a proper setup. FYI the price feeds are SOL/USD and BIO/USD.
Specifically, I would appreciate guidance on the following points:
Do I need to clone your mainnet program into my local validator? Which accounts are required?
What’s the best way to replicate prod? do I need to clone accounts locally or should Icreate and upgrade them?
Should I push price updates manually using Hermes before read the prices? is there a recommended flow to simulate prod?
While I was checking the bio’s price feed account address with the shard id = 0 in main-net, I realized the account already exists but the owner is not rec5EKMGg6MxZYaMdyBfgwp4d5rB9T1VQH5pJv5LtFJ. Is that correct? Should I avoid to use it? Transaction History | 6KyngSTLXWMNfdNqypV386z34KShV2er8RVYqx8naE1D | Solana
You could mock PriceUpdateV2 accounts in your test environment. This will give you the most control on what prices and timestamps are in your oracle accounts during the tests. You can add the accounts at the test validator initialization or deploy a bespoke program locally at rec5EKMGg6MxZYaMdyBfgwp4d5rB9T1VQH5pJv5LtFJ that can be called to create them.
You could push mainnet prices in your test environment like you’d do in prod. This will require cloning many Pyth accounts and programs. This should be an exhaustive list:
The Pyth Receiver program rec5EKMGg6MxZYaMdyBfgwp4d5rB9T1VQH5pJv5LtFJ and its config account DaWUKXCyXsnzcvLUyeJRWou8KTn7XtadgTsdhJ6RHS7b.
The Wormhole Receiver program HDwcJBJXjL9FpJ7UBsYBtaDjsBUhuLCUYoz3zr8SWWaQ and its guardian set account 5gxPdahvSzcKySxXxPuRXZZ9s6h8hZ88XDVKavWpaQGn.
The Price Feeds program pythWSnswVUd12oZpeFP8e9CVaEqJg25g1Vtc2biRsT
While I was checking the bio’s price feed account address with the shard id = 0 in main-net, I realized the account already exists but the owner is not rec5EKMGg6MxZYaMdyBfgwp4d5rB9T1VQH5pJv5LtFJ. Is that correct? Should I avoid to use it? Transaction History | 6KyngSTLXWMNfdNqypV386z34KShV2er8RVYqx8naE1D | Solana
This account exists because someone sent some SOL but it’s uninitialized because no one has pushed the BIO/USD price yet on mainnet.
I hope this was useful and let us know if there are some follow ups.