
Product
Socket for Jira Is Now Available
Socket for Jira lets teams turn alerts into Jira tickets with manual creation, automated ticketing rules, and two-way sync.
@switchboard-xyz/switchboard-v2
Advanced tools
API wrapper for intergating with the Switchboardv2 program
A library of utility functions to interact with the Switchboardv2 program
npm i @switchboard-xyz/switchboard-v2
import * as anchor from "@project-serum/anchor";
import { clusterApiUrl, Connection, Keypair, PublicKey } from "@solana/web3.js";
import {
AggregatorAccount,
OracleQueueAccount,
loadSwitchboardProgram,
} from "@switchboard-xyz/switchboard-v2";
const payerKeypair = Keypair.fromSecretKey(
JSON.parse(fs.readFileSync("../keypair-path.json", "utf-8"))
);
const program = await loadSwitchboardProgram(
"devnet",
new Connection(clusterApiUrl("devnet")),
payerKeypair
);
const queueAccount = new OracleQueueAccount({
program: program,
// devnet permissionless queue
publicKey: new PublicKey("F8ce7MsckeZAbAGmxjJNetxYXQa9mKr9nnrC3qKubyYy"),
});
const aggregatorAccount = await AggregatorAccount.create(program, {
name: Buffer.from("FeedName"),
batchSize: 6,
minRequiredJobResults: 1,
minRequiredOracleResults: 1,
minUpdateDelaySeconds: 30,
queueAccount,
});
import * as anchor from "@project-serum/anchor";
import {
AggregatorAccount,
OracleQueueAccount,
} from "@switchboard-xyz/switchboard-v2";
const program: anchor.Program;
const queueAccount: OracleQueueAccount;
await aggregatorAccount.openRound({
oracleQueueAccount: queueAccount,
payoutWallet: tokenAccount,
});
import { AggregatorAccount } from "@switchboard-xyz/switchboard-v2";
import { Big } from "big.js";
const aggregatorAccount: AggregatorAccount;
const result: Big = await aggregatorAccount.getLatestValue();
console.log(result.toNumber());
FAQs
API wrapper for intergating with the Switchboardv2 program
We found that @switchboard-xyz/switchboard-v2 demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 5 open source maintainers collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Product
Socket for Jira lets teams turn alerts into Jira tickets with manual creation, automated ticketing rules, and two-way sync.

Company News
Socket won two 2026 Reppy Awards from RepVue, ranking in the top 5% of all sales orgs. AE Alexandra Lister shares what it's like to grow a sales career here.

Security News
NIST will stop enriching most CVEs under a new risk-based model, narrowing the NVD's scope as vulnerability submissions continue to surge.