switchboard

Integrate Switchboard oracle price feeds, VRF randomness, and Surge streaming into Solana programs.

6|20|Updated Mar 14, 2026
One-click install
npx skills add https://github.com/andresdefi/cryptoskills --skill switchboard-andresdefi
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: switchboard
Source: https://github.com/andresdefi/cryptoskills/tree/main/skills/switchboard
Command: npx skills add https://github.com/andresdefi/cryptoskills --skill switchboard-andresdefi

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? AI agents and developers often lack accurate, current knowledge of Switchboard's on-demand oracle SDK on Solana, leading to wrong program IDs, deprecated API patterns, and broken feed integrations that can cost real funds. ## Core Features & Use Cases - Oracle Quotes Integration: Implement the recommended stateless quote approach with sub-second latency and 90% cost reduction, including Rust Anchor account validation. - Pull Feeds & Surge Streaming: Fetch and update traditional pull feeds via TypeScript SDK, or stream real-time prices over WebSocket with sub-100ms latency. - VRF Randomness: Request and consume cryptographically secure verifiable randomness in both TypeScript clients and Rust programs. - Use Case: Build a Solana DeFi lending program that reads SOL/USD prices via Oracle Quotes with staleness checks, using the provided Rust reference and verified program IDs for mainnet and devnet. ## Quick Start Ask the agent to set up a Switchboard client on Solana devnet and read the current value of a given feed pubkey using the on-demand TypeScript SDK.

Frequently Asked Questions about switchboard

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I integrate Switchboard oracle price feeds on Solana?

Install @switchboard-xyz/on-demand, load the on-demand program with Anchor, and use PullFeed.fetchUpdateIx with a CrossbarClient to fetch oracle signatures. Build a versioned transaction with asV0Tx and send it to update the feed before reading its value.

What is the difference between Switchboard Oracle Quotes and pull feeds?

Oracle Quotes pass verified data directly to your program without on-chain storage, giving sub-second latency and 90% cost reduction. Pull feeds store values in a feed account requiring crank updates, which suits simpler use cases.

How do I use Switchboard VRF randomness in a Rust Anchor program?

Parse the randomness account with RandomnessAccountData::parse, then call get_value with the Clock sysvar to retrieve the random bytes. Use individual bytes for outcomes like coin flips or convert byte slices to integers for larger ranges.

Does Switchboard support real-time price streaming?

Yes, Switchboard Surge provides WebSocket streaming with sub-100ms latency via wss://surge.switchboard.xyz. Create a SwitchboardSurge client, subscribe to symbols like SOL/USD, and handle data, error, and reconnect events.

Why does my Switchboard transaction fail with no oracle responses?

This happens when oracles are unavailable or the feed hash is incorrect. Reduce numSignatures to 1, verify the feed exists in the Feed Builder for your network, and retry with exponential backoff.

What are the Switchboard program IDs for mainnet and devnet?

The mainnet oracle program is SW1TCH7qEPTdLsDHRgPuMQjbQxKdH2aBStViMFnt64f and devnet is Aio4gaXjXzJNVLtzwtNVmSqGKpANtXhybbkhtAC94ji2. Use the ON_DEMAND_MAINNET_PID and ON_DEMAND_DEVNET_PID constants exported by the SDK.