Skip to main content

Reading Scope Prices

Scope serves prices two ways. On-chain, the OraclePrices 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

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

A token’s USD price is resolved by a “scope chain”: up to 4 slot indices, padded with 65535. One index means a direct price; several means a derived price (for example TOKEN/SOL then SOL/USD).
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) are skipped.

Get Token Price History

Past prices for a single token, keyed by mint or symbol. API only, with no on-chain equivalent: the OraclePrices 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

Returned by getPriceFromChain. A resolved price plus its freshness.

Additional Resources

API Examples

SDK Repository