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

# Bybit 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) > Bybit Crypto Price Data

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

## Introduction

The Bybit Crypto Price Data is for Cryptocurrency price and volume data points. The data covers 956 Cryptocurrency pairs, starts in July 2017, and is delivered on any frequency from tick to daily. This dataset is created by monitoring the trading activity on Bybit.

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

## About the Provider

Bybit was co-founded by Ben Zhou in March 2018 with the goal to offer a professional platform where Crypto traders can find an ultra-fast matching engine, excellent customer service, and multilingual community support. Bybit provides access to trading Crypto and Crypto Futures for clients outside of [excluded jurisdictions](https://www.bybit.com/en/help-center/article/Service-Restricted-Countries) with low minimum deposits to set up an account. For more information about [Crypto](https://www.bybit.com/en/help-center/article/Bybit-Deposit-FAQ#b) and [fiat deposits](https://www.bybit.com/en/help-center/article/FAQ-Fiat-Deposit), see the Bybit documentation. Bybit also provides Crypto staking, initial DEX offerings, and community airdrops.

## Getting Started

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

```python
# Bybit accepts both Cash and Margin account types only.
self.set_brokerage_model(BrokerageName.BYBIT, AccountType.CASH)
#self.set_brokerage_model(BrokerageName.BYBIT, AccountType.MARGIN)

self.btcusdt = self.add_crypto("BTCUSDT", Resolution.MINUTE, Market.BYBIT).symbol

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

## Data Summary

The following table describes the dataset properties:

| Property | Value |
| --- | --- |
| Start Date | April 2022 |
| Asset Coverage | 956 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 Bybit 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)

        # Set Account Currency to Tether
        self.set_account_currency("USDT", 100000)

        # Bybit accepts both Cash and Margin account types.
        self.set_brokerage_model(BrokerageName.BYBIT, AccountType.MARGIN)

        self.btcusdt = self.add_crypto("BTCUSDT", Resolution.MINUTE, Market.BYBIT).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 Bybit 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.btcusdt in slice.bars:
        trade_bar = slice.bars[self.btcusdt]
        self.log(f"{self.btcusdt} close at {slice.time}: {trade_bar.close}")

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

    if self.btcusdt in slice.ticks:
        ticks = slice.ticks[self.btcusdt]
        for tick in ticks:
            self.log(f"{self.btcusdt} 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 Bybit 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.btcusdt, 100, Resolution.DAILY)

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

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

# Tick objects
history_ticks = self.history[Tick](self.btcusdt, 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 Bybit 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.set_brokerage_model(BrokerageName.BYBIT, AccountType.MARGIN)
    self.universe_settings.asynchronous = True
    self._universe = self.add_universe(CryptoUniverse.bybit(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.btcusdt)
```

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 (956) |  |  |  |  |  |
| --- | --- | --- | --- | --- | --- |
| 1INCHADA | 1INCHETH | 1INCHUSDE | 1INCHUSDT | 1SOLUSDT | 3PUSDT |
| 5IREUSDC | 5IREUSDT | A8USDT | AARKUSDT | AAVEACH | AAVEUSDC |
| AAVEUSDT | ACAUSDC | ACAUSDT | ACHUSDC | ACHUSDT | ACMUSDT |
| ACSACH | ACSMNT | ACSUSDC | ACSUSDT | ADA2LUSDT | ADA2SUSDT |
| ADABTC | ADAETH | ADAEUR | ADAMNT | ADAUSDC | ADAUSDT |
| AEGUSDT | AEROUSDT | AEVOUSDT | AFCUSDT | AFGUSDT | AGIUSDT |
| AGIXUSDT | AGLAUSDT | AGLDUSDT | AI16ZUSDT | AIOZUSDT | AIXBTUSDT |
| AKIUSDT | ALCHUSDT | ALGOBTC | ALGOUSDT | ALTUSDT | AMIUSDT |
| ANIMEUSDT | ANKRUSDT | APE2LUSDT | APE2SUSDT | APEUSDC | APEUSDT |
| APEXUSDC | APEXUSDT | APPUSDT | APRSUSDT | APTRUSDT | APTUSDC |
| APTUSDT | ARBUSDC | ARBUSDT | ARKMUSDT | ARTYUSDT | ARUSDT |
| ATHUSDT | ATOM2LUSDT | ATOM2SUSDT | ATOMUSDC | ATOMUSDT | AUDETH |
| AUDUSDT | AURORAUSDT | AURYUSDT | AVAILUSDT | AVAUSDT | AVAX2LUSDT |
| AVAX2SUSDT | AVAXEUR | AVAXUSDC | AVAXUSDT | AVLUSDT | AXLUSDT |
| AXSUSDT | AZYUSDT | B3TRUSDC | B3TRUSDT | B3USDT | BABY1USDT |
| BABYDOGEBTC | BABYDOGEETH | BABYDOGEUSDT | BANUSDT | BARUSDT | BATBTC |
| BATETH | BATUSDT | BBDETH | BBDUSDC | BBDUSDT | BBLUSDT |
| BBQUSDT | BBSOLSOL | BBSOLUSDC | BBSOLUSDT | BBUSDT | BCHUSDC |
| BCHUSDT | BCUTUSDT | BEAMUSDT | BELUSDT | BENUSDT | BERAUSDT |
| BICOUSDT | BLASTUSDT | BLOCKUSDT | BLURUSDT | BMTUSDT | BNBETH |
| BNBUSDC | BNBUSDT | BNTUSDT | BOBAUSDT | BOBUSDC | BOBUSDT |
| BOMEUSDC | BOMEUSDT | BONKUSDC | BONKUSDT | BONUSETH | BONUSEUR |
| BONUSUSDC | BONUSUSDT | BRAWLUSDT | BRETTUSDC | BRETTUSDT | BRLETH |
| BRUSDT | BRZUSDT | BTC2SUSDT | BTC3LUSDC | BTC3LUSDT | BTC3SUSDT |
| BTCBETH | BTCBRL | BTCBRZ | BTCCUSDT | BTCDAI | BTCETH |
| BTCEUR | BTCPLN | BTCTRY | BTCUSDC | BTCUSDE | BTCUSDQ |
| BTCUSDR | BTCUSDT | BTGUSDT | BTTBIT | BTTUSDT | BUBBLEUSDT |
| BUSDUSDT | C98USDT | CAKEUSDT | CANDYUSDT | CAPOUSDT | CAPSUSDT |
| CARVUSDT | CATBNBUSDT | CATIEUR | CATIUSDC | CATIUSDT | CATSUSDT |
| CATUSDT | CBKUSDT | CBXUSDT | CELOUSDT | CELUSDT | CGPTUSDT |
| CHILLGUYUSDT | CHRPUSDT | CHZBIT | CHZEUR | CHZUSDC | CHZUSDT |
| CITYUSDT | CLOUDUSDT | CMETHUSDT | CMPUSDT | COMPBIT | COMPUSDT |
| COMUSDT | COOKIEUSDT | COOKUSDT | COPBIT | COPETH | COPUSDT |
| COQUSDT | COREUSDC | COREUSDT | CORNUSDT | COTUSDT | COUSDT |
| CPOOLUSDT | CRDSUSDT | CRVBTC | CRVETH | CRVUSDT | CSPRUSDT |
| CTAUSDT | CTCETH | CTCUSDT | CTTUSDT | CULTUSDT | CUSDUSDT |
| CWARUSDT | CYBERUSDT | DAIADA | DAIBIT | DAIETH | DAIUSDC |
| DAIUSDT | DAPPUSDT | DBRUSDT | DCRBIT | DCRUSDT | DECHATUSDT |
| DEEPUSDT | DEFIUSDT | DEFYUSDT | DEGENUSDT | DEVTUSDT | DFIUSDT |
| DGBUSDT | DIAMUSDT | DICEUSDT | DLCUSDT | DMAILUSDT | DOGE2LUSDT |
| DOGE2SUSDT | DOGEETH | DOGEEUR | DOGEUSDC | DOGEUSDT | DOGSEUR |
| DOGSUSDC | DOGSUSDT | DOLOUSDT | DOMEUSDT | DOODUSDT | DOP1USDT |
| DOT3LUSDT | DOT3SUSDT | DOTBTC | DOTETH | DOTUSDC | DOTUSDT |
| DPXUSDT | DRIFTUSDT | DSRUNUSDT | DUELUSDT | DYDXUSDC | DYDXUSDT |
| DYMUSDT | DZDUSDT | DZOOUSDT | ECOXUSDT | EGLDUSDC | EGLDUSDT |
| EGOUSDT | EGP1USDT | EIGENUSDT | ELDAUSDT | ELIXUSDT | ELTUSDT |
| ELXUSDT | ENAEUR | ENAUSDT | ENJUSDT | ENSUSDT | EOS2LUSDT |
| EOS2SUSDT | EOS3LUSDT | EOS3SUSDT | EOSBTC | EOSETH | EOSMNT |
| EOSTUSD | EOSUSDC | EOSUSDT | EPTUSDT | ERTHAUSDT | ESEUSDT |
| ETC2LUSDT | ETC2SUSDT | ETCETH | ETCUSDT | ETH3LUSDT | ETH3SUSDT |
| ETHBRL | ETHBTC | ETHDAI | ETHEUR | ETHFIUSDT | ETHPLN |
| ETHTRY | ETHUSDC | ETHUSDE | ETHUSDT | ETHWUSDT | EUROCUSDT |
| EVERUSDT | EVERYUSDT | EXVGUSDT | FAMEUSDT | FARUSDT | FBUSDT |
| FCDUSDT | FETUSDC | FETUSDT | FHEUSDT | FIDAUSDT | FILUSDC |
| FILUSDT | FIREUSDT | FITFIUSDT | FLIPUSDT | FLOCKUSDT | FLOKIUSDC |
| FLOKIUSDT | FLOWBIT | FLOWUSDT | FLRUSDT | FLTUSDT | FLUIDUSDT |
| FMBUSDT | FMCUSDT | FONUSDT | FORTUSDT | FOXYUSDT | FTM2LUSDT |
| FTM2SUSDT | FTMEUR | FTMUSDC | FTMUSDT | FTTUSDC | FTTUSDT |
| FUELUSDT | FUSDT | FXSBIT | FXSUSDT | G3USDT | G7USDT |
| GALAUSDT | GALAXISUSDT | GALFTUSDT | GALUSDT | GAMEUSDT | GCAKEUSDT |
| GENEUSDT | GGMUSDT | GGUSDT | GLMRUSDT | GMBIT | GMRXUSDT |
| GMT2LUSDT | GMT2SUSDT | GMTUSDC | GMTUSDT | GMUSDC | GMUSDT |
| GMXBIT | GMXETH | GMXUSDT | GNSUSDT | GOATUSDT | GODSUSDT |
| GPSUSDT | GPTUSDT | GRAPEUSDT | GRASSUSDT | GRTBIT | GRTUSDT |
| GSTSUSDT | GSTUSDT | GSWIFTUSDT | GTAIUSDT | GUMMYUSDT | GUSDT |
| HAEDALUSDT | HATUSDT | HBARUSDT | HEROUSDT | HFTUSDC | HFTUSDT |
| HLGUSDT | HMSTRUSDC | HMSTRUSDT | HNTBIT | HNTUSDT | HONUSDT |
| HOOKUSDT | HOTUSDT | HPOS10IUSDT | HTETH | HTXUSDT | HVHUSDT |
| HYPERUSDT | ICPUSDC | ICPUSDT | ICXUSDT | IDUSDT | IMXUSDT |
| INITUSDT | INJUSDC | INJUSDT | INSPUSDT | INTERUSDT | INTXUSDT |
| IOUSDT | IPUSDT | IRLUSDT | IZIUSDT | JASMYUSDC | JASMYUSDT |
| JEFFUSDT | JSTUSDT | JTOUSDT | JUPUSDT | JUSDT | JUVUSDT |
| KAIAUSDT | KARATEUSDT | KASTAUSDT | KASUSDC | KASUSDT | KAVAUSDT |
| KCALUSDT | KCSUSDT | KDAUSDT | KILOUSDT | KLAYUSDT | KMABIT |
| KMAUSDT | KMNOUSDT | KMONUSDT | KOKUSDT | KONUSDT | KRLUSDT |
| KROUSDT | KSMUSDT | KUBUSDT | KUNCIUSDT | L3USDT | LADYSUSDT |
| LAIUSDT | LAVAUSDT | LAYERUSDT | LDOUSDC | LDOUSDT | LENDSUSDT |
| LEVERUSDT | LFTUSDT | LFWUSDT | LGXUSDT | LINGUSDT | LINK2LUSDT |
| LINK2SUSDT | LINKEUR | LINKUSDC | LINKUSDT | LISUSDT | LLUSDT |
| LMWRUSDT | LNK2SUSDT | LOOKSUSDT | LRCUSDT | LTC2LUSDT | LTC2SUSDT |
| LTCBTC | LTCEUR | LTCUSDC | LTCUSDT | LUCEUSDT | LUNAIUSDT |
| LUNAUSDT | LUNCUSDC | LUNCUSDT | MAGICUSDT | MAJORUSDT | MAKUSDT |
| MANABTC | MANAUSDC | MANAUSDT | MANTAUSDT | MASAUSDT | MASKUSDT |
| MATIC2LUSDT | MATIC2SUSDT | MATICBTC | MATICUSDC | MATICUSDT | MAVIAUSDT |
| MBOXUSDT | MBSUSDT | MBXUSDT | MCGUSDT | MCRTUSDT | MCTUSDT |
| MDAOUSDT | MEEETH | MEEUSDC | MEEUSDT | MELOSUSDT | MEMEFIUSDT |
| MEMEUSDT | MERLUSDT | METHETH | METHUSDT | MEUSDT | MEWUSDC |
| MEWUSDT | MFERUSDT | MIBRUSDT | MILKUSDT | MINABTC | MINAETH |
| MINAMNT | MINAUSDC | MINAUSDT | MINUUSDT | MIXUSDT | MKRUSDT |
| MLKUSDT | MMCUSDT | MNRYUSDT | MNTBTC | MNTETH | MNTUSDC |
| MNTUSDT | MNZUSDT | MOCAUSDT | MODEUSDT | MOGUSDT | MOJOUSDT |
| MONUSDT | MORPHOUSDT | MOVEUSDT | MOVEZUSDT | MOVRUSDT | MOZUSDT |
| MPLXUSDT | MSTARUSDT | MTCUSDT | MTKUSDT | MUSDUSDT | MVLUSDT |
| MVUSDT | MXMUSDT | MXUSDT | MYRIAUSDT | MYROUSDT | N3USDT |
| NAKAUSDT | NAVXUSDT | NEAREUR | NEARUSDC | NEARUSDT | NEIROCTOUSDT |
| NEIROUSDT | NEONUSDT | NESSUSDT | NETHETH | NETHUSDT | NEXOUSDT |
| NEXTUSDT | NFTUSDT | NGLUSDT | NIBIUSDT | NLKUSDT | NOTUSDC |
| NOTUSDT | NRNUSDT | NSUSDT | NUTSUSDT | NUUSDT | NYANUSDT |
| NYMUSDT | OASUSDT | OBOLUSDT | OBTUSDT | OBXUSDT | ODOSUSDT |
| OIKUSDT | OKGUSDT | OLUSDT | OMGUSDT | OMNICATUSDC | OMNICATUSDT |
| OMNIUSDC | OMNIUSDT | OMNUSDT | OMUSDT | ONDOEUR | ONDOUSDC |
| ONDOUSDT | ONEUSDT | OPUSDC | OPUSDT | ORDERUSDT | ORDIUSDT |
| ORTUSDT | PAALUSDT | PARAMUSDT | PARTIUSDT | PAWSUSDT | PAXGUSDT |
| PBUXUSDT | PELLUSDT | PENDLEUSDT | PENGUUSDT | PENUSDT | PEOPLEUSDT |
| PEPE2USDC | PEPE2USDT | PEPEEUR | PEPEUSDC | PEPEUSDT | PERPUSDT |
| PHPUSDT | PINEYEUSDT | PIPUSDT | PIRATEUSDT | PIXFIUSDT | PLANETUSDT |
| PLAYUSDT | PLTUSDT | PLUMEUSDT | PLYUSDT | PNUTUSDT | POKTUSDT |
| POLUSDT | PONKEUSDT | POPCATUSDT | PORT3USDT | PORTALUSDT | POSIUSDC |
| POSIUSDT | PPTUSDT | PRCLUSDT | PRIMALUSDT | PRIMEUSDT | PSGUSDT |
| PSPUSDT | PSTAKEUSDT | PTCUSDT | PTUUSDT | PUFFERUSDT | PUFFUSDT |
| PUMLXUSDT | PUMPUSDT | PURSEUSDT | PYTHUSDT | PYUSDUSDT | QMALLUSDT |
| QNTUSDT | QORPOUSDT | QTUMUSDT | RACAUSDT | RAINUSDT | RATSUSDT |
| RDNTUSDT | REALUSDT | REDUSDT | RENDERUSDT | RENUSDT | RLTMUSDT |
| RNDRUSDT | ROAMUSDT | RONDUSDT | ROOTUSDT | ROSEUSDT | ROUTEUSDT |
| RPKUSDT | RPLUSDT | RSS3USDT | RUBUSDT | RUBYUSDT | RUNBIT |
| RUNBTC | RUNEUSDT | RUNUSDT | RVNUSDT | SAFEUSDT | SAILUSDT |
| SAITAMAUSDT | SALDUSDT | SAND2LUSDT | SAND2SUSDT | SANDBTC | SANDUSDC |
| SANDUSDT | SAROSUSDT | SATSUSDT | SCAUSDT | SCRTUSDT | SCRUSDT |
| SCUSDT | SDAGLD | SDBIT | SDUSDT | SEIEUR | SEILORUSDT |
| SEIUSDC | SEIUSDT | SENDUSDT | SEORUSDT | SERAPHUSDT | SFUNDUSDT |
| SHARKUSDT | SHIBEUR | SHIBUSDC | SHIBUSDT | SHILLUSDT | SHRAPUSDT |
| SIDUSUSDT | SIGNUSDT | SISUSDT | SLGUSDC | SLGUSDT | SLPUSDT |
| SMILEUSDT | SNXUSDT | SOCIALUSDT | SOLBRL | SOLBTC | SOLETH |
| SOLEUR | SOLOUSDT | SOLUSDC | SOLUSDE | SOLUSDT | SOLVUSDT |
| SOLXRP | SONBIT | SONICUSDT | SONUSDT | SOSOUSDT | SOSUSDT |
| SPARTAUSDT | SPECUSDT | SPELLUSDT | SPXUSDT | SQDUSDT | SQRUSDT |
| SQTUSDT | SRMUSDT | SSVUSDT | STARUSDT | STATUSDT | STETHEUR |
| STETHUSDT | STGUSDT | STOPUSDT | STREAMUSDT | STRKUSDC | STRKUSDT |
| STRMUSDT | STXUSDT | SUIAUSDT | SUIUSDC | SUIUSDT | SUNDOGUSDT |
| SUNUSDT | SUPRAUSDT | SUSDT | SUSHIUSDT | SVLUSDT | SWEATUSDT |
| SWELLUSDC | SWELLUSDT | SXTUSDT | SYNRUSDT | TAIKOUSDT | TAIUSDT |
| TAMAUSDT | TAPUSDT | TAVAUSDT | TELUSDT | TENETUSDT | TFUELUSDT |
| THBEUR | THBUSDC | THBUSDT | THETAUSDT | THNUSDT | THRUSTUSDT |
| TIAUSDC | TIAUSDT | TIMEUSDT | TNSRUSDT | TOKENUSDT | TOMIUSDT |
| TOMSUSDT | TONEUR | TONUSDC | TONUSDT | TOSHIUSDT | TRCUSDT |
| TRIBEUSDT | TRUMPUSDC | TRUMPUSDT | TRVLUSDT | TRXUSDC | TRXUSDT |
| TSTUSDT | TURBOSUSDT | TUSDT | TUSDUSDT | TVKUSDT | TWTUSDT |
| ULTIUSDT | UMAUSDT | UNIUSDC | UNIUSDT | USDCBRL | USDCEUR |
| USDCUSDT | USDCZEC | USDDUSDT | USDEEUR | USDEUSDC | USDEUSDT |
| USDQUSDT | USDRUSDT | USDTAUD | USDTBRL | USDTBRZ | USDTBUSDT |
| USDTETH | USDTEUR | USDTPLN | USDTTRY | USDTUSDE | USDTZEC |
| USDUSDT | USDYUSDT | USTCUSDT | UXLINKUSDT | UYUUSDT | VANAUSDT |
| VANRYUSDT | VEGAUSDT | VELARUSDT | VELAUSDT | VELOUSDT | VENOMUSDT |
| VETUSDT | VEXTUSDT | VICUSDT | VINUUSDT | VIRTUALUSDT | VPADUSDT |
| VPRUSDT | VRAUSDT | VRTXUSDT | VTHOUSDT | VVUSDT | VVVUSDT |
| WALUSDT | WAVESUSDT | WAXPUSDT | WBTCBTC | WBTCUSDT | WCTUSDT |
| WEETHETH | WELLUSDT | WEMIXUSDT | WENUSDT | WIFEUR | WIFUSDC |
| WIFUSDT | WLDEUR | WLDUSDC | WLDUSDT | WLKNUSDT | WOOUSDT |
| WUSDT | WWYUSDT | XAIUSDT | XARUSDT | XAUTUSDT | XAVAUSDT |
| XCADUSDT | XDCUSDT | XECETH | XECUSDC | XECUSDT | XEMUSDT |
| XETAUSDT | XIONUSDT | XLMBTC | XLMUSDC | XLMUSDT | XRP3LETH |
| XRP3LUSDT | XRP3SUSDT | XRPBTC | XRPETH | XRPEUR | XRPUSDC |
| XRPUSDT | XTERUSDT | XTZUSDT | XUSDT | XWGUSDT | XYMUSDT |
| XZKUSDT | YFIBIT | YFIUSDT | ZAMUSDT | ZAPUSDT | ZARUSDT |
| ZBCBIT | ZBCUSDT | ZECBTC | ZECETH | ZECTFUEL | ZECUSDT |
| ZENBTC | ZENDUSDT | ZENETH | ZENTUSDT | ZENUSDC | ZENUSDT |
| ZEREBROUSDT | ZEROUSDT | ZETAUSDT | ZEXUSDT | ZIGUSDT | ZILUSDT |
| ZKFUSDT | ZKJETH | ZKJUSDT | ZKLUSDT | ZKUSDC | ZKUSDT |
| ZORAUSDT | ZRCUSDT | ZROUSDC | ZROUSDT | ZRXACS | ZRXETH |
| ZRXUSDT | ZTXUSDT |  |  |  |  |

## Example Applications

The Bybit 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 Bybit exchange:

```
from AlgorithmImports import *

class CoinAPIDataAlgorithm(QCAlgorithm):

    def initialize(self) -> None:
        self.set_start_date(2024, 9, 1)
        self.set_end_date(2024, 12, 31)
        # Set the account currency to USDT, since you can't trade with
        # USD and the algorithm doesn't automatically convert USD & USDT
        # holdings.
        self.set_account_currency("USDT", 100_000)
        self.universe_settings.asynchronous = True
        # Bybit accepts both Cash and Margin account types. Select the
        # one you need for the best reality modeling.
        self.set_brokerage_model(BrokerageName.BYBIT, AccountType.MARGIN)
        # Add BTCUSDT data.
        self._btc = self.add_crypto("BTCUSDT", Resolution.MINUTE, Market.BYBIT)
        # Historical data
        history = self.history(self._btc.symbol, 30, Resolution.DAILY)
        # Add a Crypto universe that selects trading pairs on Bybit.
        universe = self.add_universe(CryptoUniverse.bybit(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 BTCUSDT, 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(
            BybitFeeModel.TAKER_NON_VIP_FEE,
            self.settings.free_portfolio_value_percentage
        )
        quantity = (
            self.portfolio.cash_book['USDT'].amount
            / self._btc.ask_price
            * (1-buffer)
        )
        # Check if the quantity exceeds the minimum order size. On
        # Bybit, 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)
```

```
public class CoinAPIDataAlgorithm : QCAlgorithm
{
    private Crypto _btc;

    public override void Initialize()
    {
        SetStartDate(2024, 9, 1);
        SetEndDate(2024, 12, 31);
        // Set the account currency to USDT, since you can't trade with
        // USD and the algorithm doesn't automatically convert USD & USDT
        // holdings.
        SetAccountCurrency("USDT", 100000);
        UniverseSettings.Asynchronous = true;
        // Bybit accepts both Cash and Margin account types. Select the
        // one you need for the best reality modeling.
        SetBrokerageModel(BrokerageName.Bybit, AccountType.Margin);
        // Add BTCUSDT data.
        _btc = AddCrypto("BTCUSDT", Resolution.Minute, Market.Bybit);
        // Historical data
        var history = History(_btc.Symbol, 30, Resolution.Daily);
        // Add a Crypto universe that selects trading pairs on Bybit.
        var universe = AddUniverse(CryptoUniverse.Bybit(SelectAssets));
        // Historical Universe data
        var universeHistory = History(universe, 30, Resolution.Daily);
        foreach (var universeDay in universeHistory)
        {
            foreach (CryptoUniverse universeItem in universeDay)
            {
                var symbol = universeItem.Symbol;
                var price = universeItem.Close;
            }
        }
    }

    private IEnumerable<Symbol> SelectAssets(IEnumerable<CryptoUniverse> universeDay)
    {
        // Filter for materially traded Crypto pairs with significant
        // size and dollar volume, assuming higher capital flow in for
        // higher return.
        return from universeItem in universeDay
                where universeItem.Volume >= 100m
                && universeItem.VolumeInUsd > 10000000m
                select universeItem.Symbol;
    }

    public override void OnData(Slice slice)
    {
        // Speculate-invest all available free cash on BTCUSDT, repecting
        // the order quantity restrictions to avoid invalid orders.
        if (Portfolio.CashBook["BTC"].Amount != 0)
        {
            return;
        }
        // Define a buffer so that we can scale down the order size,
        // avoiding trading errors.
        var buffer = Math.Max(BybitFeeModel.TakerNonVIPFee, Settings.FreePortfolioValuePercentage);
        var quantity = Portfolio.CashBook["USDT"].Amount / _btc.AskPrice * (1-buffer);
        // Check if the quantity exceeds the minimum order size. On
        // Bybit, the minimum order size is measured in the base
        // currency (BTC in this case).
        if (Math.Abs(quantity) < _btc.SymbolProperties.MinimumOrderSize)
        {
            return;
        }
        MarketOrder(_btc, quantity);
    }
}
```

### Framework Algorithm Example

The following example algorithm creates a dynamic universe of Crypto pairs on the Bybit 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(2024, 9, 1)
        self.set_end_date(2024, 12, 31)
        # Set Account Currency to Tether, since USD and USDT will not auto-convert and USD cannot be used to trade
        self.set_account_currency("USDT", 100000)
        self.settings.free_portfolio_value_percentage = 0.05

        # Bybit accepts both Cash and Margin account types, select the one you need for the best reality modeling.
        self.set_brokerage_model(BrokerageName.BYBIT, AccountType.MARGIN)

        # 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 Bybit exchange
        self.add_universe(CryptoUniverse.bybit(self.universe_selection_filter))
        # Get the pairs on Bybit that have USDT as the quote currency.
        self._market_pairs = [
            x.key.symbol
            for x in self.symbol_properties_database.get_symbol_properties_list(Market.BYBIT)
            if x.value.quote_currency == self.account_currency
        ]

        self.add_alpha(ConstantAlphaModel(InsightType.PRICE, InsightDirection.UP, timedelta(minutes = 20), 0.025, None))
        # Equally invest to evenly dissipate the capital concentration risk of inidividual crypto pair
        self.set_portfolio_construction(EqualWeightingPortfolioConstructionModel())

    def universe_selection_filter(self, universe_day: List[CryptoUniverse]) -> List[Symbol]:
        # Select pairs where the quote currency is USDT.
        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 Bybit exchange:

```python
qb = QuantBook()

# Add Cryptocurrency pair
symbol = qb.add_crypto("BTCUSDT", market=Market.BYBIT).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.bybit(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 Bybit 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*
