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

# Prices overview

> Token price data across multiple blockchains

export const DuneEmbed = ({qID, vID, height = '500px'}) => <>
    <div className="hidden dark:block">
      <iframe src={`https://dune.com/embeds/${qID}/${vID}?darkMode=true`} style={{
  width: '100%',
  height,
  border: 'none',
  marginTop: '10px'
}}></iframe>
    </div>
    <div className="dark:hidden">
      <iframe src={`https://dune.com/embeds/${qID}/${vID}`} style={{
  width: '100%',
  height,
  border: 'none',
  marginTop: '10px'
}}></iframe>
    </div>
  </>;

Dune provides comprehensive, reliable token price data for use in your queries across 70+ blockchains. Our price system combines external market data with on-chain trading activity to deliver accurate pricing for both major tokens and the long tail of emerging assets. Whether you're building dashboards, conducting research, or powering applications, you can access consistent price data at multiple time granularities with transparent sourcing and quality controls.

<Info>
  **Maintained by:** Dune · **Refresh:** \~30 min · **Chains:** 70+ blockchains
</Info>

<Card title="Get This Data" icon="database" href="https://dune.com/enterprise?dataset=prices">
  Access price data via API, Datashare, or the Dune App.
</Card>

## Key Features

* **Multi-blockchain support**: Prices for tokens across 70+ blockchains
* **Multiple time granularities**: minute, hourly, daily, and latest price data
* **Source transparency**: Each price point includes its data source
* **Data quality**: Comprehensive filtering to ensure price reliability
* **Standardized native token addresses**: Native tokens (like ETH, BNB) have fixed contract addresses for consistency
* **Volume-weighted pricing**: Prices are calculated using volume-weighted averages for more accurate representation
* **Enhanced outlier detection**: Multi-layered filtering system to reduce impact of anomalous trades

## Available Tables

The `prices` schema exposes these main tables:

| Table           | Description                                         |
| --------------- | --------------------------------------------------- |
| `prices.latest` | The most recent price for each token                |
| `prices.day`    | Daily token prices using hybrid approach            |
| `prices.hour`   | Hourly token prices using hybrid approach           |
| `prices.minute` | Minute-by-minute token prices using hybrid approach |

## Methodology

### Hybrid Pricing Approach

All tables use the same methodology combining two data sources:

1. **Coinpaprika** (\~2,000 major tokens)
   * External market data from aggregated exchanges
   * Available at 5-minute intervals
   * Aggregated to hourly/daily, interpolated for minute-level

2. **DEX-derived** (long tail tokens)
   * On-chain trading activity from `dex.trades`
   * Quality filtering to reduce anomalous trades:
     * **VWMP Outlier Detection**: Prices deviating >3x from 7-day rolling median
     * **MAD Outlier Detection**: Prices deviating >2x median absolute deviation
     * **Transfer Outlier Detection**: Token amounts exceeding max transfer amounts
     * **Volume Outlier Detection**: Trades \<$0.01 or &gt;$1M
   * Aggregated into 1 hour intervals using volume-weighted averages
   * Minimum \$10k volume thresholds

3. **Forward-filling** when no activity exists:
   * Daily: 30 days max | Hourly: 7 days max | Minute: 2 days max

