[go: nahoru, domu]

Skip to content

Commit

Permalink
Merge branch 'development' into doc/fix_image_himalaya
Browse files Browse the repository at this point in the history
  • Loading branch information
aarmoa authored Jun 23, 2021
2 parents d90eeb8 + e05eacc commit 6828dca
Show file tree
Hide file tree
Showing 411 changed files with 11,762 additions and 5,633 deletions.
17 changes: 17 additions & 0 deletions .coveragerc
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
[run]
source_pkgs = hummingbot
omit = hummingbot/connector/*
dynamic_context = test_function
branch = true

[report]
fail_under = 39
precision = 2
skip_empty = true

[html]
directory = coverage_html_report
show_contexts = true

[xml]
output = coverage.xml
33 changes: 27 additions & 6 deletions .github/workflows/workflow.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@ name: ci

on:
push:
branches: [ master, development ]
branches: [ master, development, 'refactor/unit_tests**' ]
pull_request:
branches: [ master, development ]
branches: [ master, development, refactor/unit_tests ]
types: [ready_for_review, opened, synchronize, reopened]

jobs:
Expand All @@ -15,6 +15,8 @@ jobs:

steps:
- uses: actions/checkout@v2
with:
fetch-depth: 0

# Use cache's hashFiles function to check for changes in core code
- name: Check for code changes
Expand Down Expand Up @@ -87,20 +89,39 @@ jobs:
- name: Compile Hummingbot
shell: bash
if: steps.program-changes.outputs.cache-hit != 'true' || steps.conda-dependencies.outputs.cache-hit != 'true'
env:
WITHOUT_CYTHON_OPTIMIZATIONS: true
run: |
source /usr/share/miniconda/etc/profile.d/conda.sh
conda info --envs
conda activate hummingbot
conda env export
./compile
- name: Run stable tests
- name: Run stable tests and calculate coverage
if: steps.program-changes.outputs.cache-hit != 'true' || steps.conda-dependencies.outputs.cache-hit != 'true'
shell: bash
run: |
source /usr/share/miniconda/etc/profile.d/conda.sh
conda activate hummingbot
nosetests -d -v test/test*.py
coverage run -m nose test.hummingbot
- name: Check and report global coverage
if: steps.program-changes.outputs.cache-hit != 'true' || steps.conda-dependencies.outputs.cache-hit != 'true'
shell: bash
run: |
source /usr/share/miniconda/etc/profile.d/conda.sh
conda activate hummingbot
coverage report
- name: Validate coverage for the changes
if: github.event_name == 'pull_request' && (steps.program-changes.outputs.cache-hit != 'true' || steps.conda-dependencies.outputs.cache-hit != 'true')
shell: bash
run: |
source /usr/share/miniconda/etc/profile.d/conda.sh
conda activate hummingbot
git fetch --all -q
git checkout -b $GITHUB_SHA
coverage xml
diff-cover --compare-branch=origin/$GITHUB_BASE_REF --fail-under=50 coverage.xml
# Notify results to discord
- uses: actions/setup-ruby@v1
- name: Send Webhook Notification
Expand All @@ -113,4 +134,4 @@ jobs:
run: |
git clone --depth 1 https://github.com/DiscordHooks/github-actions-discord-webhook.git webhook
bash webhook/send.sh $JOB_STATUS $WEBHOOK_URL
shell: bash
shell: bash
6 changes: 6 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -67,3 +67,9 @@ debug.log
/certs
*.pem
gateway.env

# Coverage
.coverage
/cover/
/coverage_html_report/
coverage.xml
4 changes: 1 addition & 3 deletions DATA_COLLECTION.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,7 @@ Users who provide data allow us to more easily diagnose problems, troubleshoot,

## Types of data collected

Hummingbot can collect error logs and report them to CoinAlpha.
Hummingbot can collect aggregate trade data including volume totals, order count, trade count (not individual trades), tokens traded (base & quote), and exchange(s) used.
Hummingbot can collect client data including software version, installation type (binary, source, Docker), O/S, and a random unique instance ID. The instance ID is a randomly generated number and does not identify the user in any way.
Hummingbot aggregates and collects total traded volume per exchange denominated in USDT. The data collected is subsequently reported to CoinAlpha's backend services.

All data collected will be used exclusively by the Hummingbot team for analytical and marketing purposes only. The data will be neither accessible nor sold to any third party.

Expand Down
18 changes: 17 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
@@ -1,4 +1,20 @@
.ONESHELL:
.PHONY: test
.PHONY: run_coverage
.PHONY: report_coverage
.PHONY: development-diff-cover

test:
nosetests -d -v test/test*.py
coverage run -m nose test.hummingbot

run_coverage: test
coverage report
coverage html

report_coverage:
coverage report
coverage html

development-diff-cover:
coverage xml
diff-cover --compare-branch=origin/development coverage.xml
17 changes: 8 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
![Hummingbot](https://i.ibb.co/X5zNkKw/blacklogo-with-text.png)

----
[![Jenkins](https://jenkins-02.coinalpha.com/buildStatus/icon?job=hb_test-master_branch&subject=jenkins:master)](https://jenkins-02.coinalpha.com/job/hb_test-master_branch)
[![Jenkins](https://jenkins-02.coinalpha.com/buildStatus/icon?job=hb_test-development_branch&subject=:development)](https://jenkins-02.coinalpha.com/job/hb_test-development_branch)
[![Discord](https://img.shields.io/discord/530578568154054663.svg?color=768AD4&label=discord&logo=https%3A%2F%2Fdiscordapp.com%2Fassets%2F8c9701b98ad4372b58f13fd9f65f966e.svg)](https://discord.hummingbot.io/)
[![License](https://img.shields.io/badge/License-Apache%202.0-informational.svg)](https://github.com/CoinAlpha/hummingbot/blob/master/LICENSE)
[![Twitter Follow](https://img.shields.io/twitter/follow/hummingbot_io.svg?style=social&label=hummingbot)](https://twitter.com/hummingbot_io)
Expand All @@ -20,36 +18,36 @@ We created hummingbot to promote **decentralized market-making**: enabling membe
![RED](https://via.placeholder.com/15/f03c15/?text=+) RED - Connector is broken and unusable


## Supported centralized exchanges

| logo | id | name | ver | doc | status |
|:---:|:---:|:---:|:---:|:---:|:---:|
| <img src="assets/ascend_ex_logo.png" alt="AscendEx" width="90" /> | ascend_ex | [AscendEx](https://ascendex.com/en/global-digital-asset-platform) | 1 | [API](https://ascendex.github.io/ascendex-pro-api/#ascendex-pro-api-documentation) |![YELLOW](https://via.placeholder.com/15/ffff00/?text=+) |
| <img src="assets/ascend_ex_logo.png" alt="AscendEx" width="90" /> | ascend_ex | [AscendEx](https://ascendex.com/en/global-digital-asset-platform) | 1 | [API](https://ascendex.github.io/ascendex-pro-api/#ascendex-pro-api-documentation) |![GREEN](https://via.placeholder.com/15/008000/?text=+) |
| <img src="assets/beaxy_logo.png" alt="Beaxy" width="90" /> | beaxy | [Beaxy](https://beaxy.com/) | 2 | [API](https://beaxyapiv2trading.docs.apiary.io/) |![GREEN](https://via.placeholder.com/15/008000/?text=+)|
| <img src="https://i.ibb.co/m0YDQLd/Screen-Shot-2019-03-14-at-10-53-42-AM.png" alt="Binance" width="90" /> | binance | [Binance](https://www.binance.com/) | 3 | [API](https://github.com/binance/binance-spot-api-docs/blob/master/rest-api.md) |![GREEN](https://via.placeholder.com/15/008000/?text=+) |
| <img src="assets/binanceus_logo.png" alt="Binance US" width="90" /> | binance_us | [Binance US](https://www.binance.com/) | 3 | [API](https://github.com/binance-us/binance-official-api-docs/blob/master/rest-api.md) |![YELLOW](https://via.placeholder.com/15/ffff00/?text=+) |
| <img src="assets/binance_perpetual_logo.png" alt="Binance Perpetual" width="90" /> | binance_perpetual | [Binance Futures](https://www.binance.com/) | 1 | [API](https://binance-docs.github.io/apidocs/futures/en/) |![YELLOW](https://via.placeholder.com/15/ffff00/?text=+) |
|<img src="assets/bittrex_logo.png" alt="Bittrex Global" width="90" height="30" />| bittrex | [Bittrex Global](https://global.bittrex.com/) | 3 | [API](https://bittrex.github.io/api/v3) |![YELLOW](https://via.placeholder.com/15/ffff00/?text=+) |
| <img src="assets/bitfinex_logo.png" alt="Bitfinex" width="90" /> | bitfinex | [Bitfinex](https://www.bitfinex.com/) | 2 | [API](https://docs.bitfinex.com/docs/introduction) |![YELLOW](https://via.placeholder.com/15/ffff00/?text=+) |
| <img src="assets/blocktane_logo.png" alt="Blocktane" width="90" /> | blocktane | [Blocktane](https://blocktane.io/) | 2 | [API](https://blocktane.io/api) |![GREEN](https://via.placeholder.com/15/008000/?text=+) |
| <img src="assets/blocktane_logo.png" alt="Blocktane" width="90" /> | blocktane | [Blocktane](https://blocktane.io/) | 2 | [API](https://blocktane.io/api) |![YELLOW](https://via.placeholder.com/15/ffff00/?text=+) |
| <img src="https://i.ibb.co/h9JdGDW/cbp.jpg" alt="Coinbase Pro" width="90" /> | coinbase_pro | [Coinbase Pro](https://pro.coinbase.com/) | * | [API](https://docs.pro.coinbase.com/) |![YELLOW](https://via.placeholder.com/15/ffff00/?text=+) |
| <img src="assets/coinzoom_logo.svg" alt="CoinZoom" width="90" /> | coinzoom | [CoinZoom](https://trade.coinzoom.com/landing) | * | [API](https://api-docs.coinzoom.com/) |![YELLOW](https://via.placeholder.com/15/ffff00/?text=+) |
| <img src="assets/cryptocom_logo.png" alt="Crypto.com" width="90" /> | crypto_com | [Crypto.com](https://crypto.com/exchange) | 2 | [API](https://exchange-docs.crypto.com/#introduction) |![YELLOW](https://via.placeholder.com/15/ffff00/?text=+) |
| <img src="assets/cryptocom_logo.png" alt="Crypto.com" width="90" /> | crypto_com | [Crypto.com](https://crypto.com/exchange) | 2 | [API](https://exchange-docs.crypto.com/#introduction) |![GREEN](https://via.placeholder.com/15/008000/?text=+) |
| <img src="assets/digifinex_logo.svg" alt="Digifinex" width="90" /> | digifinex | [Digifinex](https://www.digifinex.com/en-ww) | 3 | [API](https://docs.digifinex.com/en-ww/v3/#introduction) |![YELLOW](https://via.placeholder.com/15/ffff00/?text=+) |
| <img src="assets/dydx_logo.png" alt="dYdX" width="90" /> | dydx | [dYdX](https://dydx.exchange/) | 1 | [API](https://legacy-docs.dydx.exchange/#introduction) |![GREEN](https://via.placeholder.com/15/008000/?text=+) |
| <img src="assets/dydx_logo.png" alt="dYdX Perpetual" width="90" /> | dydx_perpetual | [dYdX Perpetual](https://dydx.exchange/) | 3 | [API](https://docs.dydx.exchange/#general) |![YELLOW](https://via.placeholder.com/15/ffff00/?text=+) |
| <img src="assets/ftx_logo.png" alt="FTX" width="90" /> | ftx | [FTX](https://ftx.com/en) | 1 | [API](https://docs.ftx.com/#overview) |![YELLOW](https://via.placeholder.com/15/ffff00/?text=+) |
| <img src="assets/ftx_logo.png" alt="FTX" width="90" /> | ftx | [FTX](https://ftx.com/en) | 1 | [API](https://docs.ftx.com/#overview) |![GREEN](https://via.placeholder.com/15/008000/?text=+) |
| <img src="assets/himalaya_logo.PNG" alt="Himalaya Exchange" width="90" /> | himalaya | [Himalaya Exchange](https://himalaya.exchange/) | * | [API]() |![RED](https://via.placeholder.com/15/f03c15/?text=+) |
| <img src="assets/hitbtc_logo.png" alt="HitBTC" width="90" /> | hitbtc | [HitBTC](https://hitbtc.com/) | 2 | [API](https://api.hitbtc.com/) | ![GREEN](https://via.placeholder.com/15/008000/?text=+) |
|<img src="assets/huobi_logo.png" alt="Huobi Global" width="90" />| huobi | [Huobi Global](https://www.hbg.com) | 1 | [API](https://huobiapi.github.io/docs/spot/v1/en/) |![GREEN](https://via.placeholder.com/15/008000/?text=+) |
| <img src="assets/kucoin_logo.png" alt="KuCoin" width="90" /> | kucoin | [KuCoin](https://www.kucoin.com/) | 1 | [API](https://docs.kucoin.com/#general) |![GREEN](https://via.placeholder.com/15/008000/?text=+) |
| <img src="assets/kucoin_logo.png" alt="KuCoin" width="90" /> | kucoin | [KuCoin](https://www.kucoin.com/) | 1 | [API](https://docs.kucoin.com/#general) |![YELLOW](https://via.placeholder.com/15/ffff00/?text=+) |
| <img src="assets/kraken_logo.png" alt="Kraken" width="90" /> | kraken | [Kraken](https://www.kraken.com/) | 1 | [API](https://www.kraken.com/features/api) |![GREEN](https://via.placeholder.com/15/008000/?text=+) |
| <img src="assets/liquid_logo.png" alt="Liquid" width="90" /> | liquid | [Liquid](https://www.liquid.com/) | 2 | [API](https://developers.liquid.com/) |![GREEN](https://via.placeholder.com/15/008000/?text=+) |
| <img src="assets/okex_logo.png" alt="OKEx" width="90" /> | okex | [OKEx](https://www.okex.com/) | 3 | [API](https://www.okex.com/docs/en/) |![YELLOW](https://via.placeholder.com/15/ffff00/?text=+) |
| <img src="assets/probit_global_logo.png" alt="Probit Global" width="90" /> | probit | [Probit Global](https://www.probit.com/en-us/) | 1 | [API](https://docs-en.probit.com/docs) |![YELLOW](https://via.placeholder.com/15/ffff00/?text=+) |
| <img src="assets/probit_korea_logo.png" alt="Probit Korea" width="90" /> | probit_kr | [Probit Korea](https://www.probit.kr/en-us/) | 1 | [API](https://docs-en.probit.com/docs) |![YELLOW](https://via.placeholder.com/15/ffff00/?text=+) |




## Supported decentralized exchanges

| logo | id | name | ver | doc| maintainer | status |
Expand All @@ -68,6 +66,7 @@ We created hummingbot to promote **decentralized market-making**: enabling membe
| <img src="assets/perpetual_finance_logo.png" alt="Perpetual Protocol" width="90" /> | perpetual_finance | [Perpetual Protocol](https://perp.fi/) | * | [SDK](https://docs.perp.fi/) | ![YELLOW](https://via.placeholder.com/15/ffff00/?text=+) |
| <img src="assets/terra_logo.png" alt="Terra" width="90" /> | terra | [Terra](https://terra.money/) | * | [SDK](https://docs.terra.money/) | ![GREEN](https://via.placeholder.com/15/008000/?text=+) |
| <img src="assets/uniswap_logo.svg" alt="Uniswap" width="90" height="30" /> | uniswap | [Uniswap](https://uniswap.org/) | 2 | [SDK](https://uniswap.org/docs/v2/) | ![GREEN](https://via.placeholder.com/15/008000/?text=+) |
| <img src="assets/uniswapv3_logo.png" alt="Uniswap v3" width="90" height="48" /> | uniswap v3 | [Uniswap v3](https://uniswap.org/) | 2 | [SDK](https://uniswap.org/blog/uniswap-v3/) | ![GREEN](https://via.placeholder.com/15/008000/?text=+) |



Expand Down
Binary file added assets/uniswapv3_logo.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion hummingbot/VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
dev-0.40.0
dev-0.41.0
6 changes: 4 additions & 2 deletions hummingbot/client/command/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,11 @@
from .silly_commands import SillyCommands
from .order_book_command import OrderBookCommand
from .ticker_command import TickerCommand
from .generate_certs_command import GenerateCertsCommand
from .gateway_command import GatewayCommand
from .open_orders_command import OpenOrdersCommand
from .trades_command import TradesCommand
from .pnl_command import PnlCommand
from .script_command import ScriptCommand
from .rate_command import RateCommand


Expand All @@ -40,9 +41,10 @@
SillyCommands,
OrderBookCommand,
TickerCommand,
GenerateCertsCommand,
GatewayCommand,
OpenOrdersCommand,
TradesCommand,
PnlCommand,
ScriptCommand,
RateCommand,
]
6 changes: 3 additions & 3 deletions hummingbot/client/command/balance_command.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
)
from hummingbot.client.config.config_validators import validate_decimal, validate_exchange
from hummingbot.market.celo.celo_cli import CeloCLI
from hummingbot.client.performance import smart_round
from hummingbot.client.performance import PerformanceMetrics
from hummingbot.core.rate_oracle.rate_oracle import RateOracle
import pandas as pd
from decimal import Decimal
Expand Down Expand Up @@ -96,7 +96,7 @@ async def show_balances(self):
else:
lines = [" " + line for line in df.to_string(index=False).split("\n")]
self._notify("\n".join(lines))
self._notify(f"\n Total: {RateOracle.global_token_symbol} {smart_round(df[total_col_name].sum())} "
self._notify(f"\n Total: {RateOracle.global_token_symbol} {PerformanceMetrics.smart_round(df[total_col_name].sum())} "
f"Allocated: {allocated_total / df[total_col_name].sum():.2%}")
exchanges_total += df[total_col_name].sum()

Expand Down Expand Up @@ -144,7 +144,7 @@ async def exchange_balances_extra_df(self, # type: HummingbotApplication
allocated_total += rate * (bal - avai)
rows.append({"Asset": token.upper(),
"Total": round(bal, 4),
total_col_name: smart_round(global_value),
total_col_name: PerformanceMetrics.smart_round(global_value),
"Allocated": allocated,
})
df = pd.DataFrame(data=rows, columns=["Asset", "Total", total_col_name, "Allocated"])
Expand Down
1 change: 0 additions & 1 deletion hummingbot/client/command/config_command.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,6 @@
"gateway_cert_passphrase",
"gateway_api_host",
"gateway_api_port",
"balancer_max_swaps",
"rate_oracle_source",
"global_token",
"global_token_symbol"]
Expand Down
Loading

0 comments on commit 6828dca

Please sign in to comment.