Skip to main content

Crypto

The Crypto module wraps the functions of the OpenBB Terminal menu. This allows web applications and dashboards to be built quickly on top of the existing infrastructure. Navigating the functions is similar to operating the OpenBB Terminal.

How to Use

The list below are all the SDK functions at the openbb.crypto level:

PathTypeDescription
openbb.crypto.candleFunctionOHLC+V chart
openbb.crypto.ddSub-ModuleDue Diligence
openbb.crypto.defiSub-ModuleDeFi
openbb.crypto.discSub-ModuleDiscovery
openbb.crypto.findFunctionFind Digital Assets
openbb.crypto.loadFunctionLoad Historical Data
openbb.crypto.nftSub-ModuleNFTs
openbb.crypto.onchainSub-ModuleOnchain Metrics
openbb.crypto.ovSub-ModuleMarket Overview
openbb.crypto.priceFunctionLive Prices from Pyth
openbb.crypto.toolsSub-ModuleCalculators

Alternatively, the contents of a menu is printed by running, help(openbb.crypto). The objective of this guide is to introduce the high-level functions and provide a sample of examples from the sub-modules. Refer to the guides for each sub-module to learn more about them specifically.

Examples

Import Statements

The examples in this guide will assume that the code block below is at the beginning of the Python script or Jupyter Notebook file.

import pandas as pd
from openbb_terminal.sdk import openbb
%matplotlib inline

Load

The load function is capable of loading from a variety of sources, one of which is CCXT. When CCXT is source, an additional argument, exchange, is required.

help(openbb.crypto.load)

Help on Operation in module openbb_terminal.core.library.operation:

<openbb_terminal.core.library.operation.Operation object>
Load crypto currency to get data for

Parameters
----------
symbol: str
Coin to get
start_date: str or datetime, optional
Start date to get data from with. - datetime or string format (YYYY-MM-DD)
interval: str
The interval between data points in minutes.
Choose from: 1, 15, 30, 60, 240, 1440, 10080, 43200
exchange: str:
The exchange to get data from.
vs_currency: str
Quote Currency (Defaults to usdt)
end_date: str or datetime, optional
End date to get data from with. - datetime or string format (YYYY-MM-DD)
source: str
The source of the data
Choose from: CCXT, CoinGecko, YahooFinance

Returns
-------
pd.DataFrame
Dataframe consisting of price and volume data
CCXT Exchange List (expand to see list of exchanges supported by CCXT)
Exchange
aax
ascendex
bequant
bibox
bigone
binance
binancecoinm
binanceus
binanceusdm
bit2c
bitbank
bitbay
bitcoincom
bitfinex
bitfinex2
bitflyer
bitforex
bitget
bithumb
bitmart
bitmex
bitopro
bitpanda
bitrue
bitso
bitstamp
bitstamp1
bittrex
bitvavo
bkex
bl3p
btcalpha
btcbox
btcex
btcmarkets
btctradeua
btcturk
buda
bw
bybit
bytetrade
cex
coinbaseprime
coinbasepro
coincheck
coinex
coinfalcon
coinmate
coinone
coinspot
crex24
cryptocom
currencycom
delta
deribit
digifinex
eqonex
exmo
flowbtc
fmfwio
ftx
ftxus
gate
gateio
gemini
hitbtc
bitbtc3
hollaex
huobi
huobijp
idex
independentreserve
indodax
itbit
kraken
kucoin
kucoinfutures
kuna
latoken
lbank
lbank2
liquid
luno
lykke
mercado
mexc
mexc3
ndax
novadax
oceanex
okcoin
okex
okex5
okx
paymium
phemex
poloniex
probit
qtrade
ripio
stex
therock
tidebit
tidex
timex
tokocrypto
upbit
wavesexchange
whitebit
woo
yobit
zaif
zb
zipmex
zonda
eth_df = openbb.crypto.load('ETH', source = 'CCXT', exchange = 'binance')

eth_df.tail(5)
dateOpenHighLowCloseVolume
2022-11-14 00:00:001221.51291.21171.131243.28934742
2022-11-15 00:00:001243.2912911234.011253.23632826
2022-11-16 00:00:001253.221268.671187.061216.17673340
2022-11-17 00:00:001216.161228.221181.051200.43530537
2022-11-18 00:00:001200.4212341199.181206.11306400

