New chain integration - data format and validation

Hi all,

I want to integrate Pyth with a new chain, with smart contract support in Python.

This is the flow of messages I gather should happen:

  1. Get the price info off-chain, using Hermes for example (curl "https://hermes.pyth.network/v2/updates/price/latest?ids[]=ec7a775f46379b5e943c3526b1c8d54cd49749176b0b98e02dde68d1bd335c17&binary=true"). I’ll get the hexadecimal data.
  2. Send the data to the on-chain contract;
  3. On-chain contract has to validate the data;

The data validation process is the one which is unclear to me. I believe there are 2 validations:
a) Validate the VAA message comes from Wormhole;
b) Validate the payload data with oracle info. This would be a Pyth specific message?

Is that correct?

From the hexadecimal VAA data, how can I validate it? Probably there are some resources from Wormhole that you can point to?

After that, how do I decode and validate the Pyth specific data? I couldn’t find resources on the documentation website.

I can try to follow some of the existing integration codes (example: Stacks integration), but it would be much better if I could understand the data models and validation from your docs so no mistakes are made.

Any help is appreciated!