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: 3 months 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 (11 months ago)
- Default Branch: main
- Last Pushed: 2024-07-22T08:59:42.000Z (11 months ago)
- Last Synced: 2025-01-19T10:34:17.827Z (5 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
# 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