Giter Club home page Giter Club logo

pyth-sdk-rs's Introduction

Pyth Network SDK

The Pyth Network Rust SDK provides utilities for reading price feeds from the pyth.network oracle in on- and off-chain applications.

Key features of this SDK include:

  • Get the current price of over 50 products, including cryptocurrencies, US equities, forex and more.
  • Combine listed products to create new price feeds, e.g., for baskets of tokens or non-USD quote currencies.
  • Consume prices in Solana programs or off-chain applications.

Please see the pyth.network documentation for more information about pyth.network.

Usage

This repository is divided into several crates focused on specific use cases:

  1. Pyth SDK provides common data types and interfaces for that are shared across different blockchains.
  2. Pyth SDK Solana provides an interface for reading Pyth price feeds in Solana programs. This crate may also be used in off-chain applications that read prices from the Solana blockchain.

Please see the documentation for the relevant crate to get started using Pyth Network.

Development

All crates in this repository can be built for either your native platform or blockchain-specific platforms. Use cargo build / cargo test to build and test natively.

Schema Files

JSON Schema files are provided to allow others to work with the various Pyth structures in languages other than Rust. These are also used within Pyth’s own repositories, for example within the pyth-sdk-js repo. Every time these structures change, new Schema’s must be generated and committed via the cargo run --example schema command.

There is currently a CI check which ensures the schema files remain up-to-date.

Creating a Release

To release a new version of any of these crates, perform the following steps within the crate being released:

  1. Increment the version number in Cargo.toml. You may use a version number with a -beta.x suffix such as 0.0.1-beta.0 to create opt-in test versions.
  2. Merge your change into main on github.
  3. Create and publish a new github release with the structure of package:vx.y.z such as pyth-sdk-solana:v1.3.2. It will trigger a github action and publishes the released package in crates.io

pre-commit hooks

pre-commit is a tool that checks and fixes simple issues (formatting, ...) before each commit. You can install it by following their website. In order to enable checks for this repo run pre-commit install from command-line in the root of this repo.

The checks are also performed in the CI to ensure the code follows consistent formatting.

pyth-sdk-rs's People

Contributors

ali-bahjati avatar guibescos avatar anihamde avatar tompntn avatar jayantk avatar hiddengearz avatar yhzhang0128 avatar 0xripleys avatar lastemp avatar cctdaniel avatar nevi-me avatar reisen avatar dadepo avatar 0xdal avatar dependabot[bot] avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.