Data Encyclopedia
HomeCharts
  • Welcome & Product Overview
  • Getting Started
  • Tutorials and Examples
    • Tutorials
      • Python API Client Walkthrough
      • Getting Started With Market Data
      • Getting Started With Futures Data
      • Aggregating Options Data
      • Examining Orderbook Depth
      • Aggregating Orderbook Depth to Create Liquidity Metrics
      • Comparing Stablecoin Prices Using Different Pricing Methods
      • Comparing Volumes of Exchanges and Assets
      • Creating Custom Network Data Metrics Using ATLAS
      • Applying Different Types of Marketcap Metrics
      • Comparing the Dominance of Mining Pools Using ATLAS
      • Using Staking Metrics to Get Yield and Staked Supply
      • Granular Insights On Chain Using Hourly Network Data Metrics
      • Exploring Options, Open Interest, and Volatility Data
      • Calculating Total Value Locked in Liquidity Pools using DEX Data
      • Calculating DEX Liquidity Pool Fees and Volumes
      • Analyzing DeFi Protocol Balance Sheets
    • How To Guides
      • How To Export Data
      • How To Migrate From Catalog to Catalog V2 and Reference Data
      • How To Use the Coin Metrics API Efficiently
    • Dashboard Examples
  • Packages
    • CM Labs
    • Coin Metrics Community Data
  • Access Our Data
    • API Reference
    • API Conventions
      • Catalog V1 to Catalog V2 Migration
    • Python API Client
    • R API Client
    • Coverage
    • Status Page
  • Data Visualization
    • Charting Tool
      • Formula Builder
      • Correlation Tool
      • Embedded Charts
      • Troubleshooting
    • Dashboard
      • Troubleshooting
    • CMTV Charts (Labs)
      • Troubleshooting
    • Atlas Explorer
  • Network Data
    • Network Data Pro Overview
      • Availability
        • Asset Completion Time
      • Addresses
        • Active Addresses
        • Address Balances
        • New Addresses
      • Economics
        • Mining
        • Valuation
      • Exchange
        • Deposits
        • Exchange Supply
        • Net Flows
        • Transaction Count
        • Withdrawals
      • Fees and Revenue
        • Fees
        • Revenue
      • Market
        • Market Capitalization
        • Price
        • Profitability
        • Returns
        • Volatility
      • Key Risk Indicator (KRI) Feed
        • Blocks
        • Block Attributes
        • Block Size
        • Block Times
        • Empty Blocks
        • Fees
        • Outputs
        • Rewards
        • Feerates
        • Hashrate
        • Transaction Feerates
        • Transaction Fees
        • Transaction Sizes
        • Transactions
      • Mining
        • Balances
        • Difficulty
        • Exchange Flows
        • Flows
        • Hardware Hash Rate
        • Hash Rate
      • Network Usage
        • Blocks
        • Contracts
        • Profitability
        • UTXOs
        • Blobs
      • Staking
        • Consensus Health
        • Flows
        • Penalty Metrics
        • Slashing Metrics
        • Validator Supply
        • Stakers
        • Yield
      • Supply
        • Active Supply
        • Addresses with Balance
        • Burnt Supply
        • Current Supply
        • Free Float Supply
        • Future Expected Supply
        • Miner Revenue
        • Profitability
        • Revived Supply
        • Shielded Supply
        • Supply Issuance
        • Staking Supply
      • Transactions
        • Blobs
        • Contracts
        • Token Transactions
        • Transactions
        • Transfer Value
        • Transfers
        • Velocity
      • Wallets
        • Active Wallets
        • Wallet Balances
    • Atlas Overview
      • Accounts
      • Account Balance
      • Blocks
        • Full Block
      • Transactions
        • Full Transaction
          • Full Transaction Info for Block
      • Balance Updates
    • Methodologies
      • Normalizing Block Times
    • DeFi Overview
      • Decentralized Exchange Data
      • DeFi Balance Sheets
      • DeFi FAQs
    • Tagging Meta Data
    • Transaction Tracker
    • CM Labs
      • Mining Pool Monitor Overview
        • Mining Pool Monitor API Fields
      • Reorg & Fork Tracker Overview
        • Reorg & Fork Tracker Tracker API Fields
    • Deprecated
      • Mempool Monitor
      • WatchTower Alerts Overview - DEPRECATED
        • WatchTower Alerts - DEPRECATED
          • Ethereum Proof-of-Stake Alerts - DEPRECATED
            • Missed Slot Alert - DEPRECATED
            • Fast Increase in Transaction Count Alert - DEPRECATED
            • Fast Decrease in Transaction Count Alert - DEPRECATED
            • Fast Decrease in Base Fees - DEPRECATED
            • Fast Increase in Base Fees - DEPRECATED
            • Fast Decrease in Priority Fees (Tips) Alert - DEPRECATED
            • Fast Increase in Priority Fees (Tips) Alert - DEPRECATED
            • Decrease in Active Addresses Alert - DEPRECATED
            • Increase in Active Addresses Alert - DEPRECATED
            • Decrease in Total Block Fees Alert - DEPRECATED
            • Increase in Total Block Fees Alert - DEPRECATED
          • DeFi Alerts - DEPRECATED
            • Smart Contract Admin Change Alert - DEPRECATED
            • Admin Change with Issuance Event Alert - DEPRECATED
            • Admin Change with Large Issuance Event Alert - DEPRECATED
          • Mining Alerts - DEPRECATED
            • Unknown Miner Predominance Alert - DEPRECATED
            • Mining Pool Conflict Alert - DEPRECATED
            • Persistent Mining Pool Conflict Alert - DEPRECATED
            • Hashrate Decrease Alert - DEPRECATED
            • 1-Block Difficulty Decrease - DEPRECATED
          • Blockchain Alerts - DEPRECATED
            • 1 Block Reorg Alert - DEPRECATED
            • 2 Block Reorg Alert - DEPRECATED
            • 3 Block Reorg Alert - DEPRECATED
            • Satoshi Coins Spent - DEPRECATED
            • Vintage Coins Spent - DEPRECATED
            • Slow Block Alert - DEPRECATED
            • 1 Consecutive Empty Block Alert - DEPRECATED
            • 2 Consecutive Empty Blocks Alert - DEPRECATED
            • 3 Consecutive Empty Blocks Alert - DEPRECATED
            • 6 Consecutive Empty Blocks Alert - DEPRECATED
          • Mempool Alerts - DEPRECATED
            • Mempool Disruption Alert - DEPRECATED
            • Mempool Size 90% Alert - DEPRECATED
            • Mempool Size 95% Alert - DEPRECATED
            • Mempool Size 99% Alert - DEPRECATED
            • Mempool Size 100% Alert - DEPRECATED
            • Mempool Congestion Alert - DEPRECATED
        • WatchTower API Fields - DEPRECATED
    • Network Data Glossary
    • Network Data FAQs
  • Market Data
    • Market Data Overview
      • Basis
      • Candles
      • Contract Prices
      • Funding Rates
        • Funding Rates
        • Predicted Funding Rates
        • Aggregated Futures Funding Rate
        • Cumulative Futures Funding Rate
      • Greeks
      • Institution Metrics
        • Grayscale
          • Shares Outstanding
          • Market Price
          • Net Asset Value
          • Coin Per Share
          • Total Assets
      • Liquidations
        • Market Level Liquidations
        • Liquidation Metrics
      • Liquidity
        • Bid-Ask Spread Percent
        • Order Book Depth
        • Slippage
      • Market Metadata
      • Open Interest
        • Market Level Open Interest
        • Reported Open Interest
      • Orderbooks
      • Quotes
      • Trades
      • Volatility
        • Market Implied Volatility
        • Implied Volatility
        • Realized Volatility
      • Volume
        • Trusted Volume
        • Reported Volume
    • CM Prices
      • Reference Rate
      • Principal Market Price (USD)
      • Principal Market (USD)
    • Methodologies
      • Coin Metrics Prices Policies
      • Coin Metrics Prices Methodology
      • Trusted Exchange Framework
    • Market Data FAQs
      • CM Prices FAQs
      • Trusted Exchange Framework FAQs
  • Index Data
    • Index Overview
      • Index Timeseries
        • Index Levels
        • Index Candles
        • Index Constituents
    • Policies & Charters
      • CMBI Index Policies
      • Governance Committees
    • Methodologies
      • Fork Legitimacy Framework
      • Adjusted Free Float Supply Methodology
      • Candidate Market Guidelines
    • Fact Sheets
      • CMBI Single Asset Series Fact Sheet
      • CMBI Multi Asset Series Fact Sheet
      • CMBI Total Market Series Fact Sheet
      • CMBI Mining Series Fact Sheet
    • Indexes Glossary
    • Index FAQs
  • Reference Data
    • datonomy Overview
      • Taxonomy for Assets
      • Taxonomy Metadata for Assets
      • datonomy FAQs
    • Profiles Overview
      • Asset Profiles
      • Network Profiles
    • Security Master Overview
      • Assets
      • Markets
    • Methodologies
      • Guiding Principles and Methodology for datonomy
  • BITTENSOR
    • Precog Methodology
      • Point Forecast Ranking
      • Interval Forecast Ranking
      • Interval Score Examples
      • Miner Weight from Rank
