Switchboard Agent Skill
Purpose
Provide a compact “front door” for all Switchboard work:
Enforce security/permissions and secret-handling rules consistently
Normalize terms and identifiers (feed IDs, queues, update payloads)
Route requests to the correct specialized Switchboard skill(s)
Produce consistent, integration-ready outputs
Dependencies
Use exact pins from the SDK Version Matrix.
@switchboard-xyz/[email protected]@switchboard-xyz/[email protected]@switchboard-xyz/[email protected]@switchboard-xyz/[email protected]@switchboard-xyz/[email protected]@switchboard-xyz/[email protected]switchboard-on-demand = "0.11.3"switchboard-protos = "0.2.4"
Scope
This skill covers:
Capturing and enforcing an
OperatorPolicyInterpreting intent (feeds vs Surge vs randomness vs Crossbar vs X402)
Selecting and sequencing specialized skills
Standard output format for plans and execution steps
Out of scope (handled by specialized skills):
Chain-specific transaction composition details
Chain-specific on-chain verifier/consumer code
Crossbar deployment configuration details
Subskills
Hard Rules: Security & Permissions Contract
MUST establish OperatorPolicy before any of the following
OperatorPolicy before any of the followingYou MUST have an explicit OperatorPolicy before you:
sign transactions (any chain)
move funds / pay fees
deploy contracts/programs/packages
write to on-chain state
store/persist secrets (private keys, JWTs, API keys)
If missing, ask one compact question set and store answers as OperatorPolicy.
OperatorPolicy (required)
Capture these fields (ask if missing):
Target chain(s): Solana/SVM, EVM (chain IDs), Sui, Aptos, Iota, Movement
Network per chain: mainnet/testnet/devnet (and any custom cluster name)
Autonomy mode
read_only(no keys)plan_only(no signing; provide exact steps)execute_with_approval(propose each tx and wait for approval)full_autonomy(execute within constraints)
Spend limits (required for any execute mode) Ask whether the user would like to set:
max per-tx spend (native token + fees)
max daily spend
max total spend for the task
Allow/Deny lists Ask whether the user would like to set:
allowlist/denylist of program IDs (Solana/SVM), contract addresses (EVM), package IDs (Move/Sui)
allowlist/denylist of RPC endpoints
Key custody & handling
where keys come from (file path, keystore, env var, remote signer)
whether keys may be persisted (default: NO)
whether mainnet signing is allowed (explicit YES required)
Data validation defaults (overrideable per request)
minResponses/minSampleSizemaxVariance/maxDeviationBpsmaxStaleness/maxAgeSeconds/ chain-equivalent
Data Validation Default Presets
Use these as baseline defaults when capturing OperatorPolicy, then override per request if needed:
Devnet
1
1000
1000000000
300
750
300000
prototyping / non-critical
Standard (default)
2
500
1000000000
60
150
60000
general production
High-risk
3
200
1000000000
30
75
30000
liquidation / settlement / payouts
Preset selection rules:
devnetnetwork -> default toDevnet.mainnet/testnet -> default to
Standard.safety-critical financial logic -> escalate to
High-risk.
OperatorPolicy devnet defaults
For quick devnet experimentation, prefill OperatorPolicy with these defaults and then ask only for missing high-impact constraints (for example allow/deny lists or custom RPCs):
Notes:
These are starter defaults, not a bypass of required policy capture.
For non-Solana chains, keep the same safety posture and translate native token/key custody fields to chain-appropriate values.
Solana slot values are approximate mappings for documentation convenience (~400ms/slot).
maxVarianceis chain-native and kept at1e9baseline unless explicitly overridden.
Secret handling (mandatory)
NEVER print secrets, private keys, seed phrases, API tokens, Pinata JWTs, or full
.envcontents.If referencing a secret, use placeholder names (e.g.,
$PINATA_JWT_KEY,$API_KEY).Prefer encrypted keystores / secret managers.
Never recommend
export PRIVATE_KEY=...in shell history.
Core Concepts and Terms
Pull-based oracle model
Data is fetched off-chain and then submitted on-chain for verification and use.
For safety-critical logic, update and read should be atomic (same tx / same entry call), where the chain supports it.
Feed identifiers (normalized)
Use these names consistently:
feedId: 32-byte identifier (commonly0x+ 64 hex chars).feedDefinition: job pipelines (OracleJob[]) describing how to compute values.queueId: oracle subnet/queue identifier (chain-specific type).updatePayload: chain-specific proof/data used for on-chain verification.
Note: Some SDKs/docs say “feed hash” for the same 32-byte feedId. Treat the 32-byte identifier as feedId unless explicitly dealing with content-addressed feed definition storage.
Variable overrides (security invariant)
Variable overrides (
${VAR}) are for secrets only (API keys, auth tokens, payment headers).Do not use overrides for URLs, JSON paths, IDs, multipliers, selectors, or anything that changes data selection logic.
Routing Logic
Step 1: classify the request
Determine intent:
Feeds
Custom feed design
Crossbar
Surge streaming
Randomness
X402 micropayments
Determine chain:
Solana/SVM
EVM
Sui
Aptos
Iota
Movement
Step 2: route to specialized skills
Chain routing:
Solana/SVM feeds →
switchboard-solana-svm-feedsEVM feeds →
switchboard-evm-feedsSui feeds →
switchboard-sui-feedsAptos feeds →
switchboard-aptos-feedsIota feeds →
switchboard-iota-feedsMovement feeds →
switchboard-movement-feeds
Feature routing:
Feed design →
switchboard-feed-designSimulation/store/self-host →
switchboard-crossbar-opsStreaming (Surge) →
switchboard-surgeRandomness →
switchboard-randomnessX402 micropayments →
switchboard-x402
Step 3: common multi-skill sequences
“I need a new feed”
switchboard-feed-design→switchboard-crossbar-ops→ chain feed skill
“Integrate an existing feed”
chain feed skill → optional
switchboard-crossbar-ops(simulate)
“Use Surge prices on-chain”
switchboard-surge→ chain feed skill (settlement path)
“Use randomness”
switchboard-randomness→ (optional) chain skill for integration
Minimal Example
Route one request to the right subskill and emit the standard output sections:
Getting Started: First Solana Feed in 5 Minutes (Devnet)
Objective: create a minimal BTC/USD feed definition, store it in Crossbar, and then update+read it on Solana in one transaction.
Flow map: switchboard-feed-design -> switchboard-crossbar-ops -> switchboard-solana-svm-feeds
Step 1: Define a minimal single-source BTC/USD job
Use one source for fastest first success. This is a devnet quickstart baseline.
Step 2: Store the job in Crossbar and capture feed identifier
Step 3: Simulate once to validate result shape
Step 4: Run minimal Solana update+read transaction
Step 5: Confirm output and next hardening step
Success criteria:
/simulate/{id}returns numeric results.The transaction simulates and sends successfully.
Program logs show the feed was read from the canonical quote account.
Next hardening step:
Replace the single-source job with a multi-source median template and tighten validation defaults (
minResponses, staleness, and deviation limits) per yourOperatorPolicy.
Caution: Crossbar/docs may use
feedHashand some SDK flows sayfeedIdfor the same 32-byte identifier. In this quickstart, use the identifier returned by/storeas thefeedIdinput to update calls. This is a devnet-first flow; for production, use multi-source jobs and stricter policy constraints.
Quick links:
Standard Output Format
When producing artifacts, use these headings:
Summary
Assumptions
OperatorPolicy
Plan
Execution Steps (only if allowed)
Rollback / Recovery
Risks & Mitigations
Next Actions
References
https://docs.switchboard.xyz/
https://docs.switchboard.xyz/tooling/crossbar
https://docs.switchboard.xyz/custom-feeds/task-types
https://docs.switchboard.xyz/custom-feeds/advanced-feed-configuration/data-feed-variable-overrides
Last updated