OHLCV Tokens Stream
The OHLCV Tokens stream provides real-time updates on the Open, High, Low, Close prices and Volume of one or many tokens at configurable intervals. This documentation follows our standard streaming API structure.
Credit Cost
Supported Chains
- Base Mainnet
- BSC Mainnet
- Ethereum Mainnet
Supported DEXes
- Uniswap V2, V3
- PancakeSwap
This stream is currently in Beta. It is stable for testing and evaluation but may undergo changes in schema or behavior as we continue to improve it. No API credits are currently charged.
We welcome your feedback so please reach out to us directly to report issues or request features.
Authentication
Using any of the GoldRush developer tools requires an API key.
Get Started
Sign up for a free API key to get started with GoldRush.
Parameters
Parameter | Type | Required | Description |
---|---|---|---|
chain_name | enum | Yes | Chain name to filter events (e.g. BASE_MAINNET , ETH_MAINNET , BSC_MAINNET ) |
token_addresses | array<string> | Yes | Array of token addresses on supported DEXes and chains to track |
interval | enum | Yes | Frequency of OHLCV data updates, ranging from sub-second to one day |
timeframe | enum | Yes | Historical lookback period for OHLCV data, ranging from one minute to one month |
limit | int | No | Maximum number of items returned per stream message to control payload size |
Connection
If you’re not using the graphql-ws
package, you must set the WebSocket protocol header:
"Sec-WebSocket-Protocol" : "graphql-transport-ws"
This header is required for the server to properly recognize and handle your GraphQL subscription requests.
The WebSocket uses the GraphQL query
or subscription
protocol. Here are examples of how one can connect with different languages:
Subscription
Once connected, you can subscribe to the ohlcvCandlesForToken
endpoint to receive the pricing data and events.
Basic Subscription Query
Complete Subscription Query
Implementation
Response Format
Here’s an example of the response data structure:
Response Fields
Field | Type | Description |
---|---|---|
chain_name | string | The blockchain network where the token exists |
pair_address | string | The address of the primary DEX pool with the most liquidity for the token |
interval | enum | The candle interval |
timeframe | enum | The requested timeframe |
timestamp | string | ISO timestamp for the candle |
open | float | Opening price for the interval |
high | float | Highest price during the interval |
low | float | Lowest price during the interval |
close | float | Closing price for the interval |
volume | float | Trading volume during the interval |
volume_usd | float | Trading volume in USD |
quote_rate | float | Exchange rate between base and quote tokens |
quote_rate_usd | float | USD value of the quote rate |
base_token | object | Information about the queried token |
quote_token | object | Information about the paired token of the primary DEX pool |