---
title: "Coinbase Crypto Price Data"
description: "Coinbase Crypto Price Data dataset from QuantConnect."
canonical: https://www.quantconnect.com/docs/v2/writing-algorithms/datasets/quantconnect/coinbase-crypto-price-data
markdown: https://www.quantconnect.com/docs/v2/writing-algorithms/datasets/quantconnect/coinbase-crypto-price-data.md
language: python
source: https://github.com/QuantConnect/Documentation/tree/master/03%20Writing%20Algorithms/14%20Datasets/02%20QuantConnect/11%20Coinbase%20Crypto%20Price%20Data
modified: 2026-10-29
index: https://www.quantconnect.com/llms.txt
---

# Coinbase Crypto Price Data

[Documentation](https://www.quantconnect.com/docs/v2.md) > [Writing Algorithms](https://www.quantconnect.com/docs/v2/writing-algorithms.md) > Datasets > [QuantConnect](https://www.quantconnect.com/docs/v2/writing-algorithms/datasets/quantconnect.md) > Coinbase Crypto Price Data

> Code examples are shown in Python. Append `?lang=csharp` to this URL for the C# version of this page.

## Introduction

The Coinbase Crypto Price Data provides Cryptocurrency price and volume data points. The data covers 970 Cryptocurrency pairs, starts in January 2015, and is delivered on any frequency from tick to daily. This dataset is created by monitoring the trading activity on Coinbase.

For more information about the Coinbase Crypto Price Data dataset, including CLI commands and pricing, see the [dataset listing](https://www.quantconnect.com/datasets/coinbase-crypto-price-data).

## About the Provider

Coinbase was founded by Brian Armstrong and Fred Ehrsam in 2012 with the goal to "increase economic freedom in the world". Coinbase provides access to trading Crypto for clients in over [100 countries](https://www.coinbase.com/places) with no minimum deposit. Coinbase also provides a self-hosted Crypto wallet, a Visa debit rewards card, and Bitcoin collateral-backed lines of credit.

## Getting Started

The following snippet demonstrates how to request data from the Coinbase Crypto Price dataset:

```python
# Coinbase only accepts Cash account type
self.set_brokerage_model(BrokerageName.COINBASE, AccountType.CASH)

self.btcusd = self.add_crypto("BTCUSD", Resolution.MINUTE, Market.COINBASE).symbol

self._universe = self.add_universe(CryptoUniverse.coinbase(self.universe_selection_filter))
```

## Data Summary

The following table describes the dataset properties:

| Property | Value |
| --- | --- |
| Start Date | January 2015 |
| Asset Coverage | 970 Currency Pairs |
| Data Density | Dense |
| Resolution | Tick, Second, Minute, Hourly, & Daily |
| Timezone | UTC |
| Market Hours | [Always Open](https://www.quantconnect.com/docs/v2/writing-algorithms/securities/market-hours.md) |

## Requesting Data

To add Coinbase Crypto Price data to your algorithm, call the `add_crypto` method. Save a reference to the Crypto `Symbol` so you can access the data later in your algorithm.

```python
class CoinAPIDataAlgorithm(QCAlgorithm):

    def initialize(self) -> None:
        self.set_start_date(2020, 6, 1)
        self.set_end_date(2021, 6, 1)
        self.set_cash(100000)

        # Coinbase accepts Cash account type only, AccountType.MARGIN will result in an exception.
        self.set_brokerage_model(BrokerageName.COINBASE, AccountType.CASH)

        self.btcusd = self.add_crypto("BTCUSD", Resolution.MINUTE, Market.COINBASE).symbol
```

For more information about creating Crypto subscriptions, see [Requesting Data](https://www.quantconnect.com/docs/v2/writing-algorithms/securities/asset-classes/crypto/requesting-data.md).

## Accessing Data

To get the current Coinbase Crypto Price data, index the `bars`, `quote_bars`, or `ticks` properties of the current [`Slice`](https://www.quantconnect.com/docs/v2/writing-algorithms/key-concepts/time-modeling/timeslices.md) with the Crypto `Symbol`. `Slice` objects deliver unique events to your algorithm as they happen, but the `Slice` may not contain data for your security at every time step. To avoid issues, check if the `Slice` contains the data you want before you index it.

```python
def on_data(self, slice: Slice) -> None:
    if self.btcusd in slice.bars:
        trade_bar = slice.bars[self.btcusd]
        self.log(f"{self.btcusd} close at {slice.time}: {trade_bar.close}")

    if self.btcusd in slice.quote_bars:
        quote_bar = slice.quote_bars[self.btcusd]
        self.log(f"{self.btcusd} bid at {slice.time}: {quote_bar.bid.close}")

    if self.btcusd in slice.ticks:
        ticks = slice.ticks[self.btcusd]
        for tick in ticks:
            self.log(f"{self.btcusd} price at {slice.time}: {tick.price}")
```

You can also iterate through all of the data objects in the current `Slice`.

```python
def on_data(self, slice: Slice) -> None:
    for symbol, trade_bar in slice.bars.items():
        self.log(f"{symbol} close at {slice.time}: {trade_bar.close}")

    for symbol, quote_bar in slice.quote_bars.items():
        self.log(f"{symbol} bid at {slice.time}: {quote_bar.bid.close}")

    for symbol, ticks in slice.ticks.items():
        for tick in ticks:
            self.log(f"{symbol} price at {slice.time}: {tick.price}")
```

For more information about accessing Crypto data, see [Handling Data](https://www.quantconnect.com/docs/v2/writing-algorithms/securities/asset-classes/crypto/handling-data.md).

## Historical Data

To get historical Coinbase Crypto Price data, call the `history` method with the Crypto `Symbol`. If there is no data in the period you request, the history result is empty.

```python
# DataFrame
history_df = self.history(self.btcusd, 100, Resolution.DAILY)

# TradeBar objects
history_trade_bars = self.history[TradeBar](self.btcusd, 100, Resolution.MINUTE)

# QuoteBar objects
history_quote_bars = self.history[QuoteBar](self.btcusd, 100, Resolution.MINUTE)

# Tick objects
history_ticks = self.history[Tick](self.btcusd, timedelta(seconds=10), Resolution.TICK)
```

For more information about historical data, see [History Requests](https://www.quantconnect.com/docs/v2/writing-algorithms/historical-data/history-requests.md).

## Universe Selection

To select a dynamic universe of Coinbase Crypto pairs, call the `add_universe` method with a `CryptoUniverse` object. A [Crypto universe](https://www.quantconnect.com/docs/v2/writing-algorithms/universes/crypto.md) uses a selection function to select Crypto pairs based on their OHLCV and dollar volume of the previous day as of midnight Coordinated Universal Time (UTC).

```python
def initialize(self) -> None:
    self.universe_settings.asynchronous = True
    self.set_brokerage_model(BrokerageName.COINBASE, AccountType.CASH)
    self._universe = self.add_universe(CryptoUniverse.coinbase(self.universe_selection_filter))

def universe_selection_filter(self, universe_day):
    return [c.symbol for c in universe_day if c.volume >= 100 and c.volume_in_usd > 10000]
```

For more information about universe settings, see [Settings](https://www.quantconnect.com/docs/v2/writing-algorithms/universes/settings.md).

## Universe History

You can get historical universe data in an algorithm and in the Research Environment.

### Historical Universe Data in Algorithms

To get historical universe data in an algorithm, call the `history` method with the `Universe` object, and the lookback period. If there is no data in the period you request, the history result is empty.

```python
# DataFrame example where the columns are the CryptoUniverse attributes:
history_df = self.history(self._universe, 30, Resolution.DAILY, flatten=True)

# Series example where the values are lists of CryptoUniverse objects:
history = self.history(self._universe, 30, Resolution.DAILY)
for (univere_symbol, time), universe_day in history.items():
    for universe_item in universe_day:
        self.log(f"{universe_item.symbol} price at {universe_item.end_time}: {universe_item.close}")
```

### Historical Universe Data in Research

To get historical universe data in research, call the `universe_history` method with the `Universe` object, and the lookback period. The `universe_history` returns the filtered universe. If there is no data in the period you request, the history result is empty.

```python
# DataFrame example where the columns are the CryptoUniverse attributes:
history_df = qb.universe_history(universe, qb.time-timedelta(30), qb.time, flatten=True)

# Series example where the values are lists of CryptoUniverse objects:
universe_history = qb.universe_history(universe, qb.time-timedelta(30), qb.time)
for (univere_symbol, time), universe_day in universe_history.items():
    for universe_item in universe_day:
        print(f"{universe_item.symbol} price at {universe_item.end_time}: {universe_item.close}")
```

You can call the `history` method in Research.

## Remove Subscriptions

To unsubscribe from a Crypto pair that you added with the `add_crypto` method, call the `remove_security` method.

```python
self.remove_security(self.btcusd)
```

The `remove_security` method cancels your open orders for the security and liquidates your holdings in the [virtual pair](https://www.quantconnect.com/docs/v2/writing-algorithms/securities/asset-classes/crypto/holdings.md#03-Virtual-Pairs).

## Supported Assets

The following table shows the available Cryptocurrency pairs:

| Pairs Available (970) |  |  |  |  |  |
| --- | --- | --- | --- | --- | --- |
| 00USD | 00USDC | 1INCHBTC | 1INCHEUR | 1INCHGBP | 1INCHUSD |
| 1INCHUSDC | A8USD | A8USDC | AAVEBTC | AAVEEUR | AAVEGBP |
| AAVEUSD | AAVEUSDC | ABTUSD | ABTUSDC | ACHUSD | ACHUSDC |
| ACSUSD | ACSUSDC | ACXUSD | ACXUSDC | ADABTC | ADAETH |
| ADAEUR | ADAGBP | ADAUSD | ADAUSDC | ADAUSDT | AERGOUSD |
| AERGOUSDC | AEROUSD | AEROUSDC | AGLDUSD | AGLDUSDC | AGLDUSDT |
| AIOZUSD | AIOZUSDC | AKTUSD | AKTUSDC | ALCXEUR | ALCXUSD |
| ALCXUSDC | ALCXUSDT | ALEOUSD | ALEOUSDC | ALEPHUSD | ALEPHUSDC |
| ALGOBTC | ALGOEUR | ALGOGBP | ALGOUSD | ALGOUSDC | ALICEUSD |
| ALICEUSDC | ALTUSD | ALTUSDC | AMPUSD | AMPUSDC | ANKRBTC |
| ANKREUR | ANKRGBP | ANKRUSD | ANKRUSDC | ANTUSD | ANTUSDC |
| APEEUR | APEUSD | APEUSDC | APEUSDT | API3USD | API3USDC |
| API3USDT | APTUSD | APTUSDC | APTUSDT | ARBUSD | ARBUSDC |
| ARKMUSD | ARKMUSDC | ARPAEUR | ARPAUSD | ARPAUSDC | ARPAUSDT |
| ASMUSD | ASMUSDC | ASMUSDT | ASTUSD | ASTUSDC | ATAUSD |
| ATAUSDC | ATHUSD | ATHUSDC | ATOMBTC | ATOMEUR | ATOMGBP |
| ATOMUSD | ATOMUSDC | ATOMUSDT | AUCTIONEUR | AUCTIONUSD | AUCTIONUSDC |
| AUCTIONUSDT | AUDIOUSD | AUDIOUSDC | AURORAUSD | AURORAUSDC | AVAXBTC |
| AVAXEUR | AVAXUSD | AVAXUSDC | AVAXUSDT | AVTUSD | AVTUSDC |
| AXLUSD | AXLUSDC | AXSBTC | AXSEUR | AXSUSD | AXSUSDC |
| AXSUSDT | B3USD | B3USDC | BADGEREUR | BADGERUSD | BADGERUSDC |
| BADGERUSDT | BALBTC | BALUSD | BALUSDC | BANDBTC | BANDEUR |
| BANDGBP | BANDUSD | BANDUSDC | BATBTC | BATETH | BATEUR |
| BATUSD | BATUSDC | BCHBTC | BCHEUR | BCHGBP | BCHUSD |
| BCHUSDC | BERAUSD | BERAUSDC | BICOEUR | BICOUSD | BICOUSDC |
| BICOUSDT | BIGTIMEUSD | BIGTIMEUSDC | BITUSD | BITUSDC | BLASTUSD |
| BLASTUSDC | BLURUSD | BLURUSDC | BLZUSD | BLZUSDC | BNTBTC |
| BNTEUR | BNTGBP | BNTUSD | BNTUSDC | BOBAUSD | BOBAUSDC |
| BONDUSD | BONKUSD | BONKUSDC | BTCEUR | BTCGBP | BTCUSD |
| BTCUSDC | BTCUSDT | BTCUST | BTRSTBTC | BTRSTEUR | BTRSTGBP |
| BTRSTUSD | BTRSTUSDC | BTRSTUSDT | C98USD | C98USDC | CBETHETH |
| CBETHUSD | CBETHUSDC | CELRUSD | CELRUSDC | CGLDBTC | CGLDEUR |
| CGLDGBP | CGLDUSD | CGLDUSDC | CHZEUR | CHZGBP | CHZUSD |
| CHZUSDC | CHZUSDT | CLANKERUSD | CLANKERUSDC | CLVEUR | CLVGBP |
| CLVUSD | CLVUSDC | CLVUSDT | COMPBTC | COMPUSD | COMPUSDC |
| COOKIEUSD | COOKIEUSDC | CORECHAINUSD | CORECHAINUSDC | COTIUSD | COTIUSDC |
| COVALUSD | COVALUSDC | COVALUSDT | COWUSD | COWUSDC | CROEUR |
| CROUSD | CROUSDC | CROUSDT | CRVBTC | CRVEUR | CRVGBP |
| CRVUSD | CRVUSDC | CTSIBTC | CTSIUSD | CTSIUSDC | CTXEUR |
| CTXUSD | CTXUSDC | CTXUSDT | CVCUSD | CVCUSDC | CVXUSD |
| CVXUSDC | DAIUSD | DAIUSDC | DARUSD | DARUSDC | DASHBTC |
| DASHUSD | DASHUSDC | DDXEUR | DDXUSD | DDXUSDT | DEGENUSD |
| DEGENUSDC | DESOEUR | DESOUSD | DESOUSDC | DESOUSDT | DEXTUSD |
| DEXTUSDC | DIAEUR | DIAUSD | DIAUSDC | DIAUSDT | DIMOUSD |
| DIMOUSDC | DNTUSD | DNTUSDC | DOGEBTC | DOGEEUR | DOGEGBP |
| DOGEUSD | DOGEUSDC | DOGEUSDT | DOGINMEUSD | DOGINMEUSDC | DOTBTC |
| DOTEUR | DOTGBP | DOTUSD | DOTUSDC | DOTUSDT | DREPUSD |
| DREPUSDC | DRIFTUSD | DRIFTUSDC | DYPUSD | DYPUSDC | EDGEUSD |
| EDGEUSDC | EGLDUSD | EGLDUSDC | EIGENUSD | EIGENUSDC | ELAUSD |
| ELAUSDC | ENJBTC | ENJUSD | ENJUSDC | ENJUSDT | ENSEUR |
| ENSUSD | ENSUSDC | ENSUSDT | EOSBTC | EOSEUR | EOSUSD |
| EOSUSDC | ERNUSD | ERNUSDC | ETCBTC | ETCEUR | ETCGBP |
| ETCUSD | ETCUSDC | ETHBTC | ETHDAI | ETHEUR | ETHFIUSD |
| ETHFIUSDC | ETHGBP | ETHUSD | ETHUSDC | ETHUSDT | EURCEUR |
| EURCUSD | EURCUSDC | EUROCEUR | EUROCUSD | EUROCUSDC | FAIUSD |
| FAIUSDC | FARMUSD | FARMUSDC | FARMUSDT | FETUSD | FETUSDC |
| FETUSDT | FIDAEUR | FIDAUSD | FIDAUSDC | FIDAUSDT | FILBTC |
| FILEUR | FILGBP | FILUSD | FILUSDC | FISUSD | FISUSDC |
| FLOKIUSD | FLOKIUSDC | FLOWUSD | FLOWUSDC | FLOWUSDT | FLRUSD |
| FLRUSDC | FORTHBTC | FORTHEUR | FORTHGBP | FORTHUSD | FORTHUSDC |
| FORTUSD | FORTUSDC | FOXUSD | FOXUSDC | FOXUSDT | FXUSD |
| FXUSDC | GALAEUR | GALAUSD | GALAUSDC | GALAUSDT | GALUSD |
| GALUSDC | GFIUSD | GFIUSDC | GHSTUSD | GHSTUSDC | GIGAUSD |
| GIGAUSDC | GLMUSD | GLMUSDC | GMTUSD | GMTUSDC | GMTUSDT |
| GNOUSD | GNOUSDC | GNTUSDC | GODSUSD | GODSUSDC | GRTBTC |
| GRTEUR | GRTGBP | GRTUSD | GRTUSDC | GSTUSD | GSTUSDC |
| GTCUSD | GTCUSDC | GUSD | GUSDC | GUSDUSD | GUSDUSDC |
| GYENUSD | GYENUSDC | HBARUSD | HBARUSDC | HBARUSDT | HFTUSD |
| HFTUSDC | HIGHUSD | HIGHUSDC | HNTUSD | HNTUSDC | HONEYUSD |
| HONEYUSDC | HOPRUSD | HOPRUSDC | ICPBTC | ICPEUR | ICPGBP |
| ICPUSD | ICPUSDC | ICPUSDT | IDEXUSD | IDEXUSDC | IDEXUSDT |
| ILVUSD | ILVUSDC | IMXUSD | IMXUSDC | IMXUSDT | INDEXUSD |
| INDEXUSDC | INJUSD | INJUSDC | INVUSD | INVUSDC | IOTXEUR |
| IOTXUSD | IOTXUSDC | IOUSD | IOUSDC | IPUSD | IPUSDC |
| JASMYUSD | JASMYUSDC | JASMYUSDT | JTOUSD | JTOUSDC | KAITOUSD |
| KAITOUSDC | KARRATUSD | KARRATUSDC | KAVAUSD | KAVAUSDC | KEEPUSD |
| KERNELUSD | KERNELUSDC | KEYCATUSD | KEYCATUSDC | KNCBTC | KNCUSD |
| KNCUSDC | KRLEUR | KRLUSD | KRLUSDC | KRLUSDT | KSMUSD |
| KSMUSDC | L3USD | L3USDC | LCXEUR | LCXUSD | LCXUSDC |
| LCXUSDT | LDOUSD | LDOUSDC | LINKBTC | LINKETH | LINKEUR |
| LINKGBP | LINKUSD | LINKUSDC | LINKUSDT | LITUSD | LITUSDC |
| LOKAUSD | LOKAUSDC | LOOMUSD | LOOMUSDC | LPTUSD | LPTUSDC |
| LQTYEUR | LQTYUSD | LQTYUSDC | LQTYUSDT | LRCBTC | LRCUSD |
| LRCUSDC | LRCUSDT | LRDSUSD | LRDSUSDC | LSETHETH | LSETHUSD |
| LSETHUSDC | LTCBTC | LTCEUR | LTCGBP | LTCUSD | LTCUSDC |
| MAGICUSD | MAGICUSDC | MANABTC | MANAETH | MANAEUR | MANAUSD |
| MANAUSDC | MANTLEUSD | MANTLEUSDC | MASKEUR | MASKGBP | MASKUSD |
| MASKUSDC | MASKUSDT | MATHUSD | MATHUSDC | MATICBTC | MATICEUR |
| MATICGBP | MATICUSD | MATICUSDC | MATICUSDT | MCO2USD | MCO2USDT |
| MDTUSD | MDTUSDC | MDTUSDT | MEDIAUSD | MEDIAUSDC | METISUSD |
| METISUSDC | MEUSD | MEUSDC | MINAEUR | MINAUSD | MINAUSDC |
| MINAUSDT | MIRBTC | MIREUR | MIRGBP | MIRUSD | MKRBTC |
| MKRUSD | MKRUSDC | MLNUSD | MLNUSDC | MNDEUSD | MNDEUSDC |
| MOBILEUSD | MOBILEUSDC | MOGUSD | MOGUSDC | MONAUSD | MONAUSDC |
| MOODENGUSD | MOODENGUSDC | MORPHOUSD | MORPHOUSDC | MOVEUSD | MOVEUSDC |
| MPLUSD | MPLUSDC | MSOLUSD | MSOLUSDC | MTLUSD | MTLUSDC |
| MUSDUSD | MUSEUSD | MUSEUSDC | NCTEUR | NCTUSD | NCTUSDC |
| NCTUSDT | NEARUSD | NEARUSDC | NEARUSDT | NEONUSD | NEONUSDC |
| NKNBTC | NKNEUR | NKNGBP | NKNUSD | NKNUSDC | NMRBTC |
| NMREUR | NMRGBP | NMRUSD | NMRUSDC | NUBTC | NUEUR |
| NUGBP | NUUSD | OCEANUSD | OCEANUSDC | OGNBTC | OGNUSD |
| OGNUSDC | OMGBTC | OMGEUR | OMGGBP | OMGUSD | OMNIUSD |
| OMNIUSDC | ONDOUSD | ONDOUSDC | OPUSD | OPUSDC | OPUSDT |
| ORCAUSD | ORCAUSDC | ORNBTC | ORNUSD | ORNUSDC | ORNUSDT |
| OSMOUSD | OSMOUSDC | OXTUSD | OXTUSDC | PAXGUSD | PAXGUSDC |
| PAXUSD | PAXUSDC | PAXUSDT | PENDLEUSD | PENDLEUSDC | PENGUUSD |
| PENGUUSDC | PEPEUSD | PEPEUSDC | PERPEUR | PERPUSD | PERPUSDC |
| PERPUSDT | PIRATEUSD | PIRATEUSDC | PLAUSD | PLAUSDC | PLUUSD |
| PLUUSDC | PNGUSD | PNGUSDC | PNUTUSD | PNUTUSDC | POLSUSD |
| POLSUSDC | POLSUSDT | POLUSD | POLUSDC | POLYUSD | POLYUSDT |
| PONDUSD | PONDUSDC | POPCATUSD | POPCATUSDC | POWREUR | POWRUSD |
| POWRUSDC | POWRUSDT | PRCLUSD | PRCLUSDC | PRIMEUSD | PRIMEUSDC |
| PROMPTUSD | PROMPTUSDC | PROUSD | PROUSDC | PRQUSD | PRQUSDC |
| PUNDIXUSD | PUNDIXUSDC | PYRUSD | PYRUSDC | PYTHUSD | PYTHUSDC |
| PYUSDUSD | PYUSDUSDC | QIUSD | QIUSDC | QNTUSD | QNTUSDC |
| QNTUSDT | QSPUSD | QSPUSDT | QUICKUSD | RADBTC | RADEUR |
| RADGBP | RADUSD | RADUSDC | RADUSDT | RAIUSD | RAIUSDC |
| RAREUSD | RAREUSDC | RARIUSD | RARIUSDC | RBNUSD | RBNUSDC |
| REDUSD | REDUSDC | RENBTC | RENDERUSD | RENDERUSDC | RENUSD |
| RENUSDC | REPBTC | REPUSD | REQBTC | REQEUR | REQGBP |
| REQUSD | REQUSDC | REQUSDT | REZUSD | REZUSDC | RGTUSD |
| RLCBTC | RLCUSD | RLCUSDC | RLYEUR | RLYGBP | RLYUSD |
| RLYUSDT | RNDREUR | RNDRUSD | RNDRUSDC | RNDRUSDT | RONINUSD |
| RONINUSDC | ROSEUSD | ROSEUSDC | ROSEUSDT | RPLUSD | RPLUSDC |
| RSRUSD | RSRUSDC | SAFEUSD | SAFEUSDC | SANDUSD | SANDUSDC |
| SANDUSDT | SDUSD | SDUSDC | SEAMUSD | SEAMUSDC | SEIUSD |
| SEIUSDC | SHDWUSD | SHDWUSDC | SHIBEUR | SHIBGBP | SHIBUSD |
| SHIBUSDC | SHIBUSDT | SHPINGEUR | SHPINGUSD | SHPINGUSDC | SHPINGUSDT |
| SKLBTC | SKLEUR | SKLGBP | SKLUSD | SKLUSDC | SNTUSD |
| SNTUSDC | SNXBTC | SNXEUR | SNXGBP | SNXUSD | SNXUSDC |
| SOLBTC | SOLETH | SOLEUR | SOLGBP | SOLUSD | SOLUSDC |
| SOLUSDT | SPAUSD | SPAUSDC | SPELLUSD | SPELLUSDC | SPELLUSDT |
| STGUSD | STGUSDC | STORJBTC | STORJUSD | STORJUSDC | STRKUSD |
| STRKUSDC | STXUSD | STXUSDC | STXUSDT | SUIUSD | SUIUSDC |
| SUKUEUR | SUKUUSD | SUKUUSDC | SUKUUSDT | SUPERUSD | SUPERUSDC |
| SUPERUSDT | SUSHIBTC | SUSHIETH | SUSHIEUR | SUSHIGBP | SUSHIUSD |
| SUSHIUSDC | SWELLUSD | SWELLUSDC | SWFTCUSD | SWFTCUSDC | SXTUSD |
| SXTUSDC | SYLOUSD | SYLOUSDC | SYNUSD | SYNUSDC | SYRUPUSD |
| SYRUPUSDC | TAOUSD | TAOUSDC | TIAUSD | TIAUSDC | TIMEUSD |
| TIMEUSDC | TNSRUSD | TNSRUSDC | TOSHIUSD | TOSHIUSDC | TRACEUR |
| TRACUSD | TRACUSDC | TRACUSDT | TRBBTC | TRBUSD | TRBUSDC |
| TRIBEUSD | TRUBTC | TRUEUR | TRUMPUSD | TRUMPUSDC | TRUUSD |
| TRUUSDC | TRUUSDT | TURBOUSD | TURBOUSDC | TUSD | TUSDC |
| TVKUSD | TVKUSDC | UMABTC | UMAEUR | UMAGBP | UMAUSD |
| UMAUSDC | UNFIUSD | UNFIUSDC | UNIBTC | UNIEUR | UNIGBP |
| UNIUSD | UNIUSDC | UPIUSD | UPIUSDT | USDCEUR | USDCGBP |
| USDTEUR | USDTGBP | USDTUSD | USDTUSDC | USTEUR | USTUSD |
| USTUSDT | VARAUSD | VARAUSDC | VELOUSD | VELOUSDC | VETUSD |
| VETUSDC | VGXEUR | VGXUSD | VGXUSDT | VOXELUSD | VOXELUSDC |
| VTHOUSD | VTHOUSDC | VVVUSD | VVVUSDC | WAMPLUSD | WAMPLUSDC |
| WAXLUSD | WAXLUSDC | WBTCBTC | WBTCUSD | WBTCUSDC | WCFGBTC |
| WCFGEUR | WCFGGBP | WCFGUSD | WCFGUSDC | WCFGUSDT | WELLUSD |
| WELLUSDC | WIFUSD | WIFUSDC | WLDUSD | WLDUSDC | WLUNABTC |
| WLUNAEUR | WLUNAGBP | WLUNAUSD | WLUNAUSDT | XCNUSD | XCNUSDC |
| XLMBTC | XLMEUR | XLMUSD | XLMUSDC | XLMUSDT | XRPBTC |
| XRPEUR | XRPGBP | XRPUSD | XRPUSDC | XRPUSDT | XTZBTC |
| XTZEUR | XTZGBP | XTZUSD | XTZUSDC | XYOBTC | XYOEUR |
| XYOUSD | XYOUSDC | XYOUSDT | YFIBTC | YFIIUSD | YFIUSD |
| YFIUSDC | ZECBTC | ZECUSD | ZECUSDC | ZENBTC | ZENUSD |
| ZENUSDC | ZENUSDT | ZETACHAINUSD | ZETACHAINUSDC | ZETAUSD | ZETAUSDC |
| ZKUSD | ZKUSDC | ZORAUSD | ZORAUSDC | ZROUSD | ZROUSDC |
| ZRXBTC | ZRXEUR | ZRXUSD | ZRXUSDC |  |  |

## Example Applications

The Coinbase Crypto Price dataset enables you to accurately design strategies for Cryptocurrencies. Examples include the following strategies:

- Buy and hold
- Trading Cryptocurrency volatility and price action
- Allocating a small portion of your portfolio to Cryptocurrencies to hedge against inflation

### Classic Algorithm Example

The following example algorithm buys and holds Bitcoin through the Coinbase exchange:

```python
from AlgorithmImports import *

class CoinAPIDataAlgorithm(QCAlgorithm):

    def initialize(self) -> None:
        self.set_start_date(2024, 9, 1)
        self.set_end_date(2024, 12, 31)
        self.universe_settings.asynchronous = True
        self.set_cash(100_000)
        # Coinbase accepts Cash account type only. AccountType.MARGIN
        # results in an exception.
        self.set_brokerage_model(BrokerageName.COINBASE, AccountType.CASH)
        # Add BTCUSD data.
        self._btc = self.add_crypto("BTCUSD", Resolution.MINUTE, Market.COINBASE)
        # Historical data
        history = self.history(self._btc.symbol, 30, Resolution.DAILY)
        # Add a Crypto universe that selects Crypto pairs on Coinbase.
        universe = self.add_universe(CryptoUniverse.coinbase(self._select_assets))
        # Historical Universe data
        universe_history = self.history(universe, 30, Resolution.DAILY)
        for (universe_symbol, time), universe_day in universe_history.items():
            for universe_item in universe_day:
                symbol = universe_item.symbol
                price = universe_item.close

    def _select_assets(self, universe_day):
        # Filter for materially traded Crypto pairs with significant
        # size and dollar volume, assuming higher capital flow in for
        # higher return.
        return [universe_item.symbol for universe_item in universe_day
                if universe_item.volume >= 100
                and universe_item.volume_in_usd > 10_000_000]

    def on_data(self, slice: Slice) -> None:
        # Speculate-invest all available free cash on BTCUSD, repecting
        # the order quantity restrictions to avoid invalid orders.
        if self.portfolio.cash_book['BTC'].amount != 0:
            return
        # Define a buffer so that we can scale down the order size,
        # avoiding trading errors.
        buffer = max(
            CoinbaseFeeModel.TAKER_ADVANCED_1,
            self.settings.free_portfolio_value_percentage
        )
        quantity = (
            self.portfolio.cash_book['USD'].amount
            / self._btc.ask_price
            * (1-buffer)
        )
        # Check if the quantity exceeds the minimum order size. On
        # Coinbase, the minimum order size is measured in the base
        # currency (BTC in this case).
        if abs(quantity) < self._btc.symbol_properties.minimum_order_size:
            return
        self.market_order(self._btc, quantity)
```

### Framework Algorithm Example

The following example algorithm creates a dynamic universe of Crypto pairs on the Coinbase exchange and then forms a equal-weighted portfolio of all the pairs in the universe:

```python
from AlgorithmImports import *

class CoinAPIDataAlgorithm(QCAlgorithm):

    def initialize(self) -> None:
        self.set_start_date(2020, 6, 1)
        self.set_end_date(2021, 2, 1)
        self.set_cash(100000)
        self.settings.free_portfolio_value_percentage = 0.05
        # Warm up the security with the last known price to avoid conversion error
        self.settings.seed_initial_prices = True
        self.universe_settings.asynchronous = True
        self.universe_settings.resolution = Resolution.MINUTE
        # Add Crypto Universe Selection that select crypto pairs in Coinbase exchange
        self.add_universe(CryptoUniverse.coinbase(self._select_assets))
        # Get the pairs on Coinbase that have USD as the quote currency.
        self._market_pairs = [
            x.key.symbol
            for x in self.symbol_properties_database.get_symbol_properties_list(Market.COINBASE)
            if x.value.quote_currency == self.account_currency
        ]
        self.add_alpha(ConstantAlphaModel(InsightType.PRICE, InsightDirection.UP, timedelta(hours=4), 0.025, None))
        # Equally invest to evenly dissipate the capital concentration risk of inidividual crypto pair
        self.set_portfolio_construction(EqualWeightingPortfolioConstructionModel())

    def _select_assets(self, universe_day: List[CryptoUniverse]) -> List[Symbol]:
        # Select pairs where the quote currency is USD.
        pairs = [c for c in universe_day if c.symbol.value in self._market_pairs]
        # Filter for materially traded crypto pairs with significant dollar volume, assuming higher capital flow in for higher return.
        pairs = sorted(pairs, key=lambda c: c.volume_in_usd)[-3:]
        return [c.symbol for c in pairs]

    def on_securities_changed(self, changes: SecurityChanges) -> None:
        for security in changes.added_securities:
            # Historical data
            history = self.history(security.symbol, 30, Resolution.DAILY)
            self.debug(f"We got {len(history)} items from our history request")
```

### Research Example

The following example lists crypto-currency pairs with the greatest dollar volume in the Coinbase exchange:

```python
qb = QuantBook()

# Add Cryptocurrency pair
symbol = qb.add_crypto("BTCUSDT", market=Market.COINBASE).symbol

# Historical data
history = qb.history(symbol, 30, Resolution.DAILY)
for (symbol, time), row in history.iterrows():
    print(f'{time} {symbol} {row.close}')

# Add Crypto Universe Selection
def universe_selection_filter(universe_day):
    selected = sorted([x for x in universe_day
        if x.volume_in_usd and x.volume_in_usd > 10000],
        key=lambda x: x.volume_in_usd, reverse=True)[:5]
    return [x.symbol for x in selected]

universe = qb.add_universe(CryptoUniverse.coinbase(universe_selection_filter))

# Historical Universe data
history = qb.universe_history(universe, qb.time-timedelta(30), qb.time)
for (univere_symbol, time), universe_day in history.items():
    print(f'=== {time} ===')
    for universe_item in sorted(universe_day, key=lambda x: x.volume_in_usd, reverse=True):
        print(f"{universe_item.symbol}: {universe_item.volume_in_usd}")
```

## Data Point Attributes

The Coinbase Crypto Price dataset provides `TradeBar`, `QuoteBar`, `Tick`, and `CryptoUniverse` objects.

### TradeBar Attributes

`TradeBar` objects have the following attributes:

*Members of `QuantConnect.Data.Market.TradeBar` (JSON): https://www.quantconnect.com/services/inspector?type=T:QuantConnect.Data.Market.TradeBar&language=python*

### QuoteBar Attributes

`QuoteBar` objects have the following attributes:

*Members of `QuantConnect.Data.Market.QuoteBar` (JSON): https://www.quantconnect.com/services/inspector?type=T:QuantConnect.Data.Market.QuoteBar&language=python*

### Tick Attributes

`Tick` objects have the following attributes:

*Members of `QuantConnect.Data.Market.Tick` (JSON): https://www.quantconnect.com/services/inspector?type=T:QuantConnect.Data.Market.Tick&language=python*

### CryptoUniverse Attributes

`CryptoUniverse` objects have the following attributes:

*Members of `QuantConnect.DataSource.CryptoUniverse` (JSON): https://www.quantconnect.com/services/inspector?type=T:QuantConnect.DataSource.CryptoUniverse&language=python*
