Switchboard On Demand
Welcome to the Switchboard documentation gitbook!
🌊 Introducing Switchboard Surge
The fastest oracle data delivery system ever built - Sub-100ms latency WebSocket streaming
Switchboard Surge represents the future of oracle technology, delivering real-time price feeds directly to your applications with unprecedented speed and efficiency. Whether you're building high-frequency trading systems, real-time dashboards, or latency-critical DeFi protocols, Surge provides the performance edge you need.
Why Surge?
⚡ Ultra-Low Latency: <100ms from price source to your application
🔄 Real-Time Streaming: WebSocket connections deliver prices as they change
💰 Currently FREE: No cost during launch phase (5 concurrent connections)
🔗 Seamless Integration: Convert streams to on-chain bundles instantly
🌐 Auto-Reconnect: Built-in connection recovery
📊 Enterprise-Ready: 99.9% uptime with global infrastructure
Quick Start with Surge
import * as sb from "@switchboard-xyz/on-demand";
// Initialize Surge
const surge = new sb.Surge({
apiKey: process.env.SURGE_API_KEY!
// No gatewayUrl needed - uses default
});
// Discover available feeds
const feeds = await surge.getSurgeFeeds();
console.log(`${feeds.length} feeds available`);
// Stream real-time prices
await surge.connectAndSubscribe([
{ symbol: 'BTC/USD' },
{ symbol: 'SOL/USD' }
]);
// Handle price updates
surge.on('update', async (response: sb.SurgeUpdate) => {
console.log(`${response.data.symbol}: $${response.data.price}`);
// Use for trading, dashboards, or convert to on-chain bundle
if (shouldExecuteTrade(response)) {
const [ix, bundle] = response.toBundleIx();
await executeTrade(ix, bundle);
}
});
Get Started with Surge → | Request API Access
📦 Switchboard Bundles: The New Standard
For on-chain integrations, Switchboard's revolutionary bundle method eliminates write locks and reduces costs:
No Data Feed Accounts: Zero setup - no accounts to create or fund
No Write Locks: Unlimited parallelization
Currently FREE: No cost during launch phase (30 requests/min)
Instant Setup: Start using prices immediately
Zero Maintenance: No cranks or upkeep required
🚀 Choose Your Integration Path
For Real-Time Applications
Use Surge for the absolute fastest data delivery:
Perpetual exchanges - Real-time mark prices and liquidations
Oracle-based AMMs - Eliminate impermanent loss with oracle pricing
High-frequency trading bots
MEV-sensitive operations
For Smart Contracts
Use Bundles for efficient on-chain integration:
DeFi protocols
Lending platforms
Perpetual exchanges
Gaming applications
For Traditional Use Cases
Use Standard Feeds when you need:
Historical price data
Shared on-chain state
Compatibility with existing systems
🛠️ Quick Links
Surge Documentation - Ultra-low latency WebSocket streaming
Bundle Builder - Create custom price feeds
GitHub Examples - Code samples and templates
Discord Community - Get support and connect
📚 Documentation Overview
Getting Started
Product Documentation
Developer Resources
Protocol & Infrastructure
Want our media kit? See here
Last updated