Add crypto report (#575)

* Add crypto report

* refactor papermill to output html directly

* fix duplicate function

* fix finviz_view

* Update README.md

* forgot to push crypto market template

* add bitcoin plot to crypto report

Co-authored-by: Jamie <jmaslek11@gmail.com>
This commit is contained in:
DidierRLopes
2021-07-30 00:09:50 +01:00
committed by GitHub
parent 6ad25442ee
commit b7e9495d3a
18 changed files with 34321 additions and 19453 deletions

View File

@@ -30,7 +30,7 @@ jobs:
- run: pip install types-pytz types-requests types-termcolor types-tabulate types-PyYAML types-python-dateutil
- run: bandit -r . || true
- run: black --check .
- run: codespell --ignore-words-list=pres,coo,navagation,ser,buil,operatio,mape,ba,hist --quiet-level=2 --skip=".git" --skip="*.yaml" --skip="*.json" --skip="*.html" --skip="*.ini"
- run: codespell --ignore-words-list=pres,coo,navagation,ser,buil,operatio,mape,ba,hist,yeld,ether --quiet-level=2 --skip=".git" --skip="*.yaml" --skip="*.json" --skip="*.html" --skip="*.ini"
- run: flake8 . --count --ignore=E203,W503 --max-line-length=122 --show-source --statistics
- run: mypy --ignore-missing-imports .
- run: shopt -s globstar && pyupgrade --py36-plus **/*.py

View File

@@ -21,7 +21,7 @@ repos:
hooks:
- id: codespell
entry: codespell
args: [ '--ignore-words-list=mape,ba,hist,Press,COUP,Navigation,Set,Build,built,Operation', '--quiet-level=2', '--skip=".git,*.html,*.yaml,*.json,./tests"' ]
args: [ '--ignore-words-list=pres,coo,navagation,ser,buil,operatio,mape,ba,hist,yeld,ether', '--quiet-level=2', '--skip=".git,*.html,*.yaml,*.json,./tests"' ]
- repo: https://github.com/pre-commit/mirrors-mypy
rev: 'v0.812'
hooks:

View File

@@ -6,9 +6,10 @@ This menu has a different concept from remaining menus. It has 2 main goals:
Command | Template | Example
------ | --------|----
`dd` | [Due Diligence Template](/notebooks/templates/due_diligence.ipynb) | [Due Diligence Example](/notebooks/examples/gme_20210726_030502_due_diligence.html)
`econ` | [Economy Template](/notebooks/templates/econ_data.ipynb) | [Economy Example](/notebooks/examples/econ_data_20210726_030519.html)
`dp` | [Dark Pool](/notebooks/templates/dark_pool.ipynb) | [Dark Pool](/notebooks/examples/amc_20210726_030345_dark_pool.html)
`dd` | [Due Diligence Template](/notebooks/templates/due_diligence.ipynb) | [Due Diligence Example](/notebooks/examples/aapl_due_diligence_20210729_001048.html)
`econ` | [Economy Template](/notebooks/templates/econ_data.ipynb) | [Economy Example](/notebooks/examples/econ_data_20210729_001227.html)
`dp` | [Dark Pool](/notebooks/templates/dark_pool.ipynb) | [Dark Pool](/notebooks/examples/amc_dark_pool_20210728_235316.html)
`cm` | [Crypto Market](/notebooks/templates/crypto_market.ipynb) | [Crypto Market](/notebooks/examples/crypto_market_20210729_001530.html)
## How to run the report

View File

@@ -0,0 +1,80 @@
"""Papermill Crypto Overview View Module"""
__docformat__ = "numpy"
import argparse
from typing import List
from datetime import datetime
import os
import webbrowser
import papermill as pm
from gamestonk_terminal.helper_funcs import parse_known_args_and_warn
from gamestonk_terminal import config_terminal as cfg
def crypto_market_report(other_args: List[str]):
"""Crypto Market Report
Parameters
----------
other_args : List[str]
Command line arguments to be processed with argparse
"""
parser = argparse.ArgumentParser(
add_help=False,
formatter_class=argparse.ArgumentDefaultsHelpFormatter,
prog="co",
description="""
Run crypto market report
""",
)
parser.add_argument(
"-m",
"--mode",
action="store",
dest="mode",
default="html",
choices=["ipynb", "html"],
help="Output mode to show report. ipynb will allow to add information to the report.",
)
try:
ns_parser = parse_known_args_and_warn(parser, other_args)
if not ns_parser:
return
# Update values:
today = datetime.now()
analysis_notebook = os.path.join(
"notebooks", "reports", f"crypto_market_{today.strftime('%Y%m%d_%H%M%S')}"
)
pm.execute_notebook(
os.path.join("notebooks", "templates", "crypto_market.ipynb"),
analysis_notebook + ".ipynb",
parameters=dict(
report_name=f"crypto_market_{today.strftime('%Y%m%d_%H%M%S')}",
),
)
if ns_parser.mode == "ipynb":
webbrowser.open(
os.path.join(
f"http://localhost:{cfg.PAPERMILL_NOTEBOOK_REPORT_PORT}",
"notebooks",
analysis_notebook + ".ipynb",
)
)
else:
webbrowser.open(
os.path.join(
f"http://localhost:{cfg.PAPERMILL_NOTEBOOK_REPORT_PORT}",
"view",
analysis_notebook + "." + ns_parser.mode,
)
)
print("")
except Exception as e:
print(e, "\n")
except SystemExit:
print("")

View File

@@ -11,15 +11,13 @@ from gamestonk_terminal.helper_funcs import parse_known_args_and_warn
from gamestonk_terminal import config_terminal as cfg
def dark_pool(other_args: List[str], show: bool = True):
"""Dark Pool report
def dark_pool_report(other_args: List[str]):
"""Dark Pool Report
Parameters
----------
other_args : List[str]
Command line arguments to be processed with argparse
show : bool
Flag to open browser or not
"""
parser = argparse.ArgumentParser(
add_help=False,
@@ -37,6 +35,15 @@ def dark_pool(other_args: List[str], show: bool = True):
required="-h" not in other_args,
help="Stock ticker",
)
parser.add_argument(
"-m",
"--mode",
action="store",
dest="mode",
default="html",
choices=["ipynb", "html"],
help="Output mode to show report. ipynb will allow to add information to the report.",
)
try:
if other_args:
@@ -50,21 +57,35 @@ def dark_pool(other_args: List[str], show: bool = True):
# Update values:
s_ticker = ns_parser.s_ticker
today = datetime.now()
analysis_notebook = f"notebooks/reports/{s_ticker}_{today.strftime('%Y%m%d_%H%M%S')}_dark_pool.ipynb"
analysis_notebook = os.path.join(
"notebooks",
"reports",
f"{s_ticker}_dark_pool_{today.strftime('%Y%m%d_%H%M%S')}",
)
pm.execute_notebook(
"notebooks/templates/dark_pool.ipynb",
analysis_notebook,
os.path.join("notebooks", "templates", "dark_pool.ipynb"),
analysis_notebook + ".ipynb",
parameters=dict(
ticker=s_ticker,
report_name=f"{s_ticker}_{today.strftime('%Y%m%d_%H%M%S')}_dark_pool",
base_path=os.path.abspath(os.path.join(".")),
report_name=f"{s_ticker}_dark_pool_{today.strftime('%Y%m%d_%H%M%S')}",
),
)
if show:
if ns_parser.mode == "ipynb":
webbrowser.open(
f"http://localhost:{cfg.PAPERMILL_NOTEBOOK_REPORT_PORT}/notebooks/{analysis_notebook}"
os.path.join(
f"http://localhost:{cfg.PAPERMILL_NOTEBOOK_REPORT_PORT}",
"notebooks",
analysis_notebook + ".ipynb",
)
)
else:
webbrowser.open(
os.path.join(
f"http://localhost:{cfg.PAPERMILL_NOTEBOOK_REPORT_PORT}",
"view",
analysis_notebook + "." + ns_parser.mode,
)
)
print("")

View File

@@ -11,15 +11,13 @@ from gamestonk_terminal.helper_funcs import parse_known_args_and_warn
from gamestonk_terminal import config_terminal as cfg
def due_diligence(other_args: List[str], show: bool = True):
"""Due Diligence report
def due_diligence_report(other_args: List[str]):
"""Due Diligence Report
Parameters
----------
other_args : List[str]
Command line arguments to be processed with argparse
show : bool
Flag to open browser or not
"""
parser = argparse.ArgumentParser(
add_help=False,
@@ -37,6 +35,15 @@ def due_diligence(other_args: List[str], show: bool = True):
required="-h" not in other_args,
help="Stock ticker",
)
parser.add_argument(
"-m",
"--mode",
action="store",
dest="mode",
default="html",
choices=["ipynb", "html"],
help="Output mode to show report. ipynb will allow to add information to the report.",
)
try:
if other_args:
@@ -50,21 +57,36 @@ def due_diligence(other_args: List[str], show: bool = True):
# Update values:
s_ticker = ns_parser.s_ticker
today = datetime.now()
analysis_notebook = f"notebooks/reports/{s_ticker}_{today.strftime('%Y%m%d_%H%M%S')}_due_diligence.ipynb"
analysis_notebook = os.path.join(
"notebooks",
"reports",
f"{s_ticker}_due_diligence_{today.strftime('%Y%m%d_%H%M%S')}",
)
pm.execute_notebook(
"notebooks/templates/due_diligence.ipynb",
analysis_notebook,
os.path.join("notebooks", "templates", "due_diligence.ipynb"),
analysis_notebook + ".ipynb",
parameters=dict(
ticker=s_ticker,
report_name=f"{s_ticker}_{today.strftime('%Y%m%d_%H%M%S')}_due_diligence",
report_name=f"{s_ticker}_due_diligence_{today.strftime('%Y%m%d_%H%M%S')}",
base_path=os.path.abspath(os.path.join(".")),
),
)
if show:
if ns_parser.mode == "ipynb":
webbrowser.open(
f"http://localhost:{cfg.PAPERMILL_NOTEBOOK_REPORT_PORT}/notebooks/{analysis_notebook}"
os.path.join(
f"http://localhost:{cfg.PAPERMILL_NOTEBOOK_REPORT_PORT}",
"notebooks",
analysis_notebook + ".ipynb",
)
)
else:
webbrowser.open(
os.path.join(
f"http://localhost:{cfg.PAPERMILL_NOTEBOOK_REPORT_PORT}",
"view",
analysis_notebook + "." + ns_parser.mode,
)
)
print("")

View File

@@ -11,8 +11,8 @@ from gamestonk_terminal.helper_funcs import parse_known_args_and_warn
from gamestonk_terminal import config_terminal as cfg
def econ_data(other_args: List[str]):
"""Creates an Economic Data report
def economy_data_report(other_args: List[str]):
"""Economic Data report
Parameters
----------
@@ -27,6 +27,15 @@ def econ_data(other_args: List[str]):
Run Economic Data report
""",
)
parser.add_argument(
"-m",
"--mode",
action="store",
dest="mode",
default="html",
choices=["ipynb", "html"],
help="Output mode to show report. ipynb will allow to add information to the report.",
)
try:
ns_parser = parse_known_args_and_warn(parser, other_args)
@@ -34,22 +43,35 @@ def econ_data(other_args: List[str]):
return
today = datetime.now()
analysis_notebook = (
f"notebooks/reports/econ_data_{today.strftime('%Y%m%d_%H%M%S')}.ipynb"
analysis_notebook = os.path.join(
"notebooks", "reports", f"econ_data_{today.strftime('%Y%m%d_%H%M%S')}"
)
pm.execute_notebook(
"notebooks/templates/econ_data.ipynb",
analysis_notebook,
os.path.join("notebooks", "templates", "econ_data.ipynb"),
analysis_notebook + ".ipynb",
parameters=dict(
report_name=f"econ_data_{today.strftime('%Y%m%d_%H%M%S')}",
base_path=os.path.abspath(os.path.join(".")),
),
)
webbrowser.open(
f"http://localhost:{cfg.PAPERMILL_NOTEBOOK_REPORT_PORT}/notebooks/{analysis_notebook}"
)
if ns_parser.mode == "ipynb":
webbrowser.open(
os.path.join(
f"http://localhost:{cfg.PAPERMILL_NOTEBOOK_REPORT_PORT}",
"notebooks",
analysis_notebook + ".ipynb",
)
)
else:
webbrowser.open(
os.path.join(
f"http://localhost:{cfg.PAPERMILL_NOTEBOOK_REPORT_PORT}",
"view",
analysis_notebook + "." + ns_parser.mode,
)
)
print("")
except Exception as e:

View File

@@ -6,8 +6,12 @@ import os
from typing import List
import subprocess
from gamestonk_terminal.papermill import dark_pool_view, due_diligence_view
from gamestonk_terminal.papermill import econ_data_view
from gamestonk_terminal.papermill import (
crypto_market_view,
dark_pool_view,
due_diligence_view,
econ_data_view,
)
from gamestonk_terminal.helper_funcs import get_flair
from gamestonk_terminal import config_terminal
@@ -25,7 +29,7 @@ class PapermillController:
)
self.papermill_parser.add_argument(
"cmd",
choices=["cls", "?", "help", "q", "quit", "dd", "econ", "dp"],
choices=["cls", "?", "help", "q", "quit", "dd", "econ", "dp", "cm"],
)
def switch(self, an_input: str, proc: subprocess.Popen):
@@ -69,7 +73,7 @@ class PapermillController:
self, "call_" + known_args.cmd, lambda: "Command not recognized!"
)(other_args, proc)
def call_help(self, _):
def call_help(self, *_):
"""Process Help command"""
print_papermill()
@@ -85,15 +89,19 @@ class PapermillController:
def call_dd(self, other_args: List[str], _):
"""Process DD command"""
due_diligence_view.due_diligence(other_args)
due_diligence_view.due_diligence_report(other_args)
def call_econ(self, other_args: List[str], _):
"""Process Econ command"""
econ_data_view.econ_data(other_args)
econ_data_view.economy_data_report(other_args)
def call_dp(self, other_args: List[str], _):
"""Process DP command"""
dark_pool_view.dark_pool(other_args)
dark_pool_view.dark_pool_report(other_args)
def call_cm(self, other_args: List[str], _):
"""Process CM command"""
crypto_market_view.crypto_market_report(other_args)
def print_papermill():
@@ -110,6 +118,7 @@ def print_papermill():
print(" dd generate DUE DILIGENCE report")
print(" econ generate ECONOMIC DATA summary")
print(" dp generate DARK POOL report")
print(" cm generate CRYPTO MARKET report")
print("")

View File

@@ -250,7 +250,7 @@ def screener(other_args: List[str], loaded_preset: str, data_type: str) -> List[
if ns_parser.mill:
for i in range(len(df_screen)):
ticker = [df_screen.iat[i, 0]]
due_diligence_view.due_diligence(ticker, show=False)
due_diligence_view.due_diligence_report(ticker)
return list(df_screen["Ticker"].values)
print("")

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

967
notebooks/templates/crypto_market.ipynb vendored Normal file
View File

@@ -0,0 +1,967 @@
{
"cells": [
{
"cell_type": "code",
"execution_count": 47,
"id": "atomic-accessory",
"metadata": {},
"outputs": [],
"source": [
"import importlib\n",
"import pathlib\n",
"import os\n",
"import sys\n",
"from datetime import datetime, timedelta\n",
"import pandas as pd\n",
"from IPython.display import display, Markdown\n",
"import warnings\n",
"warnings.filterwarnings('ignore')\n",
"module_path = os.path.abspath(os.path.join('../..'))\n",
"\n",
"if module_path not in sys.path:\n",
" sys.path.append(module_path)"
]
},
{
"cell_type": "code",
"execution_count": 48,
"id": "early-oxford",
"metadata": {
"tags": [
"parameters"
]
},
"outputs": [],
"source": [
"report_name=f\"crypto_market_{datetime.now().strftime('%Y%m%d_%H%M%S')}\""
]
},
{
"cell_type": "code",
"execution_count": 49,
"id": "extra-tennessee",
"metadata": {},
"outputs": [
{
"data": {
"text/markdown": [
"# 2021/07/28 09:00:23 - Crypto Market Overview"
],
"text/plain": [
"<IPython.core.display.Markdown object>"
]
},
"metadata": {},
"output_type": "display_data"
}
],
"source": [
"display(Markdown(f\"# Crypto Market - {datetime.now().strftime('%Y/%m/%d %H:%M:%S')}\"))"
]
},
{
"cell_type": "code",
"execution_count": 50,
"id": "lovely-communications",
"metadata": {},
"outputs": [],
"source": [
"from gamestonk_terminal.cryptocurrency.coingecko import pycoingecko_view as cg\n",
"from gamestonk_terminal.cryptocurrency.coinpaprika import coinpaprika_view as cp"
]
},
{
"cell_type": "markdown",
"id": "ee21a8d8",
"metadata": {},
"source": [
"## Bitcoin Chart"
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "f9872e1e",
"metadata": {},
"outputs": [],
"source": [
"cp.chart(\"btc-bitcoin\", [\"-d\", \"60\"])"
]
},
{
"cell_type": "markdown",
"id": "criminal-connection",
"metadata": {},
"source": [
"## Global Market Information"
]
},
{
"cell_type": "code",
"execution_count": 51,
"id": "indonesian-stuff",
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"╒══════════════════════════════╤═════════════════════╕\n",
"│ Metric │ Value │\n",
"╞══════════════════════════════╪═════════════════════╡\n",
"│ market_cap_usd │ 1.568 T │\n",
"├──────────────────────────────┼─────────────────────┤\n",
"│ volume_24h_usd │ 187.091 B │\n",
"├──────────────────────────────┼─────────────────────┤\n",
"│ bitcoin_dominance_percentage │ 47.310 │\n",
"├──────────────────────────────┼─────────────────────┤\n",
"│ cryptocurrencies_number │ 3.232 K │\n",
"├──────────────────────────────┼─────────────────────┤\n",
"│ market_cap_ath_value │ 2.456 T │\n",
"├──────────────────────────────┼─────────────────────┤\n",
"│ market_cap_ath_date │ 2021-05-12 04:00:00 │\n",
"├──────────────────────────────┼─────────────────────┤\n",
"│ volume_24h_ath_value │ 1.388 T │\n",
"├──────────────────────────────┼─────────────────────┤\n",
"│ volume_24h_ath_date │ 2021-05-02 17:00:00 │\n",
"├──────────────────────────────┼─────────────────────┤\n",
"│ volume_24h_percent_from_ath │ -86.520 │\n",
"├──────────────────────────────┼─────────────────────┤\n",
"│ volume_24h_percent_to_ath │ 641.990 │\n",
"├──────────────────────────────┼─────────────────────┤\n",
"│ market_cap_change_24h │ 4.600 │\n",
"├──────────────────────────────┼─────────────────────┤\n",
"│ volume_24h_change_24h │ -6.050 │\n",
"├──────────────────────────────┼─────────────────────┤\n",
"│ last_updated │ 2021-07-28 08:59:48 │\n",
"╘══════════════════════════════╧═════════════════════╛\n",
"\n"
]
}
],
"source": [
"cp.global_market([])"
]
},
{
"cell_type": "markdown",
"id": "c4af059a",
"metadata": {},
"source": [
"## Hot news"
]
},
{
"cell_type": "code",
"execution_count": 64,
"id": "72401875",
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"╒═════════╤════════════════════════════════════════════════════╤═══════════════════════════════╤═══════════════════╕\n",
"│ index │ title │ author │ posted │\n",
"╞═════════╪════════════════════════════════════════════════════╪═══════════════════════════════╪═══════════════════╡\n",
"│ 1 │ Breaking: Ripple Launches First On-Demand │ CoinGape │ 21 minutes ago │\n",
"│ │ Liquidity (ODL) Corridor in Japan │ │ │\n",
"├─────────┼────────────────────────────────────────────────────┼───────────────────────────────┼───────────────────┤\n",
"│ 2 │ Ethereum-based EthSign platform wins seed funding │ Forkast │ 21 minutes ago │\n",
"│ │ from Draper Associates │ │ │\n",
"├─────────┼────────────────────────────────────────────────────┼───────────────────────────────┼───────────────────┤\n",
"│ 3 │ A Comprehensive Review of the NuGenesis Network │ Cryptomode │ 22 minutes ago │\n",
"│ │ (Part 1 of 6) │ │ │\n",
"├─────────┼────────────────────────────────────────────────────┼───────────────────────────────┼───────────────────┤\n",
"│ 4 │ AAVE Price Analysis: Is It A Good Time to Long │ CoinGape │ 27 minutes ago │\n",
"│ │ AAVE? Price Up by 40% Over last Week │ │ │\n",
"├─────────┼────────────────────────────────────────────────────┼───────────────────────────────┼───────────────────┤\n",
"│ 5 │ Dogecoin for dog food at Brazil’s Burger Kings │ Forkast │ 29 minutes ago │\n",
"├─────────┼────────────────────────────────────────────────────┼───────────────────────────────┼───────────────────┤\n",
"│ 6 │ Bitcoin (BTC) Makes Another Attempt At Breaking │ BeInCrypto │ 30 minutes ago │\n",
"│ │ Above Range Highs │ │ │\n",
"├─────────┼────────────────────────────────────────────────────┼───────────────────────────────┼───────────────────┤\n",
"│ 7 │ Amazon plans to explore crypto but denies bitcoin │ Coinnounce │ 40 minutes ago │\n",
"│ │ payments. │ │ │\n",
"├─────────┼────────────────────────────────────────────────────┼───────────────────────────────┼───────────────────┤\n",
"│ 8 │ Binance CEO Cooperating with Regulators to be │ BeInCrypto │ about 1 hour ago │\n",
"│ │ Licensed Globally │ │ │\n",
"├─────────┼────────────────────────────────────────────────────┼───────────────────────────────┼───────────────────┤\n",
"│ 9 │ Miss this? Our ongoing Hosted Elemental Chat test │ CryptoPanic │ about 1 hour ago │\n",
"│ │ is huge. End-to-end test of a #P2P Holochain app │ │ │\n",
"│ │ hosted by the… │ │ │\n",
"├─────────┼────────────────────────────────────────────────────┼───────────────────────────────┼───────────────────┤\n",
"│ 10 │ LUNA Price Analysis: Terra (LUNA) Price Jumps 70% │ CoinGape │ about 1 hour ago │\n",
"│ │ Past Week, Is It A Good time to Buy LUNA? │ │ │\n",
"├─────────┼────────────────────────────────────────────────────┼───────────────────────────────┼───────────────────┤\n",
"│ 11 │ $7B investment firm recommends crypto to beat │ Cointelegraph │ about 1 hour ago │\n",
"│ │ currency debasement │ │ │\n",
"├─────────┼────────────────────────────────────────────────────┼───────────────────────────────┼───────────────────┤\n",
"│ 12 │ CBDCs ‘concocted in hell by Satan himself’ says │ Cointelegraph │ about 1 hour ago │\n",
"│ │ ASI president Rich Checkan │ │ │\n",
"├─────────┼────────────────────────────────────────────────────┼───────────────────────────────┼───────────────────┤\n",
"│ 13 │ Huobi Bull #Bitcoin Deadlift! │ 🥇Grab Your Gold! CryptoPanic │ about 1 hour ago │\n",
"├─────────┼────────────────────────────────────────────────────┼───────────────────────────────┼───────────────────┤\n",
"│ 14 │ U.S. Senator Wants to Save Financial System from │ CryptoPotato │ about 1 hour ago │\n",
"│ │ “Shadowy Crypto Super-Coders” │ │ │\n",
"├─────────┼────────────────────────────────────────────────────┼───────────────────────────────┼───────────────────┤\n",
"│ 15 │ Unique Addresses Tethered to Ethereum Defi Apps │ Bitcoin.com │ about 2 hours ago │\n",
"│ │ Climb Past 3 Million │ │ │\n",
"├─────────┼────────────────────────────────────────────────────┼───────────────────────────────┼───────────────────┤\n",
"│ 16 │ #Binance Completes @0xPolygon $MATIC Mainnet Token │ CryptoPanic │ about 2 hours ago │\n",
"│ │ Wallet Integration │ │ │\n",
"├─────────┼────────────────────────────────────────────────────┼───────────────────────────────┼───────────────────┤\n",
"│ 17 │ Cardano, Litecoin Price Prediction: July 28, 2021 │ CoinGape │ about 2 hours ago │\n",
"├─────────┼────────────────────────────────────────────────────┼───────────────────────────────┼───────────────────┤\n",
"│ 18 │ FTX CEO Faces Backlash For Bitcoin And Ethereum │ Crypto Daily │ about 2 hours ago │\n",
"│ │ Energy Comments │ │ │\n",
"├─────────┼────────────────────────────────────────────────────┼───────────────────────────────┼───────────────────┤\n",
"│ 19 │ Gone in 31 seconds: Yield Guild Games’ IDO raises │ Cointelegraph │ about 2 hours ago │\n",
"│ │ $12.5M from just 32 participants │ │ │\n",
"├─────────┼────────────────────────────────────────────────────┼───────────────────────────────┼───────────────────┤\n",
"│ 20 │ Bitcoin Dominance Inches Closer to 50 Percent as │ U.Today │ about 2 hours ago │\n",
"│ │ BTC Revisits $40K │ │ │\n",
"├─────────┼────────────────────────────────────────────────────┼───────────────────────────────┼───────────────────┤\n",
"│ 21 │ NFT Gaming Market Puts A Strong Competition to the │ CoinGape │ about 2 hours ago │\n",
"│ │ DeFi Market │ │ │\n",
"├─────────┼────────────────────────────────────────────────────┼───────────────────────────────┼───────────────────┤\n",
"│ 22 │ Mastercard launches new crypto startup accelerator │ Forkast │ about 2 hours ago │\n",
"│ │ program │ │ │\n",
"├─────────┼────────────────────────────────────────────────────┼───────────────────────────────┼───────────────────┤\n",
"│ 23 │ Robinhood seeks to protect traders from crypto │ Forkast │ about 2 hours ago │\n",
"│ │ price volatility │ │ │\n",
"├─────────┼────────────────────────────────────────────────────┼───────────────────────────────┼───────────────────┤\n",
"│ 24 │ #Binance Will Support the @Theta_Network $THETA │ CryptoPanic │ about 2 hours ago │\n",
"│ │ Upgrade &amp; Hard Fork │ │ │\n",
"├─────────┼────────────────────────────────────────────────────┼───────────────────────────────┼───────────────────┤\n",
"│ 25 │ ETH's trading volume grew much faster than BTC’s │ Cointelegraph │ about 2 hours ago │\n",
"│ │ in first half of 2021 │ │ │\n",
"╘═════════╧════════════════════════════════════════════════════╧═══════════════════════════════╧═══════════════════╛\n",
"\n"
]
}
],
"source": [
"cg.news(['-t','25'])"
]
},
{
"cell_type": "markdown",
"id": "4cb62372",
"metadata": {},
"source": [
"## Top coins market information"
]
},
{
"cell_type": "code",
"execution_count": 65,
"id": "3e0a2546",
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"\n",
"Displaying data vs USD\n",
"╒════════╤═════════════════╤══════════╤══════════╤══════════════╤═══════════════════╤═════════════════╤══════════════════╤═════════════╤════════════════╕\n",
"│ rank │ name │ symbol │ price │ volume_24h │ mcap_change_24h │ pct_change_1h │ pct_change_24h │ ath_price │ pct_from_ath │\n",
"╞════════╪═════════════════╪══════════╪══════════╪══════════════╪═══════════════════╪═════════════════╪══════════════════╪═════════════╪════════════════╡\n",
"│ 1 │ Bitcoin │ BTC │ 39.549 K │ 43.672 B │ 6.670 │ -1.530 │ 6.660 │ 65.029 K │ -39.180 │\n",
"├────────┼─────────────────┼──────────┼──────────┼──────────────┼───────────────────┼─────────────────┼──────────────────┼─────────────┼────────────────┤\n",
"│ 2 │ Ethereum │ ETH │ 2.259 K │ 29.385 B │ 2.780 │ -1.790 │ 2.760 │ 4.365 K │ -48.250 │\n",
"├────────┼─────────────────┼──────────┼──────────┼──────────────┼───────────────────┼─────────────────┼──────────────────┼─────────────┼────────────────┤\n",
"│ 3 │ Tether │ USDT │ 1.001 │ 66.829 B │ 0.010 │ -0.050 │ -0.010 │ 1.215 │ -17.680 │\n",
"├────────┼─────────────────┼──────────┼──────────┼──────────────┼───────────────────┼─────────────────┼──────────────────┼─────────────┼────────────────┤\n",
"│ 4 │ Binance Coin │ BNB │ 309.702 │ 1.680 B │ 2.120 │ -1.210 │ 2.120 │ 690.568 │ -55.150 │\n",
"├────────┼─────────────────┼──────────┼──────────┼──────────────┼───────────────────┼─────────────────┼──────────────────┼─────────────┼────────────────┤\n",
"│ 5 │ Cardano │ ADA │ 1.265 │ 1.755 B │ 0.940 │ -1.600 │ 0.940 │ 2.465 │ -48.690 │\n",
"├────────┼─────────────────┼──────────┼──────────┼──────────────┼───────────────────┼─────────────────┼──────────────────┼─────────────┼────────────────┤\n",
"│ 6 │ HEX │ HEX │ 0.131 │ 29.577 M │ 8.350 │ -0.160 │ 8.350 │ 0.183 │ -28.830 │\n",
"├────────┼─────────────────┼──────────┼──────────┼──────────────┼───────────────────┼─────────────────┼──────────────────┼─────────────┼────────────────┤\n",
"│ 7 │ XRP │ XRP │ 0.634 │ 2.553 B │ 1.380 │ -1.280 │ 1.280 │ 3.842 │ -83.500 │\n",
"├────────┼─────────────────┼──────────┼──────────┼──────────────┼───────────────────┼─────────────────┼──────────────────┼─────────────┼────────────────┤\n",
"│ 8 │ Dogecoin │ DOGE │ 0.203 │ 1.576 B │ 0.630 │ -1.960 │ 0.620 │ 0.753 │ -73.100 │\n",
"├────────┼─────────────────┼──────────┼──────────┼──────────────┼───────────────────┼─────────────────┼──────────────────┼─────────────┼────────────────┤\n",
"│ 9 │ USD Coin │ USDC │ 0.999 │ 2.134 B │ -0.090 │ -0.110 │ -0.090 │ 1.906 │ -47.570 │\n",
"├────────┼─────────────────┼──────────┼──────────┼──────────────┼───────────────────┼─────────────────┼──────────────────┼─────────────┼────────────────┤\n",
"│ 10 │ Polkadot │ DOT │ 14.002 │ 562.910 M │ 2.370 │ -2.130 │ 2.370 │ 49.654 │ -71.800 │\n",
"├────────┼─────────────────┼──────────┼──────────┼──────────────┼───────────────────┼─────────────────┼──────────────────┼─────────────┼────────────────┤\n",
"│ 11 │ Uniswap │ UNI │ 18.580 │ 219.578 M │ 2.010 │ -1.880 │ 2.010 │ 45.013 │ -58.720 │\n",
"├────────┼─────────────────┼──────────┼──────────┼──────────────┼───────────────────┼─────────────────┼──────────────────┼─────────────┼────────────────┤\n",
"│ 12 │ Binance USD │ BUSD │ 1.000 │ 4.533 B │ 0.000 │ -0.120 │ 0.000 │ 1.176 │ -14.970 │\n",
"├────────┼─────────────────┼──────────┼──────────┼──────────────┼───────────────────┼─────────────────┼──────────────────┼─────────────┼────────────────┤\n",
"│ 13 │ Bitcoin Cash │ BCH │ 491.598 │ 1.197 B │ 3.370 │ -1.880 │ 3.370 │ 4.356 K │ -88.710 │\n",
"├────────┼─────────────────┼──────────┼──────────┼──────────────┼───────────────────┼─────────────────┼──────────────────┼─────────────┼────────────────┤\n",
"│ 14 │ Litecoin │ LTC │ 133.563 │ 1.498 B │ 3.770 │ -1.230 │ 3.760 │ 412.701 │ -67.640 │\n",
"├────────┼─────────────────┼──────────┼──────────┼──────────────┼───────────────────┼─────────────────┼──────────────────┼─────────────┼────────────────┤\n",
"│ 15 │ Wrapped Bitcoin │ WBTC │ 39.466 K │ 354.324 M │ 6.430 │ -1.420 │ 6.430 │ 64.767 K │ -39.060 │\n",
"╘════════╧═════════════════╧══════════╧══════════╧══════════════╧═══════════════════╧═════════════════╧══════════════════╧═════════════╧════════════════╛\n",
"\n"
]
}
],
"source": [
"cp.all_coins_market_info(['--vs','USD','-t','15'])"
]
},
{
"cell_type": "markdown",
"id": "recognized-affair",
"metadata": {},
"source": [
"## Top gainers in last 24h"
]
},
{
"cell_type": "code",
"execution_count": 53,
"id": "special-certification",
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"╒════════╤═══════════╤══════════════════════════╤═════════════╤═════════════════╤═══════════════╕\n",
"│ rank │ symbol │ name │ volume │ price │ %change_24h │\n",
"╞════════╪═══════════╪══════════════════════════╪═════════════╪═════════════════╪═══════════════╡\n",
"│ 1 │ CHAINCADE │ ChainCade │ $88,309 │ $0.000000001085 │ 126610638.36 │\n",
"├────────┼───────────┼──────────────────────────┼─────────────┼─────────────────┼───────────────┤\n",
"│ 2 │ ROY │ Royal Protocol │ $140,083 │ $0.008034386863 │ 5891.47 │\n",
"├────────┼───────────┼──────────────────────────┼─────────────┼─────────────────┼───────────────┤\n",
"│ 3 │ ARNX │ Aeron │ $78,472 │ $0.059652063727 │ 132.77 │\n",
"├────────┼───────────┼──────────────────────────┼─────────────┼─────────────────┼───────────────┤\n",
"│ 4 │ ZEON │ ZEON Network │ $477,770 │ $0.003586245340 │ 7.12 │\n",
"├────────┼───────────┼──────────────────────────┼─────────────┼─────────────────┼───────────────┤\n",
"│ 5 │ PLOCK │ PancakeLock │ $434,860 │ $0.071624961795 │ 4.67 │\n",
"├────────┼───────────┼──────────────────────────┼─────────────┼─────────────────┼───────────────┤\n",
"│ 6 │ MOONSTAR │ MoonStar │ $158,472 │ $0.000000009327 │ 2.78 │\n",
"├────────┼───────────┼──────────────────────────┼─────────────┼─────────────────┼───────────────┤\n",
"│ 7 │ USKITA │ American Akita │ $379,263 │ $0.000000000061 │ 2.58 │\n",
"├────────┼───────────┼──────────────────────────┼─────────────┼─────────────────┼───────────────┤\n",
"│ 8 │ EAURIC │ Eauric │ $211,248 │ $0.390925 │ 1.96 │\n",
"├────────┼───────────┼──────────────────────────┼─────────────┼─────────────────┼───────────────┤\n",
"│ 9 │ SPS │ Splinterlands │ $15,184,295 │ $0.744983 │ 1.71 │\n",
"├────────┼───────────┼──────────────────────────┼─────────────┼─────────────────┼───────────────┤\n",
"│ 10 │ MAHA │ MahaDAO │ $7,372,754 │ $4.33 │ 1.54 │\n",
"├────────┼───────────┼──────────────────────────┼─────────────┼─────────────────┼───────────────┤\n",
"│ 11 │ PCHS │ Peaches.Finance │ $1,060,110 │ $0.168152 │ 1.33 │\n",
"├────────┼───────────┼──────────────────────────┼─────────────┼─────────────────┼───────────────┤\n",
"│ 12 │ SKB │ Sakura Bloom │ $122,621 │ $0.000585072124 │ 1.23 │\n",
"├────────┼───────────┼──────────────────────────┼─────────────┼─────────────────┼───────────────┤\n",
"│ 13 │ MDOGE │ Miss Doge │ $1,108,696 │ $0.000000003080 │ 1.21 │\n",
"├────────┼───────────┼──────────────────────────┼─────────────┼─────────────────┼───────────────┤\n",
"│ 14 │ KCAKE │ KittyCake │ $856,836 │ $0.000082001532 │ 1.18 │\n",
"├────────┼───────────┼──────────────────────────┼─────────────┼─────────────────┼───────────────┤\n",
"│ 15 │ YEFIM │ Yearn Finance Management │ $62,559 │ $29.11 │ 1.13 │\n",
"╘════════╧═══════════╧══════════════════════════╧═════════════╧═════════════════╧═══════════════╛\n",
"\n"
]
}
],
"source": [
"cg.gainers(['-t','15','-p','24h'])"
]
},
{
"cell_type": "markdown",
"id": "473b49ae",
"metadata": {},
"source": [
"## Top losers in last 24h"
]
},
{
"cell_type": "code",
"execution_count": 54,
"id": "38e7f387",
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"╒════════╤══════════╤══════════════════╤════════════╤═════════════════╤═══════════════╕\n",
"│ rank │ symbol │ name │ volume │ price │ %change_24h │\n",
"╞════════╪══════════╪══════════════════╪════════════╪═════════════════╪═══════════════╡\n",
"│ 1 │ YELD │ PolyYeld Token │ $227,535 │ $0.000000967402 │ -1.00 │\n",
"├────────┼──────────┼──────────────────┼────────────┼─────────────────┼───────────────┤\n",
"│ 2 │ KRKN │ The Kraken │ $306,283 │ $0.000000278606 │ -0.94 │\n",
"├────────┼──────────┼──────────────────┼────────────┼─────────────────┼───────────────┤\n",
"│ 3 │ BABYLINK │ Baby Link │ $145,500 │ $0.000003830159 │ -0.86 │\n",
"├────────┼──────────┼──────────────────┼────────────┼─────────────────┼───────────────┤\n",
"│ 4 │ BCX │ BitcoinX │ $81,343 │ $0.000170614436 │ -0.83 │\n",
"├────────┼──────────┼──────────────────┼────────────┼─────────────────┼───────────────┤\n",
"│ 5 │ GOOD │ Good Token │ $68,348 │ $0.000000000299 │ -0.74 │\n",
"├────────┼──────────┼──────────────────┼────────────┼─────────────────┼───────────────┤\n",
"│ 6 │ BTCN │ Bitcoin Networks │ $283,411 │ $0.140120 │ -0.64 │\n",
"├────────┼──────────┼──────────────────┼────────────┼─────────────────┼───────────────┤\n",
"│ 7 │ CANU │ Cannumo │ $579,958 │ $0.022775377796 │ -0.62 │\n",
"├────────┼──────────┼──────────────────┼────────────┼─────────────────┼───────────────┤\n",
"│ 8 │ BTKC │ BeautyK │ $52,623 │ $0.000080164060 │ -0.60 │\n",
"├────────┼──────────┼──────────────────┼────────────┼─────────────────┼───────────────┤\n",
"│ 9 │ CXC │ CAPITAL X CELL │ $1,346,475 │ $0.091206664775 │ -0.56 │\n",
"├────────┼──────────┼──────────────────┼────────────┼─────────────────┼───────────────┤\n",
"│ 10 │ NBL │ Nobility │ $353,117 │ $0.000000005581 │ -0.49 │\n",
"├────────┼──────────┼──────────────────┼────────────┼─────────────────┼───────────────┤\n",
"│ 11 │ RAKUC │ Raku Coin │ $50,122 │ $0.000000201068 │ -0.49 │\n",
"├────────┼──────────┼──────────────────┼────────────┼─────────────────┼───────────────┤\n",
"│ 12 │ SMI │ SafeMoon Inu │ $245,489 │ $0.000001321023 │ -0.46 │\n",
"├────────┼──────────┼──────────────────┼────────────┼─────────────────┼───────────────┤\n",
"│ 13 │ BPLC │ BlackPearl Token │ $1,458,213 │ $0.000526796196 │ -0.45 │\n",
"├────────┼──────────┼──────────────────┼────────────┼─────────────────┼───────────────┤\n",
"│ 14 │ MOONRISE │ MoonRise │ $479,978 │ $0.000000005529 │ -0.45 │\n",
"├────────┼──────────┼──────────────────┼────────────┼─────────────────┼───────────────┤\n",
"│ 15 │ MMM │ MultiMillion │ $973,829 │ $0.071379603394 │ -0.45 │\n",
"╘════════╧══════════╧══════════════════╧════════════╧═════════════════╧═══════════════╛\n",
"\n"
]
}
],
"source": [
"cg.losers(['-t','15','-p','24h','-s','change'])"
]
},
{
"cell_type": "markdown",
"id": "5285e27d",
"metadata": {},
"source": [
"## Top coins with most positive sentiment"
]
},
{
"cell_type": "code",
"execution_count": 55,
"id": "0ae215bc",
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"╒════════╤═══════════════╤═════════════╤═════════════╕\n",
"│ rank │ name │ price_btc │ price_usd │\n",
"╞════════╪═══════════════╪═════════════╪═════════════╡\n",
"│ 1 │ Alien Worlds │ 0.00001 │ 0.31542 │\n",
"├────────┼───────────────┼─────────────┼─────────────┤\n",
"│ 2 │ SafeMoon │ 0.00000 │ 0.00000 │\n",
"├────────┼───────────────┼─────────────┼─────────────┤\n",
"│ 3 │ Dogecoin │ 0.00001 │ 0.20240 │\n",
"├────────┼───────────────┼─────────────┼─────────────┤\n",
"│ 4 │ Polkadot │ 0.00036 │ 14.00203 │\n",
"├────────┼───────────────┼─────────────┼─────────────┤\n",
"│ 5 │ Axie Infinity │ 0.00118 │ 46.31089 │\n",
"├────────┼───────────────┼─────────────┼─────────────┤\n",
"│ 6 │ ECOMI │ 0.00000 │ 0.00236 │\n",
"├────────┼───────────────┼─────────────┼─────────────┤\n",
"│ 7 │ Binance Coin │ 0.00784 │ 308.91765 │\n",
"├────────┼───────────────┼─────────────┼─────────────┤\n",
"│ 8 │ Chainlink │ 0.00048 │ 18.97941 │\n",
"├────────┼───────────────┼─────────────┼─────────────┤\n",
"│ 9 │ XRP │ 0.00002 │ 0.63359 │\n",
"├────────┼───────────────┼─────────────┼─────────────┤\n",
"│ 10 │ The Sandbox │ 0.00002 │ 0.69463 │\n",
"├────────┼───────────────┼─────────────┼─────────────┤\n",
"│ 11 │ Bitcoin │ 1.00000 │ 39378.00000 │\n",
"├────────┼───────────────┼─────────────┼─────────────┤\n",
"│ 12 │ PancakeSwap │ 0.00037 │ 14.59034 │\n",
"├────────┼───────────────┼─────────────┼─────────────┤\n",
"│ 13 │ Holo │ 0.00000 │ 0.00630 │\n",
"├────────┼───────────────┼─────────────┼─────────────┤\n",
"│ 14 │ Olympus │ 0.01469 │ 578.49865 │\n",
"├────────┼───────────────┼─────────────┼─────────────┤\n",
"│ 15 │ TRON │ 0.00000 │ 0.05985 │\n",
"╘════════╧═══════════════╧═════════════╧═════════════╛\n",
"\n"
]
}
],
"source": [
"cg.discover(category='positive_sentiment',other_args=['-t','15'])"
]
},
{
"cell_type": "markdown",
"id": "indoor-printing",
"metadata": {},
"source": [
"## Decentralized Finance Global Market Info"
]
},
{
"cell_type": "code",
"execution_count": 56,
"id": "consolidated-childhood",
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"╒═════════════════════════╤══════════════════╕\n",
"│ Metric │ Value │\n",
"╞═════════════════════════╪══════════════════╡\n",
"│ defi_market_cap │ 80188748794.7341 │\n",
"├─────────────────────────┼──────────────────┤\n",
"│ eth_market_cap │ 263525800480.865 │\n",
"├─────────────────────────┼──────────────────┤\n",
"│ defi_to_eth_ratio │ 30.4292 │\n",
"├─────────────────────────┼──────────────────┤\n",
"│ trading_volume_24h │ 6021053819.2862 │\n",
"├─────────────────────────┼──────────────────┤\n",
"│ defi_dominance │ 5.097 │\n",
"├─────────────────────────┼──────────────────┤\n",
"│ top_coin_name │ Uniswap │\n",
"├─────────────────────────┼──────────────────┤\n",
"│ top_coin_defi_dominance │ 12.0684 │\n",
"╘═════════════════════════╧══════════════════╛\n",
"\n"
]
}
],
"source": [
"cg.global_defi_info([])"
]
},
{
"cell_type": "markdown",
"id": "1aab8cf7",
"metadata": {},
"source": [
"## Top DeFi Coins"
]
},
{
"cell_type": "code",
"execution_count": 57,
"id": "minus-cross",
"metadata": {
"scrolled": false
},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"╒════════╤═════════════════════════╤══════════╤═════════════════╤═════════════╤══════════════╤═════════════╤════════════════╤════════════════╕\n",
"│ rank │ name │ symbol │ price │ change_1h │ change_24h │ change_7d │ volume_24h │ market_cap │\n",
"╞════════╪═════════════════════════╪══════════╪═════════════════╪═════════════╪══════════════╪═════════════╪════════════════╪════════════════╡\n",
"│ 1 │ Uniswap │ UNI │ $18.67 │ -1.2% │ 3.1% │ 27.5% │ $336,819,793 │ $9,697,119,454 │\n",
"├────────┼─────────────────────────┼──────────┼─────────────────┼─────────────┼──────────────┼─────────────┼────────────────┼────────────────┤\n",
"│ 2 │ Chainlink │ LINK │ $19.02 │ -1.9% │ 4.5% │ 37.1% │ $1,058,931,661 │ $8,416,382,830 │\n",
"├────────┼─────────────────────────┼──────────┼─────────────────┼─────────────┼──────────────┼─────────────┼────────────────┼────────────────┤\n",
"│ 3 │ Dai │ DAI │ $1.00 │ 0.2% │ 0.1% │ 0.2% │ $452,490,617 │ $5,359,567,026 │\n",
"├────────┼─────────────────────────┼──────────┼─────────────────┼─────────────┼──────────────┼─────────────┼────────────────┼────────────────┤\n",
"│ 4 │ cUSDC │ CUSDC │ $0.021936842456 │ -0.8% │ -0.7% │ -0.9% │ $55,538,113 │ $4,900,851,630 │\n",
"├────────┼─────────────────────────┼──────────┼─────────────────┼─────────────┼──────────────┼─────────────┼────────────────┼────────────────┤\n",
"│ 5 │ cDAI │ CDAI │ $0.021402984522 │ -0.8% │ -0.7% │ -0.9% │ $52,607,780 │ $4,412,695,487 │\n",
"├────────┼─────────────────────────┼──────────┼─────────────────┼─────────────┼──────────────┼─────────────┼────────────────┼────────────────┤\n",
"│ 6 │ Terra │ LUNA │ $9.28 │ -1.7% │ 10.8% │ 57.3% │ $427,602,810 │ $3,875,565,737 │\n",
"├────────┼─────────────────────────┼──────────┼─────────────────┼─────────────┼──────────────┼─────────────┼────────────────┼────────────────┤\n",
"│ 7 │ Aave │ AAVE │ $294.77 │ -2.1% │ -0.7% │ 31.1% │ $445,809,646 │ $3,814,261,645 │\n",
"├────────┼─────────────────────────┼──────────┼─────────────────┼─────────────┼──────────────┼─────────────┼────────────────┼────────────────┤\n",
"│ 8 │ cETH │ CETH │ $45.27 │ -1.6% │ 2.8% │ 26.2% │ $62,720,415 │ $3,398,229,321 │\n",
"├────────┼─────────────────────────┼──────────┼─────────────────┼─────────────┼──────────────┼─────────────┼────────────────┼────────────────┤\n",
"│ 9 │ Amp │ AMP │ $0.069020796815 │ -0.2% │ 3.5% │ 71.8% │ $76,857,770 │ $3,344,229,383 │\n",
"├────────┼─────────────────────────┼──────────┼─────────────────┼─────────────┼──────────────┼─────────────┼────────────────┼────────────────┤\n",
"│ 10 │ PancakeSwap │ CAKE │ $14.62 │ -1.6% │ 3.4% │ 29.2% │ $163,177,275 │ $2,952,351,704 │\n",
"├────────┼─────────────────────────┼──────────┼─────────────────┼─────────────┼──────────────┼─────────────┼────────────────┼────────────────┤\n",
"│ 11 │ The Graph │ GRT │ $0.554710 │ -1.7% │ 2.1% │ 11.8% │ $101,628,360 │ $2,615,805,754 │\n",
"├────────┼─────────────────────────┼──────────┼─────────────────┼─────────────┼──────────────┼─────────────┼────────────────┼────────────────┤\n",
"│ 12 │ Maker │ MKR │ $2,624.68 │ -1.9% │ 2.8% │ 19.1% │ $61,012,827 │ $2,365,601,287 │\n",
"├────────┼─────────────────────────┼──────────┼─────────────────┼─────────────┼──────────────┼─────────────┼────────────────┼────────────────┤\n",
"│ 13 │ Compound │ COMP │ $385.32 │ -1.9% │ 0.4% │ 9.6% │ $189,874,743 │ $2,086,008,904 │\n",
"├────────┼─────────────────────────┼──────────┼─────────────────┼─────────────┼──────────────┼─────────────┼────────────────┼────────────────┤\n",
"│ 14 │ Sushi │ SUSHI │ $8.15 │ -1.8% │ 0.3% │ 28.2% │ $363,400,421 │ $1,573,351,512 │\n",
"├────────┼─────────────────────────┼──────────┼─────────────────┼─────────────┼──────────────┼─────────────┼────────────────┼────────────────┤\n",
"│ 15 │ Synthetix Network Token │ SNX │ $9.13 │ -0.9% │ 1.5% │ 19.5% │ $118,902,952 │ $1,537,829,844 │\n",
"╘════════╧═════════════════════════╧══════════╧═════════════════╧═════════════╧══════════════╧═════════════╧════════════════╧════════════════╛\n",
"\n"
]
}
],
"source": [
"cg.top_defi_coins([\"-t\", \"15\"])"
]
},
{
"cell_type": "markdown",
"id": "d5431bb2",
"metadata": {},
"source": [
"## Top Decentralized Exchanges"
]
},
{
"cell_type": "code",
"execution_count": 58,
"id": "0adedc11",
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"╒════════╤════════════════════════════════╤══════════════╤═══════════╤═══════════╤══════════════╤═══════════════╤═══════════════════════╕\n",
"│ rank │ name │ volume_24h │ n_coins │ n_pairs │ visits │ most_traded │ market_share_by_vol │\n",
"╞════════╪════════════════════════════════╪══════════════╪═══════════╪═══════════╪══════════════╪═══════════════╪═══════════════════════╡\n",
"│ 1 │ Uniswap (v3) Decentralized │ ₿24096.25 │ 424 │ 937 │ 6,548,008.0 │ USDC/ETH │ 21.1% │\n",
"├────────┼────────────────────────────────┼──────────────┼───────────┼───────────┼──────────────┼───────────────┼───────────────────────┤\n",
"│ 2 │ PancakeSwap (v2) Decentralized │ ₿14823.58 │ 1624 │ 12041 │ 17,937,079.0 │ WBNB/BUSD │ 13.0% │\n",
"├────────┼────────────────────────────────┼──────────────┼───────────┼───────────┼──────────────┼───────────────┼───────────────────────┤\n",
"│ 3 │ Mdex Decentralized │ ₿9937.71 │ 66 │ 998 │ 283,519.0 │ HETH/HT │ 8.7% │\n",
"├────────┼────────────────────────────────┼──────────────┼───────────┼───────────┼──────────────┼───────────────┼───────────────────────┤\n",
"│ 4 │ 1inch Decentralized │ ₿9350.79 │ 299 │ 310 │ 380,027.0 │ USDC/ETH │ 8.2% │\n",
"├────────┼────────────────────────────────┼──────────────┼───────────┼───────────┼──────────────┼───────────────┼───────────────────────┤\n",
"│ 5 │ Uniswap (v2) Decentralized │ ₿8776.89 │ 2296 │ 2673 │ 6,548,008.0 │ USDC/ETH │ 7.7% │\n",
"├────────┼────────────────────────────────┼──────────────┼───────────┼───────────┼──────────────┼───────────────┼───────────────────────┤\n",
"│ 6 │ Mdex BSC Decentralized │ ₿7603.02 │ 91 │ 909 │ 331,145.0 │ USDT/0XBB4 │ 6.7% │\n",
"├────────┼────────────────────────────────┼──────────────┼───────────┼───────────┼──────────────┼───────────────┼───────────────────────┤\n",
"│ 7 │ Sushiswap Decentralized │ ₿5712.11 │ 471 │ 574 │ 249,486.0 │ USDC/ETH │ 5.0% │\n",
"├────────┼────────────────────────────────┼──────────────┼───────────┼───────────┼──────────────┼───────────────┼───────────────────────┤\n",
"│ 8 │ Compound Finance Decentralized │ ₿5566.35 │ 11 │ 13 │ 480,000.0 │ CETH/ETH │ 4.9% │\n",
"├────────┼────────────────────────────────┼──────────────┼───────────┼───────────┼──────────────┼───────────────┼───────────────────────┤\n",
"│ 9 │ Curve Finance Decentralized │ ₿3174.22 │ 23 │ 67 │ 1,073,791.0 │ DAI/USDT │ 2.8% │\n",
"├────────┼────────────────────────────────┼──────────────┼───────────┼───────────┼──────────────┼───────────────┼───────────────────────┤\n",
"│ 10 │ Swop.Fi Decentralized │ ₿3004.95 │ 16 │ 25 │ 113,232.0 │ EGG/USDN │ 2.6% │\n",
"╘════════╧════════════════════════════════╧══════════════╧═══════════╧═══════════╧══════════════╧═══════════════╧═══════════════════════╛\n",
"\n"
]
}
],
"source": [
"cg.top_dex([\"-t\", \"10\"])"
]
},
{
"cell_type": "markdown",
"id": "8d92faa0",
"metadata": {},
"source": [
"## Top Yield Farms"
]
},
{
"cell_type": "code",
"execution_count": 59,
"id": "1e386cf8",
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"╒════════╤═════════════════════╤═════════════════════════╤═══════════════════════════╤══════════════╤═══════════════════╤═══════════════╕\n",
"│ rank │ name │ pool │ audits │ collateral │ value_locked │ return_year │\n",
"╞════════╪═════════════════════╪═════════════════════════╪═══════════════════════════╪══════════════╪═══════════════════╪═══════════════╡\n",
"│ 1 │ Sushi (SUSHI) │ BitCorn WBTC/WETH │ │ WBTC, WETH │ $1,345,793,781.17 │ 19.05% │\n",
"├────────┼─────────────────────┼─────────────────────────┼───────────────────────────┼──────────────┼───────────────────┼───────────────┤\n",
"│ 2 │ Venus (XVS) │ BTC │ Certik │ BTC │ $755,556,746.88 │ 1.59% │\n",
"├────────┼─────────────────────┼─────────────────────────┼───────────────────────────┼──────────────┼───────────────────┼───────────────┤\n",
"│ 3 │ Venus (XVS) │ ETH │ Certik │ ETH │ $536,762,984.18 │ 1.26% │\n",
"├────────┼─────────────────────┼─────────────────────────┼───────────────────────────┼──────────────┼───────────────────┼───────────────┤\n",
"│ 4 │ Sushi (SUSHI) │ Circle Snail USDC/WETH │ │ USDC, WETH │ $424,693,805.65 │ 38.00% │\n",
"├────────┼─────────────────────┼─────────────────────────┼───────────────────────────┼──────────────┼───────────────────┼───────────────┤\n",
"│ 5 │ Aave (AAVE) │ AAVE/WETH │ Consensys Diligence, Open │ AAVE, WETH │ $401,375,375.57 │ 14.95% │\n",
"│ │ │ │ Zeppelin, Trail of Bits │ │ │ │\n",
"├────────┼─────────────────────┼─────────────────────────┼───────────────────────────┼──────────────┼───────────────────┼───────────────┤\n",
"│ 6 │ Sushi (SUSHI) │ Donald Dai DAI/WETH │ │ DAI, WETH │ $392,520,925.31 │ 58.33% │\n",
"├────────┼─────────────────────┼─────────────────────────┼───────────────────────────┼──────────────┼───────────────────┼───────────────┤\n",
"│ 7 │ Sushi (SUSHI) │ Onsen SUSHI/WETH │ │ SUSHI, WETH │ $310,819,004.49 │ 79.64% │\n",
"├────────┼─────────────────────┼─────────────────────────┼───────────────────────────┼──────────────┼───────────────────┼───────────────┤\n",
"│ 8 │ Venus (XVS) │ BNB │ Certik │ BNB │ $284,936,100.58 │ 9.74% │\n",
"├────────┼─────────────────────┼─────────────────────────┼───────────────────────────┼──────────────┼───────────────────┼───────────────┤\n",
"│ 9 │ Venus (XVS) │ USDT │ Certik │ USDT │ $281,277,975.73 │ 4.41% │\n",
"├────────┼─────────────────────┼─────────────────────────┼───────────────────────────┼──────────────┼───────────────────┼───────────────┤\n",
"│ 10 │ Sushi (SUSHI) │ Tether Turtle WETH/USDT │ │ WETH, USDT │ $276,597,029.56 │ 46.78% │\n",
"├────────┼─────────────────────┼─────────────────────────┼───────────────────────────┼──────────────┼───────────────────┼───────────────┤\n",
"│ 11 │ Auto (AUTO) │ CAKE │ Vidar │ CAKE │ $242,882,119.26 │ 210.92% │\n",
"├────────┼─────────────────────┼─────────────────────────┼───────────────────────────┼──────────────┼───────────────────┼───────────────┤\n",
"│ 12 │ Venus (XVS) │ BUSD │ Certik │ BUSD │ $216,434,413.04 │ 5.13% │\n",
"├────────┼─────────────────────┼─────────────────────────┼───────────────────────────┼──────────────┼───────────────────┼───────────────┤\n",
"│ 13 │ Badger DAO (BADGER) │ WBTC/WETH │ Zokyo │ WBTC, WETH │ $186,477,265.08 │ 28.59% │\n",
"├────────┼─────────────────────┼─────────────────────────┼───────────────────────────┼──────────────┼───────────────────┼───────────────┤\n",
"│ 14 │ Venus (XVS) │ USDC │ Certik │ USDC │ $183,816,552.79 │ 4.29% │\n",
"├────────┼─────────────────────┼─────────────────────────┼───────────────────────────┼──────────────┼───────────────────┼───────────────┤\n",
"│ 15 │ Badger DAO (BADGER) │ BADGER │ Zokyo │ BADGER │ $182,722,108.09 │ 8.18% │\n",
"╘════════╧═════════════════════╧═════════════════════════╧═══════════════════════════╧══════════════╧═══════════════════╧═══════════════╛\n",
"\n"
]
}
],
"source": [
"cg.yfarms(['-t','15'])"
]
},
{
"cell_type": "code",
"execution_count": 60,
"id": "central-jacob",
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"This application is used to convert notebook files (*.ipynb) to various other\n",
"formats.\n",
"\n",
"WARNING: THE COMMANDLINE INTERFACE MAY CHANGE IN FUTURE RELEASES.\n",
"\n",
"Options\n",
"\n",
"-------\n",
"\n",
"\n",
"\n",
"Arguments that take values are actually convenience aliases to full\n",
"Configurables, whose aliases are listed on the help line. For more information\n",
"on full configurables, see '--help-all'.\n",
"\n",
"\n",
"--debug\n",
"\n",
" set log level to logging.DEBUG (maximize logging output)\n",
"\n",
"--generate-config\n",
"\n",
" generate default config file\n",
"\n",
"-y\n",
"\n"
]
},
{
"name": "stderr",
"output_type": "stream",
"text": [
"[NbConvertApp] WARNING | pattern 'notebooks/reports/20210728_090022_crypto_market_ovierview.ipynb' matched no files\n"
]
},
{
"name": "stdout",
"output_type": "stream",
"text": [
" Answer yes to any questions instead of prompting.\n",
"\n",
"--execute\n",
"\n",
" Execute the notebook prior to export.\n",
"\n",
"--allow-errors\n",
"\n",
" Continue notebook execution even if one of the cells throws an error and include the error message in the cell output (the default behaviour is to abort conversion). This flag is only relevant if '--execute' was specified, too.\n",
"\n",
"--stdin\n",
"\n",
" read a single notebook file from stdin. Write the resulting notebook with default basename 'notebook.*'\n",
"\n",
"--stdout\n",
"\n",
" Write notebook output to stdout instead of files.\n",
"\n",
"--inplace\n",
"\n",
" Run nbconvert in place, overwriting the existing notebook (only \n",
" relevant when converting to notebook format)\n",
"\n",
"--clear-output\n",
"\n",
" Clear output of current file and save in place, \n",
" overwriting the existing notebook.\n",
"\n",
"--no-prompt\n",
"\n",
" Exclude input and output prompts from converted document.\n",
"\n",
"--no-input\n",
"\n",
" Exclude input cells and output prompts from converted document. \n",
" This mode is ideal for generating code-free reports.\n",
"\n",
"--allow-chromium-download\n",
"\n",
" Whether to allow downloading chromium if no suitable version is found on the system.\n",
"--log-level=<Enum> (Application.log_level)\n",
"\n",
" Default: 30\n",
"\n",
" Choices: (0, 10, 20, 30, 40, 50, 'DEBUG', 'INFO', 'WARN', 'ERROR', 'CRITICAL')\n",
"\n",
" Set the log level by value or name.\n",
"\n",
"--config=<Unicode> (JupyterApp.config_file)\n",
"\n",
" Default: ''\n",
"\n",
" Full path of a config file.\n",
"\n",
"--to=<Unicode> (NbConvertApp.export_format)\n",
"\n",
" Default: ''\n",
"\n",
" The export format to be used, either one of the built-in formats\n",
"\n",
" ['asciidoc', 'custom', 'html', 'latex', 'markdown', 'notebook', 'pdf',\n",
"\n",
" 'python', 'rst', 'script', 'slides', 'webpdf'] or a dotted object name that\n",
"\n",
" represents the import path for an `Exporter` class\n",
"\n",
"--template=<Unicode> (TemplateExporter.template_name)\n",
"\n",
" Default: ''\n",
"\n",
" Name of the template to use\n",
"\n",
"--template-file=<Unicode> (TemplateExporter.template_file)\n",
"\n",
" Default: None\n",
"\n",
" Name of the template file to use\n",
"\n",
"--writer=<DottedObjectName> (NbConvertApp.writer_class)\n",
"\n",
" Default: 'FilesWriter'\n",
"\n",
" Writer class used to write the results of the conversion\n",
"\n",
"--post=<DottedOrNone> (NbConvertApp.postprocessor_class)\n",
"\n",
" Default: ''\n",
"\n",
" PostProcessor class used to write the results of the conversion\n",
"\n",
"--output=<Unicode> (NbConvertApp.output_base)\n",
"\n",
" Default: ''\n",
"\n",
" overwrite base name use for output files. can only be used when converting\n",
"\n",
" one notebook at a time.\n",
"\n",
"--output-dir=<Unicode> (FilesWriter.build_directory)\n",
"\n",
" Default: ''\n",
"\n",
" Directory to write output(s) to. Defaults to output to the directory of each\n",
"\n",
" notebook. To recover previous default behaviour (outputting to the current\n",
"\n",
" working directory) use . as the flag value.\n",
"\n",
"--reveal-prefix=<Unicode> (SlidesExporter.reveal_url_prefix)\n",
"\n",
" Default: ''\n",
"\n",
" The URL prefix for reveal.js (version 3.x). This defaults to the reveal CDN,\n",
"\n",
" but can be any url pointing to a copy of reveal.js.\n",
"\n",
" For speaker notes to work, this must be a relative path to a local copy of\n",
"\n",
" reveal.js: e.g., \"reveal.js\".\n",
"\n",
" If a relative path is given, it must be a subdirectory of the current\n",
"\n",
" directory (from which the server is run).\n",
"\n",
" See the usage documentation\n",
"\n",
" (https://nbconvert.readthedocs.io/en/latest/usage.html#reveal-js-html-\n",
"\n",
" slideshow) for more details.\n",
"\n",
"--nbformat=<Enum> (NotebookExporter.nbformat_version)\n",
"\n",
" Default: 4\n",
"\n",
" Choices: [1, 2, 3, 4]\n",
"\n",
" The nbformat version to write. Use this to downgrade notebooks.\n",
"\n",
"To see all available configurables, use `--help-all`\n",
"\n",
"Examples\n",
"--------\n",
"\n",
" The simplest way to use nbconvert is\n",
" \n",
" > jupyter nbconvert mynotebook.ipynb --to html\n",
" \n",
" Options include ['asciidoc', 'custom', 'html', 'latex', 'markdown', 'notebook', 'pdf', 'python', 'rst', 'script', 'slides', 'webpdf'].\n",
" \n",
" > jupyter nbconvert --to latex mynotebook.ipynb\n",
" \n",
" Both HTML and LaTeX support multiple output templates. LaTeX includes\n",
" 'base', 'article' and 'report'. HTML includes 'basic' and 'full'. You\n",
" can specify the flavor of the format used.\n",
" \n",
" > jupyter nbconvert --to html --template lab mynotebook.ipynb\n",
" \n",
" You can also pipe the output to stdout, rather than a file\n",
" \n",
" > jupyter nbconvert mynotebook.ipynb --stdout\n",
" \n",
" PDF is generated via latex\n",
" \n",
" > jupyter nbconvert mynotebook.ipynb --to pdf\n",
" \n",
" You can get (and serve) a Reveal.js-powered slideshow\n",
" \n",
" > jupyter nbconvert myslides.ipynb --to slides --post serve\n",
" \n",
" Multiple notebooks can be given at the command line in a couple of \n",
" different ways:\n",
" \n",
" > jupyter nbconvert notebook*.ipynb\n",
" > jupyter nbconvert notebook1.ipynb notebook2.ipynb\n",
" \n",
" or you can specify the notebooks list in a config file, containing::\n",
" \n",
" c.NbConvertApp.notebooks = [\"my_notebook.ipynb\"]\n",
" \n",
" > jupyter nbconvert --config mycfg.py\n",
"\n"
]
}
],
"source": [
"!jupyter nbconvert {os.path.join(\"notebooks\", \"reports\", report_name + \".ipynb\")} --to html --no-input"
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "957a30c6",
"metadata": {},
"outputs": [],
"source": []
}
],
"metadata": {
"celltoolbar": "Tags",
"kernelspec": {
"display_name": "Python 3",
"language": "python",
"name": "python3"
},
"language_info": {
"codemirror_mode": {
"name": "ipython",
"version": 3
},
"file_extension": ".py",
"mimetype": "text/x-python",
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.8.10"
}
},
"nbformat": 4,
"nbformat_minor": 5
}

View File

@@ -34,8 +34,7 @@
"outputs": [],
"source": [
"ticker=\"AMC\"\n",
"report_name=f\"{ticker.upper()}_{datetime.now().strftime('%Y%m%d_%H%M%S')}_dark_pool\"\n",
"base_path=os.path.abspath(os.path.join('.'))"
"report_name=f\"{ticker.upper()}_dark_pool_{datetime.now().strftime('%Y%m%d_%H%M%S')}\""
]
},
{
@@ -45,7 +44,7 @@
"metadata": {},
"outputs": [],
"source": [
"display(Markdown(f\"# {datetime.now().strftime('%Y/%m/%d %H:%M:%S')} - {ticker.upper()} - Dark Pool\"))"
"display(Markdown(f\"# {ticker.upper()} - Dark Pool - {datetime.now().strftime('%Y/%m/%d %H:%M:%S')}\"))"
]
},
{

View File

@@ -34,7 +34,7 @@
"outputs": [],
"source": [
"ticker=\"GME\"\n",
"report_name=f\"{ticker.upper()}_{datetime.now().strftime('%Y%m%d_%H%M%S')}_due_diligence\"\n",
"report_name=f\"{ticker.upper()}_due_diligence_{datetime.now().strftime('%Y%m%d_%H%M%S')}\"\n",
"base_path=os.path.abspath(os.path.join('.'))"
]
},
@@ -45,7 +45,7 @@
"metadata": {},
"outputs": [],
"source": [
"display(Markdown(f\"# {datetime.now().strftime('%Y/%m/%d %H:%M:%S')} - {ticker.upper()} - Due Diligence\"))"
"display(Markdown(f\"# {ticker.upper()} - Due Diligence - {datetime.now().strftime('%Y/%m/%d %H:%M:%S')}\"))"
]
},
{

View File

@@ -32,7 +32,7 @@
},
"outputs": [],
"source": [
"report_name=f\"econ_{datetime.now().strftime('%Y%m%d_%H%M%S')}\"\n",
"report_name=f\"economy_data_{datetime.now().strftime('%Y%m%d_%H%M%S')}\"\n",
"base_path=os.path.abspath(os.path.join('../..'))"
]
},
@@ -43,7 +43,7 @@
"metadata": {},
"outputs": [],
"source": [
"display(Markdown(f\"# {datetime.now().strftime('%Y/%m/%d %H:%M:%S')} - Economy\"))"
"display(Markdown(f\"# Economy Data - {datetime.now().strftime('%Y/%m/%d %H:%M:%S')}\"))"
]
},
{