Skip to content

Latest commit

 

History

History

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 

README.md

Pyth Price Feeds (Quasar)

Read a Pyth price feed and use oracle data in program logic.

See also: Pyth overview and the repository catalog.

Major concepts

  • Oracle accounts
  • Price feed layout
  • Oracle account validation: read_price only accepts accounts owned by the Pyth Receiver program (rec5EKMGg6MxZYaMdyBfgwp4d5rB9T1VQH5pJv5LtFJ)
  • Price freshness: updates older than MAXIMUM_PRICE_AGE_SECONDS are rejected (compared against publish_time, a unix timestamp in seconds)

Setup

From basics/pyth/quasar/:

quasar build

Prerequisites: Quasar CLI and Agave toolchain (see Quasar.toml).

Testing

In-process tests via Quasar SVM (quasar-svm in Quasar.toml):

cargo test

Tests invoke instruction handlers and assert onchain state. No local validator.

Usage

Read src/ and Quasar.toml. Compare with the Anchor variant in the same example where present.