description |
---|
Welcome to the Switchboard documentation gitbook! |
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.
- ⚡ 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 Oracle Quotes instantly
- 🌐 Auto-Reconnect: Built-in connection recovery
- 📊 Enterprise-Ready: 99.9% uptime with global infrastructure
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 Oracle Quote
if (shouldExecuteTrade(response)) {
const [ix, oracleQuote] = response.toBundleIx();
await executeTrade(ix, oracleQuote);
}
});
Get Started with Surge → | Request API Access
For on-chain integrations, Switchboard's revolutionary Oracle Quotes 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
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
Use Oracle Quotes for efficient on-chain integration:
- DeFi protocols
- Lending platforms
- Perpetual exchanges
- Gaming applications
Use Standard Feeds when you need:
- Historical price data
- Shared on-chain state
- Compatibility with existing systems
- Surge Documentation - Ultra-low latency WebSocket streaming
- Oracle Quote Builder - Create custom price feeds
- GitHub Examples - Code samples and templates
- Discord Community - Get support and connect
Want our media kit? See here