> ## Documentation Index
> Fetch the complete documentation index at: https://goldrush.dev/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# OHLCV Markets on Solana

> Real-time OHLCV candles on Solana. Subscribe by pair address or by token mint.

GoldRush exposes two OHLCV streams on `SOLANA_MAINNET`:

* **`ohlcvCandlesForPair`** - candles for a specific pool address.
* **`ohlcvCandlesForToken`** - candles aggregated across pools carrying that SPL mint.

Both deliver candles in real time over WebSocket as new swaps land in the pool.

## Stream candles for a specific pool

Best for charting one pool.

```graphql GraphQL Subscription theme={null}
subscription {
  ohlcvCandlesForPair(
    chain_name: SOLANA_MAINNET
    pair_addresses: ["58oQChx4yWmvKdwLLZzBi4ChoCc2fqCUWBkwMihLYQo2"]
    interval: ONE_MINUTE
    timeframe: ONE_HOUR
  ) {
    pair_address
    timestamp
    open
    high
    low
    close
    volume_usd
  }
}
```

`pair_addresses` is an array of base58 pool addresses. You can subscribe to multiple pools on one subscription.

## Stream candles for a token (across all pools)

`ohlcvCandlesForToken` aggregates across pools carrying that mint.

```graphql theme={null}
subscription {
  ohlcvCandlesForToken(
    chain_name: SOLANA_MAINNET
    token_addresses: ["EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v"]
    interval: ONE_MINUTE
    timeframe: ONE_HOUR
  ) {
    timestamp
    open
    high
    low
    close
    volume_usd
  }
}
```

## When to use pairs vs tokens

| Use case                                             | Stream                                         |
| ---------------------------------------------------- | ---------------------------------------------- |
| Chart a single pool                                  | `ohlcvCandlesForPair` with the pool address    |
| Track arbitrage between two venues for the same pair | `ohlcvCandlesForPair` with both pool addresses |
| Get the USD price of a token aggregated across pools | `ohlcvCandlesForToken`                         |

## Patterns

### TradingView chart

Subscribe to `ohlcvCandlesForPair` at the user's selected interval; push candles into TradingView's UDF datafeed adapter. The `timestamp / open / high / low / close / volume_usd` fields map 1:1 to UDF.

### Discovery → chart

Pair this stream with the [DEX firehose](/goldrush-solana/streaming/dex-firehose): when a new pool appears in `newPairs`, automatically subscribe to its OHLCV. Limit to pools above a `liquidity` threshold to avoid spam.

### Pricing service

Use [`ohlcvCandlesForToken`](/api-reference/streaming-api/subscriptions/ohlcv-tokens-stream) on `1d` candles for an aggregated USD price.

## Related

* [DEX firehose](/goldrush-solana/streaming/dex-firehose) - discover new pools to subscribe to.
* [OHLCV Pairs Stream reference](/api-reference/streaming-api/subscriptions/ohlcv-pairs-stream) - full subscription schema.
* [OHLCV Tokens Stream reference](/api-reference/streaming-api/subscriptions/ohlcv-tokens-stream) - full subscription schema.
