Switchboard Surge Skill
Purpose
Use Switchboard Surge for low-latency streaming:
Subscribe to signed updates over WebSocket
Monitor latency/health and implement reconnection
Convert signed updates for on-chain settlement (chain-specific)
Preconditions
OperatorPolicyexists.If creating/modifying a paid subscription, explicit approval is required.
Inputs to Collect
subscription wallet/network (Solana)
symbol/feed list
target usage: bot-only vs on-chain settlement vs UI display
validation thresholds (max staleness, deviation checks) if safety-critical
Playbook
1) Subscribe to signed updates (TypeScript skeleton)
Subscription
Surge subscriptions are managed on Solana via the Surge program (orac1eFjzWL5R3RbbdMV68K9H6TaCVVcL6LjvQQWAbz). To subscribe programmatically:
Choose a tier (Plug/Pro/Enterprise). Tiers are on-chain PDAs.
Acquire SWTCH tokens (payments are in SWTCH only).
Fetch a fresh SWTCH/USDT oracle quote and include it in the same transaction.
Call
subscription_initwithtier_idandepoch_amount. The program prices the subscription in SWTCH using the live quote and creates your subscription PDA.
Key notes:
If the keypair has no active subscription,
connectAndSubscribefails.Tiers and limits are enforced on-chain (max feeds, connections, min delay).
For UI-free flows, derive PDAs (
STATE,TIER,SUBSCRIPTION) and pass required accounts.
Minimal sketch (quote + subscription_init in one tx):
2) Convert for on-chain settlement
Solana: convert to quote/update instructions and include before consumer ix in the same tx.
EVM: convert to EVM-compatible bytes and submit via
updateFeeds.
3) Reliability
heartbeat monitoring
exponential backoff reconnect
last-seen tracking and gap detection
metrics logging
References
https://docs.switchboard.xyz/docs-by-chain/solana-svm/surge
https://docs.switchboard.xyz/ai-agents-llms/surge-subscription-guide
https://docs.switchboard.xyz/docs-by-chain/evm/surge
https://docs.switchboard.xyz/docs-by-chain/sui/surge
Last updated