Crates.io | psyoracleutils |
lib.rs | psyoracleutils |
version | 0.1.0 |
source | src |
created_at | 2024-02-27 20:01:53.364242 |
updated_at | 2024-02-27 20:01:53.364242 |
description | Oracle-Agnostic tools to fetch prices on Solana. |
homepage | |
repository | |
max_upload_size | |
id | 1155378 |
size | 17,443 |
Get prices from Pyth or Switchboard with the same function.
Pass either Switchboard or Pyth Oracles as UncheckedAccounts, then use the included get_oracle_price
function to validate the accounts and fetch a price. Included max age and confidence checks available for both oracles.
Want to mock oracles on localnet or devnet? Build with the localnet feature to skip confidence and age checks. Uses localnet key (E6xiKCViJ2E6YyfFEa7eRZx3ngX4KPSVTSVTLywaEwJ8). Build with the devnet-deploy feature to enable those features, but use the devnet Pyth address (gSbePebfvPy7tRqimPoVecS2UsBvYv46ynrzWocc92s). Building without either feature uses the mainnet Pyth address (FsJ3A3u2vn5cTVofAjvy6y5kwABJAqYWpe4975bi2epH)
Visit the repo: https://github.com/mithraiclabs/psyoracleutils