Learn how to simulate Switchboard oracle price feeds
Solana Agent Kit provides integration with Switchboard for simulating oracle price feeds. This integration allows you to fetch simulated price data for any Switchboard feed on mainnet.
interface SwitchboardSimulateFeedResponse { status: "success" | "error"; feed?: string; // Feed public key value?: number; // Simulated feed value message?: string; // Error message if status is "error" code?: string; // Error code if status is "error"}
const ERROR_MESSAGES = { INVALID_FEED: "Did you provide the right mainnet feed hash?", EMPTY_RESULT: "No results returned from simulation", NETWORK_ERROR: "Failed to connect to Crossbar service"};