본문으로 건너뛰기
Skillpedia
API 및 서버 (백엔드)7.0k · #13683

switchboard

하는 일

이 스킬은 Solana의 허가 없는 오라클 프로토콜인 Switchboard 연동을 안내합니다. 프로그램에 가격 피드, 검증 가능한 무작위성, 맞춤 데이터가 필요한 개발자를 위한 스킬입니다.

사용하는 경우

  • ✓Solana 프로그램이 승인 없이 배포할 수 있는 오라클에서 가격 피드를 필요로 할 때.
  • ✓게임이나 복권 기능에 검증 가능한 무작위성이 필요할 때.
  • ✓Surge 서비스로 지연 시간이 짧은 스트리밍 데이터를 원할 때.

스킬 링크

https://github.com/internet-court/internet-court-skill/blob/main/vendored/sendaifun/switchboard/SKILL.md

복사해서 AI(Claude, ChatGPT, Cursor)에 붙여넣고 지침을 따르도록 요청하세요.

사용 방법

가장 쉬운 방법입니다. 메시지를 복사해 AI에 붙여넣으세요. AI가 스킬을 읽고 지침을 따릅니다.

바로 붙여넣을 수 있는 메시지

Use this skill to help me: https://github.com/internet-court/internet-court-skill/blob/main/vendored/sendaifun/switchboard/SKILL.md Read the SKILL.md file at that link and follow its instructions for my task.
AI가 이런 스킬을 알아서 찾아 쓰길 원하시나요?무료 Skillpedia MCP를 설치하세요. 한 줄이면 작업마다 스킬 15,000+개 중에서 검색합니다.1분 만에 설치 →

AI에게 요청하는 예시

“제 Solana 프로그램에 Switchboard 가격 피드를 추가하고 최신 가격을 읽도록 도와주세요.”

매주 새 스킬 5개. 읽는 데 1분.

작동 방식

에이전트는 Switchboard SDK를 설정하고, 온디맨드 견적, 가격 피드, 스트리밍 중에서 고르고, 데이터를 읽는 코드를 작성합니다. 프로젝트에 따라 Rust 또는 TypeScript 연동을 사용합니다.

기술 내용 (원본 SKILL.md)

작성자의 영어 원문을 GitHub에서 그대로 가져왔습니다.

Switchboard Oracle Protocol - Complete Integration Guide

The definitive guide for integrating Switchboard - the fastest, most customizable, and only permissionless oracle protocol on Solana.

What is Switchboard?

Switchboard is a permissionless oracle protocol enabling developers to bring custom data on-chain with industry-leading performance:

  • Price Feeds - Real-time asset pricing with pull-based efficiency
  • Oracle Quotes - Sub-second latency without on-chain storage (90% cost reduction)
  • Surge - WebSocket streaming with sub-100ms latency
  • VRF Randomness - Cryptographically secure verifiable random functions
  • Prediction Markets - Market-based forecasting data

Key Statistics

  • Secures $1B+ in on-chain volume
  • Used by Kamino, Jito, MarginFi, Drift Protocol
  • 2-5ms latency with Surge pricing
  • 90% cost reduction vs traditional oracles

Core Principles

Principle Description
Speed 2-5ms with Surge, 400ms standard - industry-leading for DeFi
Cost Efficiency Pull-based feeds eliminate constant streaming costs
Permissionless Deploy feeds instantly without approvals
Security TEE (Trusted Execution Environments) prevent data manipulation

Integration Approaches

1. Oracle Quotes (Recommended)

Direct oracle-to-program data flow without on-chain storage:

  • Sub-second latency
  • 90% cost reduction
  • No write locks (parallel reads)
  • Stateless design

2. Traditional Feeds

Classic pull-based feed updates:

  • Feed account maintenance
  • Cranking operations
  • Good for simple use cases

3. Surge (Real-Time)

WebSocket streaming for high-frequency applications:

  • Sub-100ms latency
  • Persistent connections
  • Ideal for trading interfaces

Program IDs