Token lists are defined in the [open-source repository](https://github.com/duneanalytics/spellbook/tree/main/dbt_subprojects/tokens/models/prices).

<Warning>
  Our dex-derived pricing represents our best-effort approach using comprehensive filtering and volume-weighted calculations to deliver accurate prices. While the methodology is designed to be as robust as possible, outliers and edge cases can occur in decentralized trading data. The methodology above provides full transparency into how prices are calculated.
</Warning>

## Coverage

* 900,000 unique tokens
* 70+ blockchains
* tokens are automatically added when they exceed a \$10k volume threshold

<DuneEmbed qID="4239607" vID="7131816" height={500} />

<CardGroup cols={1}>
  <Card title="Check Price Coverage" href="https://dune.com/dune/does-dune-have-price-for-token" icon="magnifying-glass">
    You can test the coverage of the prices tables on this dashboard.
  </Card>
</CardGroup>

## Schema

All price tables share the following schema:

| Column             | Type        | Description                                              |
| ------------------ | ----------- | -------------------------------------------------------- |
| `blockchain`       | *varchar*   | Blockchain identifier (e.g., 'ethereum', 'arbitrum')     |
| `contract_address` | *varbinary* | Token contract address (fixed address for native tokens) |
| `symbol`           | *varchar*   | Token symbol (e.g., 'ETH', 'USDC')                       |
| `price`            | *double*    | USD price                                                |
| `timestamp`        | *timestamp* | Timestamp (start of minute, hour, or day)                |
| `decimals`         | *int*       | Token decimals                                           |
| `volume`           | *double*    | Trading volume in USD (from price source)                |
| `source`           | *varchar*   | Data source ('coinpaprika' or 'dex.trades')              |

## Technical Notes

* **Token identification**: Requires both `contract_address` AND `blockchain` (symbols are not unique)
* **Native tokens**: Use standardized addresses from `dune.blockchains` table. We mostly set native tokens to `0x000...`
* **Pricing independence**: Calculated separately per blockchain
* **Volume-weighted**: Uses volume-weighted averages for accuracy

### Solana Token Addresses

Solana tokens use base58-encoded mint addresses, but in Dune's price tables they are stored as `varbinary` in the `contract_address` column. To query Solana token prices, convert the base58 mint address to varbinary using `from_base58()`:

```sql theme={null}
SELECT 
  symbol,
  price,
  timestamp
FROM prices.day
WHERE blockchain = 'solana'
AND contract_address = from_base58('So11111111111111111111111111111111111111112') -- Wrapped SOL
AND timestamp >= NOW() - INTERVAL '7' DAY
```

To discover available Solana tokens and their addresses:

```sql theme={null}
SELECT DISTINCT 
  symbol, 
  contract_address, 
  to_base58(contract_address) as mint_address
FROM prices.usd
WHERE blockchain = 'solana'
LIMIT 100
```

### Source-Specific Variants

For specialized analysis, each granularity offers source-specific tables:

**Coinpaprika-only tables:**

* `prices_external.day`, `prices_external.hour`, `prices_external.minute`, `prices_external.latest`

**DEX-derived tables:**

* `prices_dex.day`, `prices_dex.hour`, `prices_dex.minute`, `prices_dex.latest`

*See individual granularity pages for detailed documentation on these variants.*

**Performance tip:** Use the coarsest granularity that meets your needs. Minute-level queries over long periods are resource-intensive.

## Usage Examples

Here are some examples of how to use the prices tables.

### Basic query to get the latest ETH price:

```sql theme={null}
SELECT price
FROM prices.latest
WHERE blockchain = 'ethereum' 
AND contract_address = 0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2 -- WETH
```

### Getting historical price data:

```sql theme={null}
SELECT
  timestamp,
  price
FROM prices.day
WHERE blockchain = 'ethereum'
AND contract_address = 0x1f9840a85d5af5bf1d1762f925bdaddc4201f984 -- UNI
AND timestamp >= NOW() - INTERVAL '30' DAY
```

### Finding the right native token address:

```sql theme={null}
-- Query to get the native token address for a specific blockchain
SELECT 
  name,
  token_address,
  token_symbol
FROM dune.blockchains
WHERE name = 'arbitrum'
```

## Legacy Tables

The following tables are maintained for historical compatibility:

* `prices.usd` - **View of `prices_external.minute`** (maintains legacy schema)

Note: `prices.usd` is a view of `prices_external.minute` while preserving the legacy schema for backward compatibility.

## When to Use These Tables

* Calculate USD values for token transfers, balances, and DeFi positions
* Build portfolio valuation tools and wallet trackers
* Power price feeds for dashboards, alerts, and automated reports
* Analyze token price movements and correlations across chains
* Benchmark token performance against market indices

## Query Performance

**Partition keys for `prices.day`, `prices.hour`, `prices.minute`:** `blockchain`, `contract_address`

Always filter on `blockchain` and a time range. For specific tokens, also filter on `contract_address` or `symbol`.

```sql theme={null}
-- ✅ Good: chain + time + token filter
SELECT * FROM prices.hour
WHERE blockchain = 'ethereum'
  AND contract_address = 0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48 -- USDC
  AND minute >= NOW() - INTERVAL '7' DAY

-- ✅ Good: using prices.latest for current values
SELECT * FROM prices.latest
WHERE blockchain = 'ethereum'
  AND symbol = 'WETH'
```

## Related Tables

* `tokens.erc20` — Token metadata (symbols, decimals) for joining with price data
* `dex.trades` — DEX trading data (prices are partially derived from on-chain trades)
* `tokens.transfers` — Token transfers that can be valued using price tables

<CardGroup cols={2}>
  <Card title="Enterprise Data Solutions" icon="building" href="https://dune.com/enterprise">
    Need custom pricing feeds or dedicated support? Talk to our enterprise team.
  </Card>

  <Card title="Build Custom Models" icon="code" href="/api-reference/connectors/overview">
    Build private pricing pipelines with the dbt Connector.
  </Card>
</CardGroup>
