[PASSED] OP-PIP-55: Upgrade Pyth Receiver Program on Solana Mainnet to enable TWAP prices

Abstract
This proposal upgrades the Pyth Receiver Program on Solana Mainnet to add the ability to post TWAP prices. Program is being upgraded from v0.1.0 to v0.2.1.

Description
This upgrade introduces the post_twap_update instruction to the Pyth Receiver Program, which allows users to post TWAP (time-weighted average price) updates on chain. Read more about the feature and implementation here: feat(pyth-solana-receiver): add `post_twap_update` instruction & types by tejasbadadare · Pull Request #2172 · pyth-network/pyth-crosschain · GitHub. This is the only change from the initial deployment (v0.1.0).

Implementation Plan
Proposal ID: 31dHPansHyAAEuVQG6LWn1dWszXMaEucSdPKR9u8rZoi
Verify the implementation following the guide below:

  1. git: install git from here
  2. Docker: install it from here
  3. sha256sum: if on Mac you can install it as a part of coreutils with brew install coreutils
  4. Clone the pyth-crosschain repo (GitHub - pyth-network/pyth-crosschain: Crosschain Pyth programs and utilities)
  5. Enter the cloned repo with cd pyth-crosschain
  6. Checkout the receiver program v0.2.1 release by running git checkout pyth-solana-receiver-program-v0.2.1
  7. Run the build by running ./target_chains/solana/scripts/build_verifiable_program.sh
  8. Upon a successful build, you should see the following messages containing the hash digest of the program. For this proposal, only the hash of the pyth_solana_reciever program is relevant.

sha256sum of the pyth_solana_receiver program: 543b7a43b58607ba368a5ce76bff9f51408470f1a1e2fb174393dbdf1f5e1a5a

sha256sum of the pyth_push_oracle program: 8c2e8aadd6ea3b46420fb3d4e751462b27de80e300ecacfdb0560b48e7afd017

  1. Check that the hash digest matches the hash digest of the buffer deployed on Solana. Get the buffer account from the proposal and fetch the digest of the program in the buffer account by running the following commands:

solana -u m program dump EARNwoLpSKEAjeyomHxWPQZRLwawnN9EzvNeApURaC3w temp_file
sha265sum temp_file
rm temp_file

  1. Make sure the hash from step 8 and from step 9 match
  2. Make sure the buffer authority is the multisig authority. You can verify the authority by going to the solana explorer check the upgrade authority.
3 Likes

Glorious Morning, zenyas.

Just for my clarity (as a non-technical user): is the TWAP going to be utilised in the existing EMAP and EMAC calculations for pythnet? Or is this for pythnet-crosschain?

1 Like

gm @Derrp

The TWAP prices here refer actually to customizable TWAPs creation

As of today, all Pyth feeds have a native/embedded TWAP (1hr EMA) that is calculated based upon live prices.

This proposal/contract upgrade actually enable anyone to start creating their own TWAPs ; so if you wanted a 1 or 5min TWAP instead of 1 hour you now can etc…

3 Likes

Super cool!

Thanks for the explanation! Will be interesting to see participants and market demand for this :crystal_ball::purple_heart:

Passed and Executed Pyth Network

2 Likes