Program Mainnet Devnet
Oracle Program SW1TCH7qEPTdLsDHRgPuMQjbQxKdH2aBStViMFnt64f Aio4gaXjXzJNVLtzwtNVmSqGKpANtXhybbkhtAC94ji2
Quote Program orac1eFjzWL5R3RbbdMV68K9H6TaCVVcL6LjvQQWAbz -

Default Queues

Network Queue Address
Mainnet A43DyUGA7s8eXPxqEjJY6EBu1KKbNgfxF8h17VAHn13w
Devnet EYiAmGSdsQTuCw413V5BzaruWuCCSDgTPtBGvLkXHbe7

Quick Start

Installation

# TypeScript SDK
npm install @switchboard-xyz/on-demand @switchboard-xyz/common

# Rust (Cargo.toml)
# switchboard-on-demand = "0.8.0"

Basic Setup

import { web3, AnchorProvider, Program } from "@coral-xyz/anchor";
import {
  PullFeed,
  CrossbarClient,
  ON_DEMAND_MAINNET_PID,
  ON_DEMAND_DEVNET_PID
} from "@switchboard-xyz/on-demand";

// Setup connection and provider
const connection = new web3.Connection("https://api.mainnet-beta.solana.com");
const wallet = useWallet(); // or Keypair
const provider = new AnchorProvider(connection, wallet);

// Load Switchboard program
const sbProgram = await Program.at(ON_DEMAND_MAINNET_PID, provider);

// Initialize Crossbar client for oracle communication
const crossbar = new CrossbarClient("https://crossbar.switchboard.xyz");

Price Feeds

Fetch and Update Feed

import { PullFeed, asV0Tx } from "@switchboard-xyz/on-demand";

// Create feed account reference
const feedPubkey = new web3.PublicKey("YOUR_FEED_PUBKEY");
const feedAccount = new PullFeed(sbProgram, feedPubkey);

// Fetch update instruction with oracle signatures
const { pullIx, responses, numSuccess, luts } = await feedAccount.fetchUpdateIx({
  crossbarClient: crossbar,
  chain: "solana",
  network: "mainnet", // or "devnet"
});

// Build and send transaction
const tx = await asV0Tx({
  connection,
  ixs: [pullIx],
  signers: [payer],
  computeUnitPrice: 200_000,
  computeUnitLimitMultiple: 1.3,
  lookupTables: luts,
});

const signature = await connection.sendTransaction(tx);
console.log("Feed updated:", signature);

Read Feed Value

// Get current feed value
const feedData = await feedAccount.loadData();
const value = feedData.value.toNumber();
const lastUpdated = feedData.lastUpdatedSlot;

console.log(`Price: ${value}, Last Updated: ${lastUpdated}`);

Oracle Quotes (Recommended)

Oracle Quotes provide the most efficient way to consume oracle data:

import { OracleQuote } from "@switchboard-xyz/on-demand";

// Feed hashes (64-char hex strings)
const feedHashes = [
  "0x...", // SOL/USD
  "0x...", // BTC/USD
];

// Derive canonical quote account
const queueKey = new web3.PublicK
자주 묻는 질문

Switchboard는 허가가 필요 없나요?

네. 스킬은 누구의 승인 없이도 피드를 배포할 수 있다고 말합니다.

VRF 무작위성이란 무엇인가요?

안전한 난수 값을 제공하는 검증 가능한 난수 함수라고 스킬은 설명합니다.

보안 하드웨어를 쓰나요?

스킬은 신뢰 실행 환경이 데이터 조작을 막는 데 도움이 된다고 말합니다.

상세 정보

작성자의 원본 설명

Complete Switchboard Oracle Protocol SDK for Solana - the permissionless oracle solution for price feeds, on-demand data, VRF randomness, and real-time streaming via Surge. Covers TypeScript SDK, Rust integration, Oracle Quotes, and all Switchboard tools.

repo: internet-court/internet-court-skill

인기도

GitHub 스타
7.0k
순위
#13683
라이선스
—
업데이트
2026. 10. 26.

이 스킬이 유용한가요?

0

로그인 투표하려면 로그인하세요.

댓글

  • …

이 저장소의 다른 스킬

비슷한 스킬