Skip to content

Commit

Permalink
Merge branch 'development' of https://github.com/CoinAlpha/hummingbot
Browse files Browse the repository at this point in the history
…into development
  • Loading branch information
vic-en committed Jan 15, 2024
2 parents 865c142 + 1809b40 commit 73afcc5
Show file tree
Hide file tree
Showing 305 changed files with 24,199 additions and 17,659 deletions.
8 changes: 1 addition & 7 deletions .coveragerc
Original file line number Diff line number Diff line change
Expand Up @@ -13,18 +13,12 @@ omit =
hummingbot/client/ui/layout.py
hummingbot/client/tab/*
hummingbot/client/ui/parser.py
hummingbot/connector/connector/balancer*
hummingbot/connector/connector/terra*
hummingbot/connector/connector/uniswap*
hummingbot/connector/connector/uniswap_v3*
hummingbot/connector/derivative/perpetual_finance*
hummingbot/connector/derivative/position.py
hummingbot/connector/exchange/bitfinex*
hummingbot/connector/exchange/coinbase_pro*
hummingbot/connector/exchange/hitbtc*
hummingbot/connector/exchange/loopring*
hummingbot/connector/exchange/paper_trade*
hummingbot/connector/gateway*
hummingbot/connector/gateway/**
hummingbot/connector/test_support/*
hummingbot/core/utils/gateway_config_utils.py
hummingbot/core/utils/kill_switch.py
Expand Down
1 change: 1 addition & 0 deletions .github/FUNDING.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
github: hummingbot
2 changes: 1 addition & 1 deletion CODE_OF_CONDUCT.md
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ further defined and clarified by project maintainers.
## Enforcement

Instances of abusive, harassing, or otherwise unacceptable behavior may be
reported by contacting the project team at [email protected]. All
reported by contacting the project team at [email protected]. All
complaints will be reviewed and investigated and will result in a response that
is deemed necessary and appropriate to the circumstances. The project team is
obligated to maintain confidentiality with regard to the reporter of an incident.
Expand Down
2 changes: 2 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,8 @@ If the Foundation team requests changes, make more commits to your branch to add

A minimum of 75% unit test coverage is required for all changes included in a pull request. However, some components, like UI components, are excluded from this validation.

To run tests locally, run `make test` after activating the environment.

To calculate the diff-coverage locally on your computer, run `make development-diff-cover` after running all tests.

## Checklist
Expand Down
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ RUN apt-get update && \
rm -rf /var/lib/apt/lists/*

# Create mount points
RUN mkdir -p /home/hummingbot/conf /home/hummingbot/conf/connectors /home/hummingbot/conf/strategies /home/hummingbot/logs /home/hummingbot/data /home/hummingbot/certs /home/hummingbot/scripts
RUN mkdir -p /home/hummingbot/conf /home/hummingbot/conf/connectors /home/hummingbot/conf/strategies /home/hummingbot/conf/scripts /home/hummingbot/logs /home/hummingbot/data /home/hummingbot/certs /home/hummingbot/scripts

WORKDIR /home/hummingbot

Expand Down
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,7 @@
same "printed page" as the copyright notice for easier
identification within third-party archives.

Copyright 2022 CoinAlpha, Inc.
Copyright 2023 Hummingbot Foundation.

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
Expand Down
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ test:
--exclude-dir="test/hummingbot/connector/gateway/clob_spot/data_sources/dexalot" \
--exclude-dir="test/hummingbot/strategy/amm_arb" \
--exclude-dir="test/hummingbot/core/gateway" \
--exclude-dir="test/hummingbot/strategy/uniswap_v3_lp"
--exclude-dir="test/hummingbot/strategy/amm_v3_lp"

run_coverage: test
coverage report
Expand Down
33 changes: 16 additions & 17 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -50,35 +50,28 @@ Exchanges may be centralized (**CEX**), or decentralized (**DEX**), in which cas
|------|----------|------|-------------|
| ![](https://img.shields.io/static/v1?label=Hummingbot&message=GOLD&color=yellow) | [Binance](https://docs.hummingbot.org/exchanges/binance/) | SPOT CEX | [FQQNNGCD](https://www.binance.com/en/register?ref=FQQNNGCD)
| ![](https://img.shields.io/static/v1?label=Hummingbot&message=GOLD&color=yellow) | [Binance Futures](https://docs.hummingbot.org/exchanges/binance-perpetual/) | PERP CEX | [hummingbot](https://www.binance.com/en/futures/ref?code=hummingbot)
| ![](https://img.shields.io/static/v1?label=Hummingbot&message=GOLD&color=yellow) | [Uniswap](https://docs.hummingbot.org/exchanges/uniswap/) | AMM DEX |
| ![](https://img.shields.io/static/v1?label=Hummingbot&message=GOLD&color=yellow) | [dYdX](https://dydx.exchange/) | PERP DEX |
| ![](https://img.shields.io/static/v1?label=Hummingbot&message=SILVER&color=silver) | [Dexalot](https://docs.hummingbot.org/exchanges/dexalot/) | CLOB DEX |
| ![](https://img.shields.io/static/v1?label=Hummingbot&message=SILVER&color=silver) | [Gate.io](https://docs.hummingbot.org/exchanges/gate-io/) | SPOT CEX | [5868285](https://www.gate.io/signup/5868285)
| ![](https://img.shields.io/static/v1?label=Hummingbot&message=SILVER&color=silver) | [Gate.io Perpetual](https://docs.hummingbot.org/exchanges/gate-io-perpetual/) | PERP CEX | [5868285](https://www.gate.io/signup/5868285)
| ![](https://img.shields.io/static/v1?label=Hummingbot&message=SILVER&color=silver) | [Huobi](https://docs.hummingbot.org/exchanges/huobi/) | SPOT CEX |
| ![](https://img.shields.io/static/v1?label=Hummingbot&message=SILVER&color=silver)| [Injective Helix](https://docs.hummingbot.org/exchanges/injective/) | CLOB DEX |
| ![](https://img.shields.io/static/v1?label=Hummingbot&message=SILVER&color=silver) | [KuCoin](https://docs.hummingbot.org/exchanges/kucoin/) | SPOT CEX | [272KvRf](https://www.kucoin.com/ucenter/signup?rcode=272KvRf)
| ![](https://img.shields.io/static/v1?label=Hummingbot&message=SILVER&color=silver) | [KuCoin Perpetual](https://docs.hummingbot.org/exchanges/kucoin-perpetual/) | PERP CEX | [272KvRf](https://www.kucoin.com/ucenter/signup?rcode=272KvRf)
| ![](https://img.shields.io/static/v1?label=Hummingbot&message=SILVER&color=silver) | [Gate.io](https://docs.hummingbot.org/exchanges/gate-io/) | SPOT CEX | [5868285](https://www.gate.io/signup/5868285)
| ![](https://img.shields.io/static/v1?label=Hummingbot&message=SILVER&color=silver) | [Gate.io Perpetual](https://docs.hummingbot.org/exchanges/gate-io-perpetual/) | PERP CEX | [5868285](https://www.gate.io/signup/5868285)
| ![](https://img.shields.io/static/v1?label=Hummingbot&message=SILVER&color=silver) | [AscendEx](https://docs.hummingbot.org/exchanges/ascend-ex/) | SPOT CEX | [UEIXNXKW](https://ascendex.com/register?inviteCode=UEIXNXKW)
| ![](https://img.shields.io/static/v1?label=Hummingbot&message=SILVER&color=silver) | [Quickswap](https://docs.hummingbot.org/exchanges/quickswap/) | AMM DEX |
| ![](https://img.shields.io/static/v1?label=Hummingbot&message=SILVER&color=silver) | [TraderJoe](https://docs.hummingbot.org/exchanges/traderjoe/) | AMM DEX |
| ![](https://img.shields.io/static/v1?label=Hummingbot&message=SILVER&color=silver) | [dYdX](https://dydx.exchange/) | PERP DEX |
| ![](https://img.shields.io/static/v1?label=Hummingbot&message=BRONZE&color=green) | [AltMarkets](https://docs.hummingbot.org/exchanges/altmarkets/) | SPOT CEX |
| ![](https://img.shields.io/static/v1?label=Hummingbot&message=SILVER&color=silver) | [Polkadex](https://docs.hummingbot.org/exchanges/polkadex/) | SPOT DEX |
| ![](https://img.shields.io/static/v1?label=Hummingbot&message=BRONZE&color=green) | [AscendEx](https://docs.hummingbot.org/exchanges/ascend-ex/) | SPOT CEX | [UEIXNXKW](https://ascendex.com/register?inviteCode=UEIXNXKW)
| ![](https://img.shields.io/static/v1?label=Hummingbot&message=BRONZE&color=green) | [BTC-Markets](https://docs.hummingbot.org/exchanges/btc-markets/) | SPOT CEX |
| ![](https://img.shields.io/static/v1?label=Hummingbot&message=BRONZE&color=green) | [Binance US](https://docs.hummingbot.org/exchanges/binance-us/) | SPOT CEX |
| ![](https://img.shields.io/static/v1?label=Hummingbot&message=BRONZE&color=green) | [BitGet](https://docs.hummingbot.org/exchanges/bitget-perpetual/) | PERP CEX |
| ![](https://img.shields.io/static/v1?label=Hummingbot&message=BRONZE&color=green) | [Bit.com](https://docs.hummingbot.org/exchanges/bit-com) | PERP CEX |
| ![](https://img.shields.io/static/v1?label=Hummingbot&message=BRONZE&color=green) | [BitMart](https://docs.hummingbot.org/exchanges/bitmart/) | SPOT CEX |
| ![](https://img.shields.io/static/v1?label=Hummingbot&message=BRONZE&color=green) | [Bitfinex](https://docs.hummingbot.org/exchanges/bitfinex/) | SPOT CEX |
| ![](https://img.shields.io/static/v1?label=Hummingbot&message=BRONZE&color=green) | [BitGet](https://docs.hummingbot.org/exchanges/bitget-perpetual/) | PERP CEX |
| ![](https://img.shields.io/static/v1?label=Hummingbot&message=BRONZE&color=green) | [Bitmex](https://docs.hummingbot.org/exchanges/bitmex/) | SPOT CEX |
| ![](https://img.shields.io/static/v1?label=Hummingbot&message=BRONZE&color=green) | [Bitmex (perp](https://docs.hummingbot.org/exchanges/bitmex-perpetual/) | SPOT CEX |
| ![](https://img.shields.io/static/v1?label=Hummingbot&message=BRONZE&color=green) | [Bittrex](https://docs.hummingbot.org/exchanges/bittrex/) | SPOT CEX |
| ![](https://img.shields.io/static/v1?label=Hummingbot&message=BRONZE&color=green) | [Bybit](https://docs.hummingbot.org/exchanges/bybit/) | SPOT CEX |
| ![](https://img.shields.io/static/v1?label=Hummingbot&message=BRONZE&color=green) | [Bybit (perp)](https://docs.hummingbot.org/exchanges/bitmex-perpetual/) | PERP CEX |
| ![](https://img.shields.io/static/v1?label=Hummingbot&message=BRONZE&color=green) | [Coinbase](https://docs.hummingbot.org/exchanges/coinbase/) | SPOT CEX |
| ![](https://img.shields.io/static/v1?label=Hummingbot&message=BRONZE&color=green) | [Defira](https://docs.hummingbot.org/exchanges/defira/) | AMM DEX |
| ![](https://img.shields.io/static/v1?label=Hummingbot&message=BRONZE&color=green) | [Dexalot](https://docs.hummingbot.org/exchanges/dexalot/) | CLOB DEX |
| ![](https://img.shields.io/static/v1?label=Hummingbot&message=BRONZE&color=green) | [HitBTC](https://docs.hummingbot.org/exchanges/hitbtc/) | SPOT CEX |
| ![](https://img.shields.io/static/v1?label=Hummingbot&message=BRONZE&color=green) | [Huobi](https://docs.hummingbot.org/exchanges/huobi/) | SPOT CEX |
| ![](https://img.shields.io/static/v1?label=Hummingbot&message=BRONZE&color=green) | [Injective](https://docs.hummingbot.org/exchanges/injective/) | CLOB DEX |
| ![](https://img.shields.io/static/v1?label=Hummingbot&message=BRONZE&color=green) | [Kraken](https://docs.hummingbot.org/exchanges/kraken/) | SPOT CEX |
| ![](https://img.shields.io/static/v1?label=Hummingbot&message=BRONZE&color=green) | [Loopring](https://docs.hummingbot.org/exchanges/loopring/) | SPOT DEX |
| ![](https://img.shields.io/static/v1?label=Hummingbot&message=BRONZE&color=green) | [MEXC](https://docs.hummingbot.org/exchanges/mexc/) | SPOT CEX |
| ![](https://img.shields.io/static/v1?label=Hummingbot&message=BRONZE&color=green) | [Mad Meerkat](https://docs.hummingbot.org/exchanges/mad-meerkat/) | SPOT DEX |
| ![](https://img.shields.io/static/v1?label=Hummingbot&message=BRONZE&color=green) | [NDAX](https://docs.hummingbot.org/exchanges/ndax/) | SPOT DEX |
Expand All @@ -88,14 +81,20 @@ Exchanges may be centralized (**CEX**), or decentralized (**DEX**), in which cas
| ![](https://img.shields.io/static/v1?label=Hummingbot&message=BRONZE&color=green) | [Pangolin](https://docs.hummingbot.org/exchanges/pangolin/) | AMM DEX |
| ![](https://img.shields.io/static/v1?label=Hummingbot&message=BRONZE&color=green) | [Perpetual Protocol](https://docs.hummingbot.org/exchanges/perp/) | PERP DEX |
| ![](https://img.shields.io/static/v1?label=Hummingbot&message=BRONZE&color=green) | [Phemex Perpetual](https://docs.hummingbot.org/exchanges/perp/) | PERP CEX |
| ![](https://img.shields.io/static/v1?label=Hummingbot&message=BRONZE&color=green) | [Polkadex](https://docs.hummingbot.org/exchanges/polkadex/) | SPOT DEX |
| ![](https://img.shields.io/static/v1?label=Hummingbot&message=BRONZE&color=green) | [Plenty](https://docs.hummingbot.org/exchanges/plenty/) | AMM DEX |
| ![](https://img.shields.io/static/v1?label=Hummingbot&message=BRONZE&color=green) | [Quickswap](https://docs.hummingbot.org/exchanges/quickswap/) | AMM DEX |
| ![](https://img.shields.io/static/v1?label=Hummingbot&message=BRONZE&color=green) | [Ref Finance](https://docs.hummingbot.org/exchanges/ref/) | SPOT DEX |
| ![](https://img.shields.io/static/v1?label=Hummingbot&message=BRONZE&color=green) | [Sushiswap](https://docs.hummingbot.org/exchanges/sushiswap/) | AMM DEX |
| ![](https://img.shields.io/static/v1?label=Hummingbot&message=BRONZE&color=green) | [Tinyman](https://docs.hummingbot.org/exchanges/tinyman/) | SPOT DEX |
| ![](https://img.shields.io/static/v1?label=Hummingbot&message=BRONZE&color=green) | [Traderjoe](https://docs.hummingbot.org/exchanges/traderjoe) | AMM
| ![](https://img.shields.io/static/v1?label=Hummingbot&message=BRONZE&color=green) | [Uniswap](https://docs.hummingbot.org/exchanges/uniswap/) | AMM DEX |
| ![](https://img.shields.io/static/v1?label=Hummingbot&message=BRONZE&color=green) | [VVS Finance](https://docs.hummingbot.org/exchanges/vvs/) | AMM DEX |
| ![](https://img.shields.io/static/v1?label=Hummingbot&message=BRONZE&color=green) | [Vertex](https://docs.hummingbot.org/exchanges/vertex/) | CLOB DEX |
| ![](https://img.shields.io/static/v1?label=Hummingbot&message=BRONZE&color=green) | [WOO X](https://docs.hummingbot.org/exchanges/woo-x)| CEX CLOB |
| ![](https://img.shields.io/static/v1?label=Hummingbot&message=BRONZE&color=green) | [XSWAP](https://docs.hummingbot.org/exchanges/xswap/) | AMM DEX |



Quarterly [Polls](https://docs.hummingbot.org/governance/polls/) allow the Hummingbot community to vote using HBOT tokens to decide which exchanges should be certified GOLD or SILVER, which means that they are maintained and continually improved by Hummingbot Foundation. In addition, the codebase includes BRONZE exchange connectors that are maintained by community members. See the [Hummingbot documentation](https://docs.hummingbot.org/exchanges) for all exchanges supported.

## Strategies and Scripts
Expand Down
7 changes: 6 additions & 1 deletion bin/hummingbot.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
load_client_config_map_from_file,
write_config_to_yml,
)
from hummingbot.client.config.security import Security
from hummingbot.client.hummingbot_application import HummingbotApplication
from hummingbot.client.settings import AllConnectorSettings
from hummingbot.client.ui import login_prompt
Expand All @@ -26,11 +27,13 @@


class UIStartListener(EventListener):
def __init__(self, hummingbot_app: HummingbotApplication, is_script: Optional[bool] = False, is_quickstart: Optional[bool] = False):
def __init__(self, hummingbot_app: HummingbotApplication, is_script: Optional[bool] = False,
script_config: Optional[dict] = None, is_quickstart: Optional[bool] = False):
super().__init__()
self._hb_ref: ReferenceType = ref(hummingbot_app)
self._is_script = is_script
self._is_quickstart = is_quickstart
self._script_config = script_config

def __call__(self, _):
asyncio.create_task(self.ui_start_handler())
Expand All @@ -46,10 +49,12 @@ async def ui_start_handler(self):
write_config_to_yml(hb.strategy_config_map, hb.strategy_file_name, hb.client_config_map)
hb.start(log_level=hb.client_config_map.log_level,
script=hb.strategy_name if self._is_script else None,
conf=self._script_config,
is_quickstart=self._is_quickstart)


async def main_async(client_config_map: ClientConfigAdapter):
await Security.wait_til_decryption_done()
await create_yml_files_legacy()

# This init_logging() call is important, to skip over the missing config warnings.
Expand Down
13 changes: 12 additions & 1 deletion bin/hummingbot_quickstart.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,10 @@ def __init__(self):
type=str,
required=False,
help="Specify a file in `conf/` to load as the strategy config file.")
self.add_argument("--script-conf", "-c",
type=str,
required=False,
help="Specify a file in `conf/scripts` to configure a script strategy.")
self.add_argument("--config-password", "-p",
type=str,
required=False,
Expand Down Expand Up @@ -94,11 +98,13 @@ async def quick_start(args: argparse.Namespace, secrets_manager: BaseSecretsMana

strategy_config = None
is_script = False
script_config = None
if config_file_name is not None:
hb.strategy_file_name = config_file_name
if config_file_name.split(".")[-1] == "py":
hb.strategy_name = hb.strategy_file_name
is_script = True
script_config = args.script_conf if args.script_conf else None
else:
strategy_config = await load_strategy_config_map_from_file(
STRATEGIES_CONF_DIR_PATH / config_file_name
Expand All @@ -116,7 +122,8 @@ async def quick_start(args: argparse.Namespace, secrets_manager: BaseSecretsMana

# The listener needs to have a named variable for keeping reference, since the event listener system
# uses weak references to remove unneeded listeners.
start_listener: UIStartListener = UIStartListener(hb, is_script=is_script, is_quickstart=True)
start_listener: UIStartListener = UIStartListener(hb, is_script=is_script, script_config=script_config,
is_quickstart=True)
hb.app.add_listener(HummingbotUIEvent.Start, start_listener)

tasks: List[Coroutine] = [hb.run()]
Expand All @@ -135,6 +142,10 @@ def main():
# variable.
if args.config_file_name is None and len(os.environ.get("CONFIG_FILE_NAME", "")) > 0:
args.config_file_name = os.environ["CONFIG_FILE_NAME"]

if args.script_conf is None and len(os.environ.get("SCRIPT_CONFIG", "")) > 0:
args.script_conf = os.environ["SCRIPT_CONFIG"]

if args.config_password is None and len(os.environ.get("CONFIG_PASSWORD", "")) > 0:
args.config_password = os.environ["CONFIG_PASSWORD"]

Expand Down
10 changes: 0 additions & 10 deletions conf/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,12 +58,6 @@
huobi_api_key = os.getenv("HUOBI_API_KEY")
huobi_secret_key = os.getenv("HUOBI_SECRET_KEY")
# Loopring Tests
loopring_accountid = os.getenv("LOOPRING_ACCOUNTID")
loopring_exchangeid = os.getenv("LOOPRING_EXCHANGEID")
loopring_api_key = os.getenv("LOOPRING_API_KEY")
loopring_private_key = os.getenv("LOOPRING_PRIVATE_KEY")
# Bittrex Tests
bittrex_api_key = os.getenv("BITTREX_API_KEY")
bittrex_secret_key = os.getenv("BITTREX_SECRET_KEY")
Expand Down Expand Up @@ -101,10 +95,6 @@
gate_io_api_key = os.getenv("GATE_IO_API_KEY")
gate_io_secret_key = os.getenv("GATE_IO_SECRET_KEY")
# AltMarkets.io Test
altmarkets_api_key = os.getenv("ALTMARKETS_API_KEY")
altmarkets_secret_key = os.getenv("ALTMARKETS_SECRET_KEY")
# Wallet Tests
test_erc20_token_address = os.getenv("TEST_ERC20_TOKEN_ADDRESS")
web3_test_private_key_a = os.getenv("TEST_WALLET_PRIVATE_KEY_A")
Expand Down
File renamed without changes.
File renamed without changes.
Loading

0 comments on commit 73afcc5

Please sign in to comment.