Reading Scope Prices
Scope serves prices two ways. On-chain, theOraclePrices account holds a fixed 512-slot array of dated prices and the SDK reads it directly. Off-chain, the Kamino REST endpoint serves the same prices pre-aggregated and keyed by mint, with no RPC or SDK required.
Read All Prices
- TypeScript
- API
Direct on-chain read of every populated slot in a feed.View CodeA price is
value / 10^exp; freshness comes from lastUpdatedSlot and unixTimestamp on the same dated price. getSingleOraclePrices accepts the feed by its configuration account, its OraclePrices pubkey, or its PDA seed.Get a Single Token Price
- TypeScript
- API
A token’s USD price is resolved by a “scope chain”: up to 4 slot indices, padded with View CodeThe calling program supplies the scope chain. A klend reserve, for example, stores it on its token config; Scope just resolves it against the feed’s price list. Sentinel slots (
65535. One index means a direct price; several means a derived price (for example TOKEN/SOL then SOL/USD).65535) are skipped.Get Token Price History
Past prices for a single token, keyed by mint or symbol. API only, with no on-chain equivalent: theOraclePrices account holds only the current value per slot, so history is served off-chain.
frequency is minute, hour, or day; omit start/end and the endpoint returns a default recent window (about the last day) at the chosen frequency. See the Get token price history reference for the full parameter list.
Types
- ScopeDatedPrice
- OraclePrices
Returned by
getPriceFromChain. A resolved price plus its freshness.