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

# Token-to-Token Prices OHLC

> Onchain OHLCV bars (1 min-1 day) from AMM swap events. Direction-consistent across 10 EVM chains.

## Overview

* **Dataset ID:** `0404`
* **Table:** `blockdb_evm.b0404_token_to_token_prices_ohlc_v1`
* **Description:** Time-bucketed OHLC bars (1m..1d) per pool and token pair direction.
* **Primary key:** `(bucket_start, bucket_seconds, pool_uid, token_in, token_out)`
* **API:** [POST /evm/prices/spot/crypto/ohlc](/api-reference/evm/prices/crypto/prices-spot-ohlc)
* **CSV Sample:** [Download](https://huggingface.co/datasets/BlockDB/Token-Prices-OHLC-Ethereum-And-EVM-Cryptocurrency-Data/resolve/main/data/blockdb_evm.b0404_token_to_token_prices_ohlc_v1.csv?download=true)
* **JSON Sample:** [Download](https://huggingface.co/datasets/BlockDB/Token-Prices-OHLC-Ethereum-And-EVM-Cryptocurrency-Data/resolve/main/data/blockdb_evm.b0404_token_to_token_prices_ohlc_v1.json?download=true)

## Sample Viewer

<Frame>
  <iframe src="https://huggingface.co/datasets/BlockDB/Token-Prices-OHLC-Ethereum-And-EVM-Cryptocurrency-Data/embed/viewer/default/train" frameborder="0" width="100%" height="600px" />
</Frame>

## Columns

| Column                | Type             | Description                                                            |
| --------------------- | ---------------- | ---------------------------------------------------------------------- |
| `pool_uid`            | `BYTEA`          | Pool identifier; FK → `b0211_liquidity_pools_v1.pool_uid`.             |
| `exchange_id`         | `INTEGER`        | Exchange identifier.                                                   |
| `type_id`             | `INTEGER`        | Pool type identifier.                                                  |
| `bucket_start`        | `TIMESTAMPTZ`    | Inclusive UTC bucket start.                                            |
| `bucket_end`          | `TIMESTAMPTZ`    | Exclusive UTC bucket end; equals `bucket_start + bucket_seconds`.      |
| `bucket_seconds`      | `INTEGER`        | `60`, `300`, `900`, `1800`, `3600`, `14400`, or `86400`.               |
| `token_in`            | `BYTEA`          | Input token (20B); FK → `b0201_erc20_tokens_v1`.                       |
| `token_out`           | `BYTEA`          | Output token (20B); FK → `b0201_erc20_tokens_v1`.                      |
| `open`                | `NUMERIC(78,18)` | Opening price (token\_out per 1 token\_in, decimals-adjusted).         |
| `high`                | `NUMERIC(78,18)` | High price in bucket.                                                  |
| `low`                 | `NUMERIC(78,18)` | Low price in bucket.                                                   |
| `close`               | `NUMERIC(78,18)` | Closing price in bucket.                                               |
| `volume_in_raw`       | `NUMERIC(78,0)`  | Sum of raw UInt256 `amountIn` values (`0` for carry-forward buckets).  |
| `volume_in`           | `NUMERIC(78,18)` | Decimal-adjusted `token_in` volume; `NULL` if decimals unknown.        |
| `volume_out_raw`      | `NUMERIC(78,0)`  | Sum of raw UInt256 `amountOut` values (`0` for carry-forward buckets). |
| `volume_out`          | `NUMERIC(78,18)` | Decimal-adjusted `token_out` volume; `NULL` if decimals unknown.       |
| `trades_count`        | `BIGINT`         | Trade count in bucket.                                                 |
| `_tracing_id`         | `BYTEA`          | BlockDB tracing ID; unique.                                            |
| `_parent_tracing_ids` | `BYTEA[]`        | Tracing IDs of contributing swap prints; optional.                     |
| `_created_at`         | `TIMESTAMPTZ`    | Record creation time.                                                  |
| `_updated_at`         | `TIMESTAMPTZ`    | Record last update time.                                               |

## Related datasets

<CardGroup cols={2}>
  <Card title="Token-to-Token VWAP" icon="chart-line" href="/data-catalog/evm/prices/token-to-token-vwap">
    Volume-weighted benchmarks at matching intervals.
  </Card>

  <Card title="Swap prints" icon="arrows-left-right" href="/data-catalog/evm/prices/token-to-token-prices-swap-prints">
    Per-swap executions that aggregate into OHLC.
  </Card>
</CardGroup>
