Skip to main content

Refresh Prices

Scope prices are pushed on-chain by permissionless “crank” transactions: anyone can sign and send a refresh, no admin authority required. The Scope SDK builds one instruction that refreshes the specified token slots for a feed. This is the instruction Multiply and flash-loan flows bundle in front of a leverage operation so reserves read fresh prices.
1

Import Dependencies

Import the Scope SDK plus the Solana Kit transaction-building helpers and a keypair loader.
2

Configure Constants and Initialize Scope

Set the keypair path, RPC endpoints, and the slot indices to refresh.
3

Build the Refresh Instruction

refreshPriceListIx returns one instruction that refreshes the listed slots, or null if there is nothing to refresh.
The refresh is permissionless: any wallet can pay fees and send it. The Scope program writes the new dated prices to the feed’s OraclePrices account.
4

Build, Sign, and Send Transaction

Compose the v0 transaction, sign, verify it fits the size limit, then send and confirm.
The refresh is complete. The targeted slots now have fresh prices and timestamps on-chain.

Full Code Example