Powered by GitBook
On this page
  • Examples
  • How do I get the assets/markets/exchanges covered?
  • How do I get which assets have been on an exchange?
  • How do I get which markets are on an exchange?
  • How do I get the markets for which an asset is a base/quote?
  • How do I get which metrics are covered for a given asset/pair/exchange/market/exchange-asset/institution?
  • How do I get which assets/pairs/exchanges/markets are covered for a given metric?
  • How do I get which raw observation data are covered for a given market?
  • How do I get min and max time for a market?
  • How do I get which the min and max times an asset has been traded in an exchange?
  • How do I get what metrics are available for a given product and frequency?
  • A Mapping of Catalog Endpoints to Catalog V2 and Reference Data Endpoints

Was this helpful?

  1. Tutorials and Examples
  2. How To Guides

How To Migrate From Catalog to Catalog V2 and Reference Data

This guide will help you migrate from using catalog ("Catalog V1") to catalog-v2 ("Catalog V2") and reference-data ("Reference Data"). Catalog V1 contains both static metadata (name, category, product, etc.) and coverage for a given data type (e.g. min_time and max_time for trades). Due to growing complexity in data coverage and the resulting performance bottlenecks from surfacing all of this data, this metadata is being separated. Catalog V2 and Reference Data allow for more lightweight and flexible queries as they can be queried across several dimensions (for example, catalog-v2/asset-metrics lets you filter by both asset and metric).

