Solayer Token Price Feeds Guide

This guide explains how to fetch real-time price feeds for sUSD, 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:


TokenFeed SymbolPyth Price Feed URL
LayerCrypto.LAYER/USDhttps://www.pyth.network/price-feeds/crypto-layer-usd
sSOLCrypto.sSOL/SOL::RRhttps://www.pyth.network/price-feeds/crypto-ssol-sol-rr
sUSDCrypto.sUSD/USD::RRhttps://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:

  1. Locate the Pyth price account from the links above
  2. Pass the price account as an input to your smart contract
  3. In the contract, deserialize and access:
  • price
  • confidence_interval
  • expo
  1. Always validate:
  • status == Trading
  • the publish time is recent enough (i.e. not stale)

Reference: Using Real-Time Data in Solana Programs


2. Off-Chain: Using Real-Time Price Data

Pyth recommends using hermes-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:

curl "https://hermes.pyth.network/api/get_price_updates?ids[]=Crypto.sUSD/USD::RR&binary=true"

This method is suitable for:

  • Secure data ingestion
  • Cross-chain bridging
  • Price verification in backend systems

Reference: Fetch Price Updates


  • price-service-sdk is deprecated and should not be used.
  • The api/latest_price HTTP 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