Core Subscription Rules
✅ Required Practices
Explicit Instrument Subscriptions- Always subscribe to specific instruments explicitly
- Each instrument requires a separate subscription request
- This ensures optimal performance and predictable data delivery
- Connect to the dedicated URL for your data type
- This reduces latency and improves connection stability
- See getting started guide for endpoint details
❌ Restrictions
No Instrument Wildcards"instrument": "ALL"
subscriptions are not supported- Wildcard instrument subscriptions will return an error
- Subscribe to each instrument individually instead
- Exchange wildcards are only available for Spot markets
- Futures and Options wildcards are coming in a future update
- Use explicit exchange parameters for derivatives
Subscription Patterns
Valid Subscription Examples
Single Exchange & Instrument:Invalid Subscription Examples
❌ Instrument Wildcard (Not Allowed):Connection Management
Distribute High-Volume Subscriptions
Single Connection Limits:- Each connection has a maximum subscription limit
- When limit is reached, open additional connections
- Distribute subscriptions strategically across connections
Connection Optimization
Dedicated Endpoints by Data Type:Data Category | Optimal Endpoint | Subscription Types |
---|---|---|
Spot | wss://ws.amberdata.com/spot | trades, tickers, ohlcv, order events |
Futures | wss://ws.amberdata.com/futures | trades, tickers, ohlcv, order events, funding rates, liquidations, open interest |
Options | wss://ws.amberdata.com/options | trades, tickers, ohlcv, order events, liquidations, open interest |
Blockchain | wss://ws.amberdata.com | blocks, transactions, logs |
Rate Limits by Access Tier
Access Level | API Key Type | Concurrent Connections | Subscriptions/Connection | Wildcards |
---|---|---|---|---|
Trial | UAT | 5 | 100 | ❌ Not supported |
On-Demand | UAO | 20 | 100 | ❌ Not supported |
Enterprise | UAK | Custom | Custom | ✅ Available |
Rate Limit Guidelines
Trial & On-Demand Users:- Plan subscriptions within your connection and subscription limits
- Use multiple connections to maximize throughput
- Consider upgrading to Enterprise for wildcard support
- Contact support for custom rate limit configuration
- Wildcard subscriptions available for qualifying use cases
- Advanced connection management options available
Performance Best Practices
Connection Stability
Implement Proper Error Handling:- Monitor connection health continuously
- Implement automatic reconnection with exponential backoff
- Handle subscription errors gracefully
- Monitor subscription count per connection
- Distribute load evenly across connections
- Close unused subscriptions promptly
Data Processing Efficiency
Handle High-Frequency Data:- Buffer incoming messages for batch processing
- Implement proper message queuing
- Use connection-specific threading if needed
- Process messages promptly to avoid buildup
- Implement proper cleanup for closed subscriptions
- Monitor memory usage in high-volume scenarios
Common Patterns
Market Data Collection
Cross-Exchange Monitoring
Troubleshooting Tips
- Start Small: Begin with a few subscriptions and scale up
- Monitor Performance: Track connection health and message rates
- Use Appropriate Endpoints: Match endpoint to data type for best performance
- Plan for Scale: Design with multiple connections from the start
- Test Error Scenarios: Ensure robust error handling and recovery
Next Steps
- Learn about advanced error handling and troubleshooting →
- Explore specific subscription types in the API reference
- Contact support for enterprise-level customization