Adding the interval argument allows for intraday data or weekly/monthly periods to be loaded.

eth_df = openbb.crypto.load('ETH', source = 'CCXT', exchange = 'binance', interval = '30')

eth_df.tail(3)
dateOpenHighLowCloseVolume
2022-11-18 17:00:001207.441208.351200.361205.3511359.4
2022-11-18 17:30:001205.361207.121202.51204.175878.59
2022-11-18 18:00:001204.171207.281203.261206.371540.67

Loading monthly OHLC+V data looks like this:

eth_df = openbb.crypto.load('ETH', source = 'CCXT', exchange = 'binance', interval = '43200')

eth_df.tail(3)
dateOpenHighLowCloseVolume
2022-09-01 00:00:001554.11178912201328.722.25453e+07
2022-10-01 00:00:001328.711663.0611901572.691.67681e+07
2022-11-01 00:00:001572.6916801073.531204.781.6707e+07

Candles

A loaded DataFrame is used as the input for the candles function:

openbb.crypto.candle(eth_df)

openbb.crypto.candle

Notice that the chart has no title. It can be added using the title argument.

openbb.crypto.candles(eth_df, title = 'ETH/USDT (Monthly)')

openbb.crypto.candle

Find

Find similar coins by name, symbol, or ID.

results = openbb.crypto.find(
query = 'Genesis',
source = 'CoinPaprika',
key = 'name',
)

results.head(5)
namerankidsymboltype
0Gnosis124gno-gnosisGNOtoken
1Gene4696gene-geneGENEtoken
2Nemesis4246nms-nemesisNMStoken
3Genesis Token7763gent-genesis-tokenGENTtoken
4Alpha Genesis4732agen-alpha-genesisAGENtoken

Active Addresses

Get the historical number of active wallet addresses for a token with: openbb.crypto.dd.active.

active_eth = openbb.crypto.dd.active(symbol = 'ETH', interval = '24h', start_date = '2017-09-01')
active_eth = active_eth.reset_index()
active_eth.rename(columns = {'v': 'Active Addresses', 't': 'Date'}, inplace = True)
active_eth.set_index(keys = ['Date'], inplace = True)

active_eth.tail(5)
DateActive Addresses
2022-11-13 00:00:00426441
2022-11-14 00:00:00474868
2022-11-15 00:00:00469880
2022-11-16 00:00:00448492
2022-11-17 00:00:00463467

Trades

Get trade-level data from a specific exchange with: openbb.crypto.dd.trades

trades_ethusdt = openbb.crypto.dd.trades(exchange_id = 'binance', symbol = 'ETH', to_symbol = 'USDT')

trades_ethusdt.tail(5)
DatePriceAmountCostSide
4952022-11-18 19:16:15.959000+00:001204.022.70333254.83buy
4962022-11-18 19:16:15.959000+00:001204.031.17691417.02buy
4972022-11-18 19:16:15.981000+00:001204.035.04936079.51buy
4982022-11-18 19:16:15.981000+00:001204.072.11262543.72buy
4992022-11-18 19:16:15.981000+00:001204.085.28116358.87buy

Use the exchange_id argument to return data from other venues, such as CoinBase.

trades_ethusdt = openbb.crypto.dd.trades(exchange_id = 'coinbaseprime', symbol = 'ETH', to_symbol = 'USDT')

trades_ethusdt.tail(5)
DatePriceAmountCostSide
9952022-11-18 19:20:15.176000+00:001204.653.898784696.67sell
9962022-11-18 19:20:29.524000+00:001204.780.41545500.526buy
9972022-11-18 19:20:29.931000+00:001204.786.2e-070.000746964buy
9982022-11-18 19:20:32.263000+00:001205.030.41536500.521buy
9992022-11-18 19:20:32.274000+00:001205.033.05e-060.00367534buy

Coin_List

Retrieve a list of all coins available from CoinPaprika with: openbb.crypto.ov.coin_list()

coins = openbb.crypto.ov.coin_list()

coins.head(10)
rankidnamesymboltype
01btc-bitcoinBitcoinBTCcoin
12eth-ethereumEthereumETHcoin
23usdt-tetherTetherUSDTtoken
34usdc-usd-coinUSD CoinUSDCtoken
45bnb-binance-coinBinance CoinBNBcoin
56busd-binance-usdBinance USDBUSDtoken
67xrp-xrpXRPXRPcoin
78doge-dogecoinDogecoinDOGEcoin
89ada-cardanoCardanoADAcoin
910hex-hexHEXHEXtoken

