Skip to content

Integration of pyth with solana smart contracts ,demonstrating use of on chain price fetch

Notifications You must be signed in to change notification settings

mubarizkyc/solpyth

Repository files navigation

solpyth

Integration of pyth with solana smart contracts ,demonstrating use of on chain price fetch

This repo demonstrates fetching price on chain as well as using client side code to use that contract

https://github.com/pyth-network/pyth-crosschain.git

In src/Cargo.toml add

 [dependencies]
anchor-lang = "0.30.1"
pyth-solana-receiver-sdk = {path="/PATH_TO/pyth_solana_receiver_sdk"}
anchor build
anchor deploy

Testing the client script is coded in tests folder

npm install rpc-websockets
anchor run test

You can query any token price wirh just pyth feed id https://pyth.network/developers/price-feed-ids

Tested it with BTC/USD when it was aroung $58K Screenshot from 2024-07-13 16-44-10

Support

If you benefitted from the project, show us some support by giving us a star ⭐. Open source is awesome!

resources

https://docs.pyth.network/price-feeds/use-real-time-data/solana

About

Integration of pyth with solana smart contracts ,demonstrating use of on chain price fetch

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published