Skip to content
This repository was archived by the owner on Aug 21, 2024. It is now read-only.

Files

Latest commit

e002585 · Apr 11, 2023

History

History
32 lines (24 loc) · 2.19 KB

off-chain.md

File metadata and controls

32 lines (24 loc) · 2.19 KB

Off-Chain Applications

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:

{% tabs %} {% tab title="JavaScript" %} 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. {% endtab %}

{% tab title="Rust" %} The pyth-sdk-solana crate can be used to consume Pyth prices inside your off-chain Rust programs. An example can be found here. {% endtab %}

{% tab title="Python" %} 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. {% endtab %}

{% tab title="Go" %} The Blockdaemon pyth-go client can be used to consume Pyth prices inside your off-chain Go programs. {% endtab %} {% endtabs %}

You can find an in-depth explanation from one of our contributors, Daniel: How to Build with Pyth Data Off-Chain: Pyth Tutorials