BAAS (Historical Bid-Ask Average Spread)

Measure liquidity over time for an asset with: openbb.crypto.onchain.baas

openbb.crypto.onchain.baas(symbol = 'ETH', to_symbol = 'USDT')
DateBase currencyQuote currencyDaily spreadAverage bid priceAverage ask price
02022-11-08ETHUSDT26.79611480.721453.93
12022-11-09ETHUSDT87.94661255.581167.63
22022-11-10ETHUSDT24.82621248.81273.62
32022-11-11ETHUSDT365.65877.7921243.44
42022-11-13ETHUSDT23.20321240.231217.02
52022-11-14ETHUSDT22.57261221.921199.35

Discover trending coins on CoinGecko with: openbb.crypto.disc.trending()

openbb.crypto.disc.trending()
SymbolNamemarket_cap Cap Rank
0solanaSolana16
1chilizChiliz36
2aptosAptos64
3elrond-erd-2MultiversX (Elrond)43
4algorandAlgorand29
5matic-networkPolygon10
6media-networkMedia Network890

News

Get crypto-focussed news with: openbb.crypto.ov.news

openbb.crypto.ov.news(post_kind = 'news',region = 'en', filter_= 'important', ascend = False)
published_atdomaintitlenegative_votespositive_voteslink
02022-11-18decrypt.coEdward Snowden: Sanctioning of Ethereum Mixer Tornado Cash Was02https://cryptopanic.com/news/16935211/Edward-Snowden-Sanctioning-of-Ethereum-Mixer-Tornado-Cash-Was-Deeply-Illiberal-and-Profoundly-Authoritarian
'Deeply Illiberal and Profoundly Authoritarian'
102022-11-18theblockcrypto.comCardano developer Emurgo to issue fiat-pegged stablecoin called321https://cryptopanic.com/news/16933998/Cardano-developer-Emurgo-to-issue-fiat-pegged-stablecoin-called-USDA
USDA
12022-11-18beincrypto.comSHIB Army Remains Positive as Memecoin Social Sentiment Index03https://cryptopanic.com/news/16935115/SHIB-Army-Remains-Positive-as-Memecoin-Social-Sentiment-Index-Remains-Positive
Remains Positive
172022-11-18u.todayIs El Salvador's President's Decision to Buy One Bitcoin per Day a248https://cryptopanic.com/news/16925762/Is-El-Salvadors-Presidents-Decision-to-Buy-One-Bitcoin-per-Day-a-Good-Idea
Good Idea?
152022-11-18dailyhodl.com‘Secret’ Altcoin Goes Parabolic After Rumors of European Ban on03https://cryptopanic.com/news/16925942/Secret-Altcoin-Goes-Parabolic-After-Rumors-of-European-Ban-on-Privacy-Coins-Swirl
Privacy Coins Swirl
742022-11-15cryptopotato.comOKX Announces $100 Million Fund to Support Distressed Projects04https://cryptopanic.com/news/16903760/OKX-Announces-100-Million-Fund-to-Support-Distressed-Projects-Following-FTX-Crash-Report
Following FTX Crash (Report)
732022-11-15cointelegraph.comThousands petition for congressional investigation of alleged136https://cryptopanic.com/news/16904296/Thousands-petition-for-congressional-investigation-of-alleged-GenslerSBF-links
Gensler–SBF links
722022-11-15cryptonews.comXRP Price Forecast as XRP Pumps 9%, Becomes Top Performer013https://cryptopanic.com/news/16904392/XRP-Price-Forecast-as-XRP-Pumps-9-Becomes-Top-Performer
712022-11-15theblockcrypto.comKraken’s Ogilvie says staking adoption set to skyrocket04https://cryptopanic.com/news/16904805/Krakens-Ogilvie-says-staking-adoption-set-to-skyrocket
792022-11-15zycrypto.comSEC vs. Ripple Case Sees New Twists And Turns As Whale Holdings In215https://cryptopanic.com/news/16903258/SEC-vs-Ripple-Case-Sees-New-Twists-And-Turns-As-Whale-Holdings-In-XRP-Skyrocket
XRP Skyrocket