prices.day
Overview
Theprices.day
table provides daily token prices using a hybrid approach that combines multiple data sources for maximum coverage:
- Coinpaprika prices for tokens where we have reliable external data (~2,000 major tokens, defined in dbt spellbook lists)
- DEX-derived prices for the long tail of tokens not covered by coinpaprika
Table 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’) |
timestamp | timestamp | Date timestamp (00:00 UTC of each day) |
price | double | Token price in USD (volume-weighted average) |
decimals | int | Token decimals |
volume | double | Trading volume in USD (from price source) |
source | varchar | Data source (‘coinpaprika’ or ‘dex.trades’) |
Implementation Details
The daily prices are built through these steps:- Source prioritization: Coinpaprika prices take precedence where available, DEX-derived prices fill gaps
- Token list management: Lists defining which tokens use coinpaprika vs DEX are managed in dbt spellbook
- Data aggregation: Group by day, calculating volume-weighted average price per day
- Forward filling: Fill missing days with the previous day’s price (forward filling)
- Expiration: Set a 30-day expiration for forward filling to avoid stale data
Alternative Tables
If you need prices from specific sources only:prices_coinpaprika.day
For purely coinpaprika-based daily prices:
- Coverage: Only tokens with Coinpaprika listings (~2,000 tokens)
- Source: External exchange-aggregated pricing
- Use case: When you need stable, externally-validated daily pricing
- Special note: Used by
tokens.transfers
for stable pricing - Schema: Same as
prices.day
butsource
is always ‘coinpaprika’
prices_dex.day
For purely DEX algorithm-based daily prices:
- Coverage: All tokens with sufficient DEX trading volume
- Source: On-chain DEX trading activity only (from
dex.trades
table) - Use case: When you need pricing that reflects actual on-chain liquidity and trading activity
- Methodology: Comprehensive outlier detection and quality filtering applied to DEX trades
- Key difference: Even tokens with coinpaprika coverage use DEX-derived prices for consistency
- Schema: Same as
prices.day
butsource
is always ‘dex.trades’
Usage
This table provides comprehensive daily price coverage by combining coinpaprika and DEX-derived sources. It’s ideal for:- Daily price trend analysis
- Portfolio valuations
- Day-over-day price comparisons
- General token price lookups
Latency and Update Frequency
Theprices.day
table is updated daily at 00:00 UTC, providing the closing price for the previous day. Data is typically available within 30 minutes of the daily close.
Usage Examples
Get ETH price history for the last month:
Calculate monthly average price for multiple tokens:
Get native token price using dune.blockchains:
Data Quality Notes
- Prices older than 30 days will not be forward-filled to avoid using stale data
- Native tokens (like ETH, BNB) are assigned fixed addresses for consistency
- For native tokens, use
dune.blockchains
table to get the standardized address for each blockchain - The same token may have different prices on different blockchains due to bridging inefficiencies
- Always use
contract_address
andblockchain
for precise token identification, never usesymbol
for joins or filters - Prices are calculated using volume-weighted averages for more accurate representation
- Quality Filtering: The system includes filtering mechanisms to reduce the impact of anomalous trades
- DEX-derived limitations: DEX-derived prices can contain errors due to low liquidity, market manipulation, or anomalous trades
- Fallback option: For critical applications, consider using
prices_coinpaprika.day
for more reliable pricing where available - Data validation: Always validate prices for critical applications, especially for lesser-known tokens