Switching between Catalog to Catalog V2 requires a subtle change in how to think about and find the data you're looking for.

In general:

  • Use catalog-v2 to get information on when a data type is present.

  • Use reference-data to get information on which entities are available and descriptions of what they are.

  • catalog-v2 and reference-data take less time to retrieve data per call and go through pagination (which the Python API Client automatically takes care of).

For more information on the reasoning behind the catalog migration, see Catalog V1 to Catalog V2 Migration

Examples

How do I get the assets/markets/exchanges covered?

V1:

  • Use catalog/assets, catalog/markets, or catalog/exchanges respectively

V2:

  • Use reference-data/assets, reference-data/markets, or reference-data/exchanges respectively

assets = client.reference_data_assets().to_list()
markets = client.reference_data_markets().to_list()
exchanges = client.reference_data_exchanges().to_list()
assets = client.catalog_assets()
markets = client.catalog_markets()
exchanges = client.catalog_exchanges()

How do I get which assets have been on an exchange?

V1: Use catalog/assets and get the "exchanges" field. Note that due to the size of the response, this might take a while.

V2: Use reference-data/markets?asset=<ASSET> and get the "exchange" field for each observation, loop through each observation. (Note that due to pagination, you will have to loop through the entire response).

list_markets = client.reference_data_markets(asset="btc").to_list()
list_exchanges = set([market['exchange'] for market in list_markets])
list_exchanges = client.catalog_assets(assets="btc")[0]['exchanges']

Note that these responses includes exchanges or markets that are now defunct. To get a more precise real-time coverage, see How do I get which the min and max times an asset has been traded in an exchange?

How do I get which markets are on an exchange?

V1: Use catalog/exchanges and get "markets" field

V2: Use reference-data/markets?exchange=<EXCHANGE> and get the "market" field for each observation, loop through each observation. (Note that due to pagination, you will have to loop through the entire response).

list_markets = client.reference_data_markets(exchange="coinbase").to_list()
list_markets = set([market['market'] for market in list_markets])
list_exchanges = client.catalog_exchanges(exchanges="coinbase")[0]['markets']

How do I get the markets for which an asset is a base/quote?

V1: For getting markets where the asset is only one of a base or quote, use catalog/markets?base=<ASSET> or catalog/markets?quote=<ASSET> respectively. For getting markets where the asset is either a base or quote, use catalog/markets?asset=<ASSET>.

V2: For getting markets where the asset is only one of a base or quote, use reference-data/markets?base=<ASSET> or reference-data/markets?quote=<ASSET> respectively. For getting markets where the asset is either a base or quote, use reference-data/markets?asset=<ASSET>.

