Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/mubarizkyc/solpyth
Integration of pyth with solana smart contracts ,demonstrating use of on chain price fetch
https://github.com/mubarizkyc/solpyth
anchor dapp oracle solana solana-pay
Last synced: about 1 month ago
JSON representation
Integration of pyth with solana smart contracts ,demonstrating use of on chain price fetch
- Host: GitHub
- URL: https://github.com/mubarizkyc/solpyth
- Owner: mubarizkyc
- Created: 2024-07-13T10:21:57.000Z (7 months ago)
- Default Branch: main
- Last Pushed: 2024-07-22T08:59:42.000Z (7 months ago)
- Last Synced: 2024-11-09T15:49:25.216Z (3 months ago)
- Topics: anchor, dapp, oracle, solana, solana-pay
- Language: TypeScript
- Homepage:
- Size: 79.1 KB
- Stars: 2
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# solpyth
Integration of pyth with solana smart contracts ,demonstrating use of on chain price fetchThis repo demonstrates fetching price on chain as well as using client side code to use that contract
```console
https://github.com/pyth-network/pyth-crosschain.git
```
In src/Cargo.toml add
``` console
[dependencies]
anchor-lang = "0.30.1"
pyth-solana-receiver-sdk = {path="/PATH_TO/pyth_solana_receiver_sdk"}
``````console
anchor build
anchor deploy
```
Testing
the client script is coded in tests folder
```console
npm install rpc-websockets
```
```console
anchor run test
```
You can query any token price wirh just pyth feed id
https://pyth.network/developers/price-feed-idsTested it with BTC/USD when it was aroung $58K
![Screenshot from 2024-07-13 16-44-10](https://github.com/user-attachments/assets/cc025fd2-a480-4c77-8562-a6d2e68c80b7)# 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