Pyth for Off-chain Apps
We provide SDKs in various programming languages that allow you to read the values of Pyth price feeds in off-chain applications, such as web frontends:
JavaScript
Rust
Python
Go
There are different javascript SDKs for different purposes.
If you are developing an application that runs on any blockchain except Solana, then the javascript SDK for that blockchain supports querying and streaming live Pyth prices. You can find the code for this SDK in the pyth-crosschain repository, under
target_chains/<chain name>/sdk/js
. These SDKs also support generating on-demand price updates for your target blockchain. An example for querying and streaming prices using these SDKs is shown here.If you are developing an application for Solana, or without any blockchain whatsoever, then the @pythnetwork/client npm package can be used to consume Pyth prices inside off-chain JavaScript programs. An example can be found here.
The pyth-sdk-solana crate can be used to consume Pyth prices inside your off-chain Rust programs. An example can be found here.
The pyth-client-py Python library can be used to consume Pyth prices inside your off-chain Python programs. An example can be found here.
The Blockdaemon pyth-go client can be used to consume Pyth prices inside your off-chain Go programs.
Last modified 20d ago