|
|
1 năm trước cách đây | |
|---|---|---|
| .. | ||
| cli | c7c3527bfe fix: initialize guardian expiration to the right value (#1485) | 1 năm trước cách đây |
| common_test_utils | 866b6a5b4b feat: pyth pull-based push oracle (#1370) | 1 năm trước cách đây |
| examples | 2095da34e9 feat: add input boxes (#1515) | 1 năm trước cách đây |
| migrations | 16caff1b04 [solana] Start to implement the solana receiver contract (#557) | 2 năm trước cách đây |
| program_simulator | 1e5df8537a feat: add posted slot (#1372) | 1 năm trước cách đây |
| programs | 76ec4e3322 feat: move VAA_SPLIT_INDEX (#1466) | 1 năm trước cách đây |
| pyth_solana_receiver_sdk | a592c6bc33 fix: publish workflow (#1532) | 1 năm trước cách đây |
| scripts | 5a676978db feat: add pyth_push_oracle to dockerfile (#1470) | 1 năm trước cách đây |
| sdk | 8d32b4c2fc chore: remove repetitive words (#1524) | 1 năm trước cách đây |
| target | 8f62566dbb [solana] Fix idl (#1279) | 1 năm trước cách đây |
| .gitignore | f2d5bdc842 chore(target_chains/solana): add verifiable build script (#1378) | 1 năm trước cách đây |
| .prettierignore | 16caff1b04 [solana] Start to implement the solana receiver contract (#557) | 2 năm trước cách đây |
| Anchor.toml | 37ee3b46bd feat: add solana send usd example app (#1471) | 1 năm trước cách đây |
| Cargo.lock | 344f8a9e47 feat: add anchor to pythnet sdk (#1531) | 1 năm trước cách đây |
| Cargo.toml | 37ee3b46bd feat: add solana send usd example app (#1471) | 1 năm trước cách đây |
| Dockerfile | 5a676978db feat: add pyth_push_oracle to dockerfile (#1470) | 1 năm trước cách đây |
| README.md | f31ef9e812 docs: update solana readme, add rust sdk readme (#1387) | 1 năm trước cách đây |
| rust-toolchain.toml | 5ef1ff097a Bump toolchain: (#1382) | 1 năm trước cách đây |
This folder contains:
programs/pyth-solana-receiverpyth_solana_receiver_sdksdk/js/pyth_solana_receiverPosting a Pyth price update involves two steps:
This contract offers two ways to post a Pyth price update onto Solana:
post_update allows you to do it in 2 transactions and checks all the Wormhole guardian signatures (the quorum is currently 13 signatures). It relies on the Wormhole contract to verify the signatures.post_update_atomic allows you to do it in 1 transaction but only partially checks the Wormhole guardian signatures (5 signatures seems like the best it can currently do). Therefore it is less secure. It relies on a guardian set account from the Wormhole contract to check the signatures against the guardian keys.post_update is also a more efficient way to post updates if you're looking to post data for many different price feeds at a single point in time.
This is because it persists a verified encoded VAA, so guardian signatures will only get checked once. Then that single posted VAA can be used to prove the price update for all price feeds for that given point in time.
The program is currently deployed on Solana (Mainnet, Devnet) and Eclipse Testnet with addresses:
HDwcJBJXjL9FpJ7UBsYBtaDjsBUhuLCUYoz3zr8SWWaQ for the Wormhole receiverrec5EKMGg6MxZYaMdyBfgwp4d5rB9T1VQH5pJv5LtFJ for the Pyth receiverThe cli folder contains some useful client code to interact with both the Wormhole receiver and the Pyth receiver.
To run the full flow of posting a price update (on devnet) please follow the following steps:
Get a Hermes update from Hermes stable:
curl "https://hermes.pyth.network/api/latest_vaas?ids[]=0xff61491a931112ddf1bd8147cd1b641375f79f5825126d665480874634fd0ace"
Post it to devnet:
cargo run --package pyth-solana-receiver-cli -- --url https://api.devnet.solana.com --keypair ${PATH_TO_KEYPAIR} --wormhole HDwcJBJXjL9FpJ7UBsYBtaDjsBUhuLCUYoz3zr8SWWaQ post-price-update-atomic -p ${HERMES_UPDATE_IN_BASE_64}
or
cargo run --package pyth-solana-receiver-cli -- --url https://api.devnet.solana.com --keypair ${PATH_TO_KEYPAIR} --wormhole HDwcJBJXjL9FpJ7UBsYBtaDjsBUhuLCUYoz3zr8SWWaQ post-price-update -p ${HERMES_UPDATE_IN_BASE_64}