Streaming API SDK Guide
With the official TypeScript Client SDK, developers can access the Streaming API and leverage the following advanced features described in this guide.Basic Subscription
The following code sample shows how to set up a subscription to the OHLCV Pairs stream:GoldRush SDK
Multiple Subscriptions
The SDK uses a singleton WebSocket client internally, allowing you to create multiple subscriptions through the same GoldRushClient.GoldRush SDK
React Integration
For React applications, use theuseEffect hook to properly manage subscription lifecycle:
GoldRush SDK
GraphQL Queries
You can also use raw GraphQL queries for more streamlined and selective data scenarios:GoldRush SDK
GraphQL Endpoints Reference
List of endpoints
| Functionality | Endpoint Type | |
|---|---|---|
| OHLCV Tokens Stream | subscription | subscription { ohlcvCandlesForToken { ... } } |
| OHLCV Pairs Stream | subscription | subscription { ohlcvCandlesForPair { ... } } |
| New DEX Pairs Stream | subscription | subscription { newPairs { ... } } |
| Update Pairs Stream | subscription | subscription { updatePairs { ... } } |
| Wallet Activity Stream | subscription | subscription { walletTxs { ... } } |
| Token Search Query | query | query { searchToken { ... } } |
| Top Trader Wallets for Token Query | query | query { upnlForToken { ... } } |
| Wallet PnL by Token Query | query | query { upnlForWallet { ... } } |
Fetching the schema
Streaming-Specific Troubleshooting
WebSocket Connection Issues
- Verify URL:
wss://gr-staging-v2.streaming.covalenthq.com/graphql - Set protocol header:
Sec-WebSocket-Protocol: graphql-transport-ws - Auth errors only surface on subscription start, not on WebSocket connect
Chain Name Format
- Streaming API uses
SCREAMING_SNAKE_CASE:ETH_MAINNET,BASE_MAINNET - Foundational API uses
kebab-case:eth-mainnet,base-mainnet - Using the wrong format will silently fail (no data received)
Subscription Not Receiving Data
- Check chain supports Streaming (not all chains do)
- Verify chain name format (SCREAMING_SNAKE_CASE)
- Ensure API key is valid (connection_ack always succeeds regardless)