Solayer Token Price Feeds Guide
This guide explains how to fetch real-time price feeds forsUSD, sSOL, and Layer using Pyth Network.
It is intended for developers integrating on-chain or off-chain price functionality into applications or smart contracts.
Price Feed Sources
Solayer tokens are supported on Pyth Network with live, decentralized price feeds:| Token | Feed Symbol | Pyth Price Feed URL |
|---|---|---|
| Layer | Crypto.LAYER/USD | https://www.pyth.network/price-feeds/crypto-layer-usd |
| sSOL | Crypto.sSOL/SOL::RR | https://www.pyth.network/price-feeds/crypto-ssol-sol-rr |
| sUSD | Crypto.sUSD/USD::RR | https://www.pyth.network/price-feeds/crypto-susd-usd-rr |
How to Use Pyth Price Feeds
You can consume these feeds in two ways: on-chain (Solana programs) and off-chain (apps, bots, bridges, etc).1. On-Chain: Using Real-Time Data in Solana Programs
Solana programs can directly use Pyth’s price data via CPI. Steps:- Locate the Pyth price account from the links above
- Pass the price account as an input to your smart contract
- In the contract, deserialize and access:
priceconfidence_intervalexpo
- Always validate:
status == Trading- the publish time is recent enough (i.e. not stale)
2. Off-Chain: Using Real-Time Price Data
Pyth recommends usinghermes-client or calling the get_price_updates API for secure off-chain usage.
get_price_updates API (Signed & Verifiable)
To fetch signed, binary-encoded price updates:- Secure data ingestion
- Cross-chain bridging
- Price verification in backend systems
Deprecated / Not Recommended
price-service-sdkis deprecated and should not be used.- The
api/latest_priceHTTP endpoint is still functional but not recommended for production use:- It is not cryptographically verified
- It may be deprecated in the future
- Use only for internal dashboards or quick prototyping
Additional Resources
- Pyth Developer Docs
- Feeds available on testnets via
pythnetanddevnet