list_markets = client.reference_data_markets(base="<ASSET>").to_list()
list_markets = client.catalog_markets(base='btc')

How do I get which metrics are covered for a given asset/pair/exchange/market/exchange-asset/institution?

V1: Usecatalog/*-metrics respectively and pass asset, pair, exchange, or market where applicable. Then, loop through each element to search for the presence of that asset, pair, exchange, or market.

V2: Usecatalog-v2/*-metrics respectively and pass asset, pair, exchange, or market where applicable.

Suppose you wanted to know which asset-metrics are available for btc:

list_asset_metrics = client.catalog_asset_metrics_v2(assets='btc').to_list()[0]['metrics']
list_asset_metrics = client.catalog_asset_metrics(assets='btc').to_list()
list_asset_metrics = [metric for metric in list_asset_metrics if 'btc' in metric['frequencies'][0]['assets']]

How do I get which assets/pairs/exchanges/markets are covered for a given metric?

V1: Use catalog/*-metrics and pass your metric(s). Each element will have a frequencies value with a nested assets value for each frequency. Find the appropriate frequency and grab that list of assets.

V2: Use catalog-v2/*-metrics and pass your metric(s). Loop through element and get the asset value.

Suppose you wanted to know what assets are covered by PriceUSD:

list_asset_metrics = client.catalog_asset_metrics_v2(metrics="PriceUSD").to_dataframe()
list_assets = list(df_asset_metrics.loc[((df_asset_metrics.metric=='PriceUSD') & (df_asset_metrics.frequency=='1d')), 'asset'])
list_asset_metrics = client.catalog_asset_metrics(metrics="PriceUSD").to_list()
list_assets = list_asset_metrics[0]['frequencies'][-1]['assets']

How do I get which raw observation data are covered for a given market?

V1 and V2: Use catalog/market-* and catalog-v2/market-* respectively and pass markets where applicable.

Below is an example of using market-trades:

list_markets = client.catalog_market_trades_v2(markets='<MARKET>').to_list()
list_markets = client.catalog_market_trades(markets='<MARKET>')

How do I get min and max time for a market?

V1 and V2: Use catalog/market-trades?asset=<ASSET>&exchange=<EXCHANGE> and catalog-v2/market-trades?asset=<ASSET>&exchange=<EXCHANGE> respectively and get the min and max times.

trades = next(client.catalog_market_trades_v2(markets='coinbase-btc-usd-spot'))
min_time = trades['min_time']
max_time = trades['max_time']
trades = client.catalog_market_trades(markets='coinbase-btc-usd-spot'))
min_time = trades[0]['min_time']
max_time = trades[0]['max_time']

How do I get which the min and max times an asset has been traded in an exchange?

V1 and V2: Use catalog/market-trades?asset=<ASSET>&exchange=<EXCHANGE> and catalog-v2/market-trades?asset=<ASSET>&exchange=<EXCHANGE> respectively and get the min and max times.

trades = client.catalog_market_trades_v2(exchange='coinbase', asset='btc').to_list()
min_time = min([market['min_time'] for market in trades])
max_time = max([market['max_time'] for market in trades])
trades = client.catalog_market_trades(exchange='coinbase', asset='btc')
min_time = trades[0]['min_time']
max_time = trades[0]['max_time']

How do I get what metrics are available for a given product and frequency?

Suppose we wanted to get metrics for the Network Data product that are available at 1 hour frequency.

V1:

  • Use catalog/asset-metrics, filter by frequency = '1h' and 'product' = 'Network Data'

V2:

  • query reference-data/asset-metrics, filter for 'product' = 'Network Data'

  • query catalog-v2/asset-metrics?metrics=<LIST_OF_NETWORK_DATA_METRICS>, filter for frequency = '1h'

asset_metrics_reference = client.reference_data_asset_metrics().to_dataframe()
list_metrics_nd = list(asset_metrics_reference.loc[asset_metrics_reference['product']=='Network Data', 'metric'])

asset_metrics_catalog = client.catalog_asset_metrics_v2(metrics=list_metrics_nd).to_dataframe()
list_hourly_metrics_nd = list(asset_metrics_catalog.loc[asset_metrics_catalog.frequency=='1h', 'metric'].unique())
df_catalog_asset_metrics = client.catalog_asset_metrics().to_dataframe()
list_hourly_metrics_nd = list(df_catalog_asset_metrics.loc[
    (df_catalog_asset_metrics['frequency']=='1h') & (df_catalog_asset_metrics['product']=='Network Data')
])

A Mapping of Catalog Endpoints to Catalog V2 and Reference Data Endpoints

Existing Catalog Endpoint
Catalog v2 Endpoints
Reference Data Endpoints*
Notes

/catalog/assets

/catalog-v2/asset-metrics

/reference-data/assets, /reference-data/markets

/catalog/metrics

/catalog-v2/asset-metrics, /catalog-v2/exchange-metrics, /catalog-v2/exchange-asset-metrics, /catalog-v2/pair-metrics, /catalog-v2/institution-metrics, /catalog-v2/market-metrics

/reference-data/asset-metrics, /reference-data/exchange-metrics, /reference-data/exchange-asset-metrics, /reference-data/pair-metrics, /reference-data/institution-metrics, /reference-data/market-metrics

/catalog/asset-metrics

/catalog-v2/asset-metrics

/reference-data/asset-metrics

/catalog/exchange-metrics

/catalog-v2/exchange-metrics

/reference-data/exchange-metrics

/catalog/exchange-asset-metrics

/catalog-v2/exchange-asset-metrics

/reference-data/exchange-asset-metrics

/catalog/pair-metrics

/catalog-v2/pair-metrics

/reference-data/pair-metrics

/catalog/institution-metrics

/catalog-v2/institution-metrics

/reference-data/institution-metrics

/catalog/exchanges

/reference-data/exchanges, /reference-data/markets

/catalog/exchange-assets

/catalog-v2/exchange-asset-metrics

/reference-data/exchange-asset-metrics

/catalog/pairs

/catalog-v2/pair-metrics

/reference-data/pair-metrics

/catalog/pair-candles

/catalog-v2/pair-candles

/catalog/institutions

/catalog-v2/institution-metrics

/reference-data/institution-metrics

/catalog/markets

/catalog-v2/market-trades, /catalog-v2/market-orderbooks, /catalog-v2/market-quotes, /catalog-v2/market-funding-rates, /catalog-v2/market-open-interest, /catalog-v2/market-liquidations

/reference-data/markets

The existing catalog endpoint will be restricted to 170,000 markets.

/catalog/market-trades

/catalog-v2/market-trades

The existing catalog endpoint will be restricted to 170,000 markets.

/catalog/market-candles

/catalog-v2/market-candles

The existing catalog endpoint will be restricted to 170,000 markets.

/catalog/market-orderbooks

/catalog-v2/market-orderbooks

The existing catalog endpoint will be restricted to 170,000 markets.

/catalog/market-quotes

/catalog-v2/market-quotes

The existing catalog endpoint will be restricted to 170,000 markets.

/catalog/market-funding-rates

/catalog-v2/market-funding-rates

The existing catalog endpoint will be restricted to 170,000 markets.

/catalog/market-contract-prices

/catalog-v2/market-contract-prices

The existing catalog endpoint will be restricted to 170,000 markets.

/catalog/market-implied-volatility

/catalog-v2/market-implied-volatility

The existing catalog endpoint will be restricted to 170,000 markets.

/catalog/market-greeks

/catalog-v2/market-greeks

The existing catalog endpoint will be restricted to 170,000 markets.

/catalog/market-openinterest

/catalog-v2/market-openinterest

The existing catalog endpoint will be restricted to 170,000 markets.

/catalog/market-liquidations

/catalog-v2/market-liquidations

The existing catalog endpoint will be restricted to 170,000 markets.

/catalog/market-metrics

/catalog-v2/market-metrics

/reference-data/market-metrics

The existing catalog endpoint will be restricted to 170,000 markets.

/catalog/indexes

/catalog-v2/index-levels, /catalog-v2/index-constituents

/reference-data/indexes

/catalog/index-candles

/catalog-v2/index-candles

/catalog/asset-alerts

/reference-data/asset-alerts

/catalog/asset-chains

/catalog-v2/asset-chains

/catalog/mempool-feerates

/catalog-v2/mempool-feerates

/catalog/minig-pool-tips-summary

/catalog-v2/mining-pool-tips-summary

/catalog/transaction-tracker

/catalog-v2/transaction-tracker

*Note that reference-data endpoints will show all data covered for a given entity, not just those visible in catalog-v2. This contrasts that of the behavior of catalog-v2 showing just the data available with your API key and catalog-v2-all showing all data.

PreviousHow To Export DataNextHow To Use the Coin Metrics API Efficiently

Last updated 6 months ago

Was this helpful?