Skip to main content

Switchboard Logo

Switchboard x Solana

A collection of libraries and examples for interacting with Switchboard V2 on Solana.

Test Status Anchor Test Status

Crates.io NPM Badge

Getting Started

To get started, clone the sbv2-solana repository.

git clone https://github.com/switchboard-xyz/sbv2-solana

Then install the dependencies

cd sbv2-solana
pnpm install
pnpm build

Addresses

Program Deployment

Below are the mainnet Solana addresses associated with the Switchboard deployment.

AccountAddress
Program ID
Program Authority
AttestationService
IdlAddress
AttestationIdlAddress

Queues

QueueAddress
Permissioned Queue

The permissioned queue requires aggregators to have PERMIT_ORACLE_QUEUE_USAGE permissions before using the queue's resources.

Permissionless Queue

The permissionless queue does not require aggregators to have PERMIT_ORACLE_QUEUE_USAGE permissions before using a queue's resources. This is the default queue when building feeds in the publisher.

Clients

LangNameDescription
Rustswitchboard-v2A Rust library to interact with Switchboard V2 accounts on Solana.
Javascript@switchboard-xyz/solana.jsA Typescript client to interact with Switchboard on Solana.

Examples

LangNameDescription
Rustnative-feed-parserRead a Switchboard feed using Solana's native program library
Anchoranchor-feed-parserRead a Switchboard feed using Anchor
Anchoranchor-history-parserRead a data feeds history buffer and get the closest historical sample to a given timestamp
Anchoranchor-vrf-parserRead a Switchboard VRF account and make a Cross Program Invocation (CPI) to request a new randomness value
Anchoranchor-vrf-lite-parserRead a Switchboard VRF Lite account and make a Cross Program Invocation (CPI) to request a new randomness value
Anchoranchor-buffer-parserRead a Switchboard buffer relayer using Anchor
Javascriptjavascript-feed-walkthroughCreate a private Switchboard queue and oracle and fulfill your own oracle updates

Troubleshooting

  1. File a GitHub Issue
  2. Ask a question in Discord #dev-support