Solana
Solana-specific notes for the Pyth Core upgrade.
These notes complement the main upgrade guide for Solana consumers.
Get a Pyth API Key
Required for everyone who calls Hermes. Sign up at Pyth Terminal: a free trial is included, paid plans cover ongoing use.
Sign up at Pyth Terminal
Move your Hermes calls to the new Hermes endpoint
If you use @pythnetwork/price-service-client as your Hermes client, switch to @pythnetwork/hermes-client. Point it at the upgraded endpoint and pass your Pyth API key:
import { HermesClient } from "@pythnetwork/hermes-client";
const hermes = new HermesClient(
"https://pyth.dourolabs.app/hermes",
{ accessToken: process.env.PYTH_API_KEY },
);Swap your contract address
On Solana, swapping the Pyth Core contract address means pointing your program and TS SDK at the upgraded program IDs. The full mapping is on the contract addresses page. If your app reads push feeds directly, the per-feed account addresses also change; see the push feed accounts table for the full mapping.
On-chain program (Rust)
pyth-solana-receiver-sdk hardcodes the Pyth program addresses. If your program depends on this crate, upgrade to the latest version and enable the pro-compatible feature in your Cargo.toml:
pyth-solana-receiver-sdk = { version = "1.2.0", features = ["pro-compatible"] }TypeScript client
The TS SDK @pythnetwork/pyth-solana-receiver defaults to the current program IDs. Point it at the upgraded ones instead:
import {
PRO_COMPATIBLE_PUSH_ORACLE_PROGRAM_ID,
PRO_COMPATIBLE_RECEIVER_PROGRAM_ID,
PRO_COMPATIBLE_WORMHOLE_PROGRAM_ID,
PythSolanaReceiver,
} from "@pythnetwork/pyth-solana-receiver";
const pythSolanaReceiver = new PythSolanaReceiver({
connection,
pushOracleProgramId: PRO_COMPATIBLE_PUSH_ORACLE_PROGRAM_ID,
receiverProgramId: PRO_COMPATIBLE_RECEIVER_PROGRAM_ID,
treasuryId,
wallet,
wormholeProgramId: PRO_COMPATIBLE_WORMHOLE_PROGRAM_ID,
});Replace any additional reference to the current Core program IDs with the upgraded program IDs in your codebase. See the contract addresses page for the full mapping.