From 930ae8592669af0089b9851b5cda9a9624adb709 Mon Sep 17 00:00:00 2001 From: Michael Feng Date: Thu, 27 Apr 2023 10:15:03 -0500 Subject: [PATCH 1/2] cleaned up gitignore and edited readme --- .gitignore | 136 +----------------- README.md | 56 +++++--- .../3_\360\237\247\231_XE_Token_Analyzer.py" | 0 .../7_\360\237\223\213_Data.py" | 0 4 files changed, 37 insertions(+), 155 deletions(-) rename "pages/7_\360\237\247\231_XE_Token_Analyzer.py" => "pages/3_\360\237\247\231_XE_Token_Analyzer.py" (100%) rename "pages/3_\360\237\223\213_Data.py" => "pages/7_\360\237\223\213_Data.py" (100%) diff --git a/.gitignore b/.gitignore index 690dcd4d..5b9412f0 100644 --- a/.gitignore +++ b/.gitignore @@ -1,134 +1,6 @@ # Byte-compiled / optimized / DLL files -__pycache__/ -*.py[cod] -*$py.class +**/__pycache__/ -# C extensions -*. - -*.ipynb - -secrets.toml -.idea/* - -# Distribution / packaging -.Python -build/ -develop-eggs/ -dist/ -downloads/ -eggs/ -.eggs/ -lib/ -lib64/ -parts/ -sdist/ -var/ -wheels/ -pip-wheel-metadata/ -share/python-wheels/ -*.egg-info/ -.installed.cfg -*.egg -MANIFEST - -# PyInstaller -# Usually these files are written by a python script from a template -# before PyInstaller builds the exe, so as to inject date/other infos into it. -*.manifest -*.spec - -# Installer logs -pip-log.txt -pip-delete-this-directory.txt - -# Unit test / coverage reports -htmlcov/ -.tox/ -.nox/ -.coverage -.coverage.* -.cache -nosetests.xml -coverage.xml -*.cover -*.py,cover -.hypothesis/ -.pytest_cache/ - -# Translations -*.mo -*.pot - -# Django stuff: -*.log -local_settings.py -db.sqlite3 -db.sqlite3-journal - -# Flask stuff: -instance/ -.webassets-cache - -# Scrapy stuff: -.scrapy - -# Sphinx documentation -docs/_build/ - -# PyBuilder -target/ - -# Jupyter Notebook -.ipynb_checkpoints - -# IPython -profile_default/ -ipython_config.py - -# pyenv -.python-version - -# pipenv -# According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control. -# However, in case of collaboration, if having platform-specific dependencies or dependencies -# having no cross-platform support, pipenv may install dependencies that don't work, or not -# install all needed dependencies. -#Pipfile.lock - -# PEP 582; used by e.g. github.com/David-OConnor/pyflow -__pypackages__/ - -# Celery stuff -celerybeat-schedule -celerybeat.pid - -# SageMath parsed files -*.sage.py - -# Environments -.env -.venv -env/ -venv/ -ENV/ -env.bak/ -venv.bak/ - -# Spyder project settings -.spyderproject -.spyproject - -# Rope project settings -.ropeproject - -# mkdocs documentation -/site - -# mypy -.mypy_cache/ -.dmypy.json -dmypy.json - -# Pyre type checker -.pyre/ +# DB files +/data +**/*.sqlite \ No newline at end of file diff --git a/README.md b/README.md index 81a267e1..a093c184 100644 --- a/README.md +++ b/README.md @@ -1,68 +1,78 @@ -# Hummingbot StreamLit Apps +# Hummingbot Dashboards -Collection of Hummingbot-related data apps and dashboards, built using [StreamLit](https://streamlit.io/). +Collection of Hummingbot-related dashboards, built using [StreamLit](https://streamlit.io/). This repository is maintained by Hummingbot Foundation as a companion for users of [Hummingbot](https://github.com/hummingbot/hummingbot), the open source framework for building high-frequency crypto trading bots. -### Getting Started Video - +Watch this video to understand how it works: https://www.loom.com/share/72d05bcbaf4048a399e3f9247d756a63 -### Deployed Apps - +See an example of a live, deployed dashboard: https://hummingbot-streamlit-apps-main-jnja50.streamlit.app -## Current Data Apps +## Dashboards -Here are the current data apps in the collection: +Here are the current dashboards in the collection: -### XE Token Analyzer +### 🚀 Strategy Performance (WIP) -Visualize the bid-ask spread and volume of different tokens across the crypto exchange landscape. This app is most helpful for Hummingbot users running the [Cross-Exchange Market Making](https://hummingbot.org/strategies/cross-exchange-market-making/) and [Arbitrage](https://hummingbot.org/strategies/arbitrage/) strategies. +Dashboard that helps you analyze the performance of a running Hummingbot instance -### Hummingbot DB +### 🧙 XE Token Analyzer -Drop a SQLite trades file for a specific strategy configuration, so that you can inspect and analyze the trade data. +Dashboard that helps you visualize the bid-ask spread and volume of different tokens across the crypto exchange landscape. -### TVL vs MCAP Analysis +This app is most helpful for Hummingbot users running the [Cross-Exchange Market Making](https://hummingbot.org/strategies/cross-exchange-market-making/) and [Arbitrage](https://hummingbot.org/strategies/arbitrage/) strategies. -Easily compare various DeFi protocols based on their market capitalization and total value locked, using DeFiLlama data. +### 🧳 Hummingbot DB + +Inspect and analyze the orders and trades data contained in a SQLite database for a strategy or script. -**How to find**: These files are located in the `/data` folder in Hummingbot, and are named `.sqlite`. +These files are located in the `/data` folder in Hummingbot, and are named `.sqlite`. + +### 🦉 TVL vs MCAP Analysis + +Easily compare various DeFi protocols based on their market capitalization and total value locked, using DeFiLlama data. -### Data +### 📋 Data Reference data for the various apps this collection. ## Installation -1. Install Anaconda or Miniconda +1. Install [Anaconda](https://www.anaconda.com/) or [Miniconda](https://docs.conda.io/en/latest/miniconda.html) 2. Clone this repo and navigate to the created directory -``` +```bash git clone https://github.com/hummingbot/streamlit-apps.git cd streamlit-apps ``` 3. Run this command to create a `conda` environment and install dependencies -``` +```bash conda env create -f environment.yml ``` 4. Activate the environment -``` +```bash conda activate streamlit-apps ``` 5. Run the app -``` +```bash streamlit run main.py ``` -For more info, see instructions located at https://docs.streamlit.io/library/get-started/installation. +6. Create a symlink to your Hummingbot `/data` directory +```bash +# replace `/path/to/hummingbot` with the actual path +ln -s /path/to/hummingbot/data data +``` + +For more info about Streamlit installation, see the instructions located at https://docs.streamlit.io/library/get-started/installation. ## Contributions We welcome new data apps, bug fixes, and improvements by the community! -To submit a contribution, issue a pull request and follow the general guidelines listed at https://hummingbot.org/developers/contributions. +To submit a contribution, issue a pull request, following the guidelines listed at https://hummingbot.org/developers/contributions. diff --git "a/pages/7_\360\237\247\231_XE_Token_Analyzer.py" "b/pages/3_\360\237\247\231_XE_Token_Analyzer.py" similarity index 100% rename from "pages/7_\360\237\247\231_XE_Token_Analyzer.py" rename to "pages/3_\360\237\247\231_XE_Token_Analyzer.py" diff --git "a/pages/3_\360\237\223\213_Data.py" "b/pages/7_\360\237\223\213_Data.py" similarity index 100% rename from "pages/3_\360\237\223\213_Data.py" rename to "pages/7_\360\237\223\213_Data.py" From c482b15a2d68cc4b06fac0a87a5545e63bc146c3 Mon Sep 17 00:00:00 2001 From: Michael Feng Date: Thu, 27 Apr 2023 12:09:52 -0500 Subject: [PATCH 2/2] change default interval to 1m --- "pages/2_\360\237\232\200_Strategy_Performance.py" | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git "a/pages/2_\360\237\232\200_Strategy_Performance.py" "b/pages/2_\360\237\232\200_Strategy_Performance.py" index 489c8456..6ffda160 100644 --- "a/pages/2_\360\237\232\200_Strategy_Performance.py" +++ "b/pages/2_\360\237\232\200_Strategy_Performance.py" @@ -74,7 +74,7 @@ def get_ohlc(trading_pair: str, exchange: str, interval: str, start_timestamp: i c1, c2 = st.columns([1, 5]) with c1: - interval = st.selectbox("Candles Interval:", intervals.keys(), index=3) + interval = st.selectbox("Candles Interval:", intervals.keys(), index=0) date_array = pd.date_range(start=strategy_data.start_time, end=strategy_data.end_time, periods=60) ohlc_extra_time = 60