Real-Time Data Streaming
Smart Money API supports real-time data streaming via WebSocket and Server-Sent Events (SSE). Stream live whale movements, exchange flows, miner metrics, and market signals without polling. This guide covers WebSocket connection setup, channel subscriptions, and handling real-time events with millisecond latency.
WebSocket Connection Setup
WebSocket connections enable bidirectional real-time communication. Connect to wss://api.smartmoneyapi.com/ws and authenticate immediately after connection.
WebSocket benefits: Lower latency (50-100ms vs 1000ms polling), bi-directional (server can push anytime), efficient bandwidth usage, and no connection overhead per message. Perfect for trading bots requiring immediate market signals.
Server-Sent Events (SSE)
SSE provides unidirectional server-to-client streaming over HTTP. Simpler than WebSocket for read-only use cases. Connect to https://api.smartmoneyapi.com/sse and the server pushes updates automatically. Best for dashboards and monitoring applications that don't require two-way communication.
Available Channels
Smart Money API provides 20+ streaming channels covering all market intelligence:
- whale.movements: Live whale transaction detection (100ms latency)
- whale.accumulation: Accumulation/distribution pattern changes
- exchange.flows: Real-time exchange inflows and outflows
- exchange.net_flow: Net flow calculations and reversals
- miners.activity: Mining pool changes and profitability shifts
- miners.hash_rate: Network hash rate updates every 2 minutes
- metrics.nvt: NVT ratio crossing thresholds
- metrics.mvrv: MVRV ratio signals
- price.updates: Price movements with volume context
- alerts.critical: High-priority market events
Channel Subscriptions
Subscribe to specific channels by sending subscription messages. Each subscription can have filters for precision targeting.
Message Format
All real-time messages follow consistent JSON format with timestamp, event type, and data payload. Event IDs enable deduplication in case of retransmission.
Reconnection Handling
Implement exponential backoff reconnection: 1s, 2s, 4s, 8s, 30s intervals. Store subscription list to automatically re-subscribe after reconnection. Smart Money API supports persistent connection state for seamless failover.
Performance Optimization
Use channel filters to reduce message volume. Subscribe to specific whale tiers, minimum transaction amounts, and metric thresholds. Process messages asynchronously using queues to prevent blocking. Implement backpressure handling if processing falls behind message rate.
Complete Examples
See integration guides for full working examples in Python, JavaScript, Go, and Rust. Reference implementations handle reconnection, message processing, error handling, and production monitoring patterns.