Skip to main content

Deriving the Price Feed Account

We derive the PDA of the price account using the following seeds:
  • “price feed” (buffer)
  • “pyth-lazer” (buffer)
  • feedID (buffer) — the asset you want. Find the supported feeds here.
  • price program idPriCems5tHihc6UDXDjzjeawomAwBduWMGAi8ZUjppd

Parsing the Account

The on‑chain account stores a header and fields for price data. We read raw bytes and decode.
  • Price offset: 73 bytes from start
  • Type: signed 64‑bit integer (i64)
  • Apply exponent: scale the raw price using the account’s exponent

Live Demo

Real‑time price stream

Implementation

Learn how to access our oracles onchain

Code Example

Check out our Github Repo