Connect to the gateway and authenticate
Subscribe to feeds
Optional
batchIntervalMs: numberValidate that feeds exist and sources are available before attempting to subscribe
Array of feed subscriptions to validate
Internal retry counter (defaults to 0)
Connect to gateway and subscribe to feeds in one operation with proper error handling This is the recommended method for most use cases as it validates feeds before any connection attempts
Array of feed subscriptions
Optional
batchIntervalMs: numberSubscribe to all available feeds with optional source filtering
Optional
sources_: Source[]Optional
batchIntervalMs: numberCheck if a specific feed exists
The symbol to check (e.g., "BTC/USD")
Optional
source: string | SourceOptional source to check (e.g., Source.WEIGHTED)
true if the feed exists
Get available feeds for a specific symbol
The symbol to query (e.g., "BTC/USD")
The feed data for this symbol, or null if not found
Disconnect from the gateway
Get current connection state
Get list of active subscriptions
Surge - WebSocket streaming client for Switchboard On-Demand feeds
Provides real-time streaming of price updates with automatic processing into Solana transaction instructions. Supports both direct symbol/source subscriptions and feedHash-based subscriptions with automatic detection and conversion.
Example