Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feat/make dexalot api key optional #6271

Merged

Conversation

vic-en
Copy link
Contributor

@vic-en vic-en commented Apr 28, 2023

Before submitting this PR, please make sure:

  • Your code builds clean without any errors or warnings
  • You are using approved title ("feat/", "fix/", "docs/", "refactor/")

A description of the changes proposed in the pull request:
This pr deprecates Dexalot's api key.
[ch39631]

Tests performed by the developer:

  • Reconnecting Dexalot connector.

Tips for QA testing:

@vic-en vic-en reopened this May 3, 2023
@vic-en vic-en changed the base branch from master to development May 3, 2023 00:28
@vic-en vic-en changed the title Feat/deprecate dexalot api key Feat/make dexalot api key optional May 3, 2023
@vic-en vic-en mentioned this pull request May 3, 2023
2 tasks
fengtality
fengtality previously approved these changes May 3, 2023
Copy link
Sponsor Contributor

@fengtality fengtality left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please make the change requested to the warning

@@ -259,6 +260,7 @@ def quantize_order_amount(self, trading_pair: str, amount: Decimal, price: Decim

# Add 1% as a safety factor in case the prices changed while making the order.
if notional_size < trading_rule.min_notional_size * Decimal("1.01"):
self.logger().warning("Quantizing order amount to 0 because order notional value is not up to expected minimum notional value.")
Copy link
Sponsor Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please replace with:
self.logger().warning(f"Quantizing order amount to 0 because order notional value is below {trading_rule.min_notional_size} market minimum notional value.")

@nikspz
Copy link
Contributor

nikspz commented May 3, 2023

Latest commit: a9d45c4

Got in issue at the start of the HB instance

Steps to reproduce:

  1. Clone and install feature branch
  2. Start the instance
2023-05-03 18:14:31,450 - 124563 - hummingbot.core.utils.trading_pair_fetcher - ERROR - An error occurred when fetching trading pairs for hotbit.Please check the logs
Traceback (most recent call last):
  File "/home/ubuntu/dexalot6271/hummingbot/core/utils/trading_pair_fetcher.py", line 53, in fetch_all
    self._fetch_pairs_from_connector_setting(connector_setting=conn_setting)
  File "/home/ubuntu/dexalot6271/hummingbot/core/utils/trading_pair_fetcher.py", line 38, in _fetch_pairs_from_connector_setting
    connector = connector_setting.non_trading_connector_instance_with_default_configuration()
  File "/home/ubuntu/dexalot6271/hummingbot/client/settings.py", line 308, in non_trading_connector_instance_with_default_configuration
    connector_class = getattr(importlib.import_module(self.module_path()), self.class_name())
  File "/home/ubuntu/miniconda3/envs/hummingbot/lib/python3.8/importlib/__init__.py", line 127, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
  File "<frozen importlib._bootstrap>", line 1014, in _gcd_import
  File "<frozen importlib._bootstrap>", line 991, in _find_and_load
  File "<frozen importlib._bootstrap>", line 975, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 671, in _load_unlocked
  File "<frozen importlib._bootstrap_external>", line 783, in exec_module
  File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
  File "/home/ubuntu/dexalot6271/hummingbot/connector/exchange/hotbit/hotbit_exchange.py", line 19, in <module>
    from hummingbot.connector.exchange_py_base import ExchangePyBase
  File "/home/ubuntu/dexalot6271/hummingbot/connector/exchange_py_base.py", line 263
    self.logger().warning("f"Quantizing order amount to 0 because order notional value is below {trading_rule.min_notional_size} market minimum notional value.")
                             ^
SyntaxError: invalid syntax
2023-05-03 18:14:31,461 - 124563 - hummingbot.core.utils.trading_pair_fetcher - ERROR - An error occurred when fetching trading pairs for kucoin.Please check the logs
Traceback (most recent call last):
  File "/home/ubuntu/dexalot6271/hummingbot/core/utils/trading_pair_fetcher.py", line 53, in fetch_all
    self._fetch_pairs_from_connector_setting(connector_setting=conn_setting)
  File "/home/ubuntu/dexalot6271/hummingbot/core/utils/trading_pair_fetcher.py", line 38, in _fetch_pairs_from_connector_setting
    connector = connector_setting.non_trading_connector_instance_with_default_configuration()
  File "/home/ubuntu/dexalot6271/hummingbot/client/settings.py", line 308, in non_trading_connector_instance_with_default_configuration
    connector_class = getattr(importlib.import_module(self.module_path()), self.class_name())
  File "/home/ubuntu/miniconda3/envs/hummingbot/lib/python3.8/importlib/__init__.py", line 127, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
  File "<frozen importlib._bootstrap>", line 1014, in _gcd_import
  File "<frozen importlib._bootstrap>", line 991, in _find_and_load
  File "<frozen importlib._bootstrap>", line 975, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 671, in _load_unlocked
  File "<frozen importlib._bootstrap_external>", line 783, in exec_module
  File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
  File "/home/ubuntu/dexalot6271/hummingbot/connector/exchange/kucoin/kucoin_exchange.py", line 16, in <module>
    from hummingbot.connector.exchange_py_base import ExchangePyBase
  File "/home/ubuntu/dexalot6271/hummingbot/connector/exchange_py_base.py", line 263
    self.logger().warning("f"Quantizing order amount to 0 because order notional value is below {trading_rule.min_notional_size} market minimum notional value.")
                             ^
SyntaxError: invalid syntax
2023-05-03 18:14:31,526 - 124563 - hummingbot.core.utils.trading_pair_fetcher - ERROR - An error occurred when fetching trading pairs for btc_markets.Please check the logs
Traceback (most recent call last):
  File "/home/ubuntu/dexalot6271/hummingbot/core/utils/trading_pair_fetcher.py", line 53, in fetch_all
    self._fetch_pairs_from_connector_setting(connector_setting=conn_setting)
  File "/home/ubuntu/dexalot6271/hummingbot/core/utils/trading_pair_fetcher.py", line 38, in _fetch_pairs_from_connector_setting
    connector = connector_setting.non_trading_connector_instance_with_default_configuration()
  File "/home/ubuntu/dexalot6271/hummingbot/client/settings.py", line 308, in non_trading_connector_instance_with_default_configuration
    connector_class = getattr(importlib.import_module(self.module_path()), self.class_name())
  File "/home/ubuntu/miniconda3/envs/hummingbot/lib/python3.8/importlib/__init__.py", line 127, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
  File "<frozen importlib._bootstrap>", line 1014, in _gcd_import
  File "<frozen importlib._bootstrap>", line 991, in _find_and_load
  File "<frozen importlib._bootstrap>", line 975, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 671, in _load_unlocked
  File "<frozen importlib._bootstrap_external>", line 783, in exec_module
  File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
  File "/home/ubuntu/dexalot6271/hummingbot/connector/exchange/btc_markets/btc_markets_exchange.py", line 19, in <module>
    from hummingbot.connector.exchange_py_base import ExchangePyBase
  File "/home/ubuntu/dexalot6271/hummingbot/connector/exchange_py_base.py", line 263
    self.logger().warning("f"Quantizing order amount to 0 because order notional value is below {trading_rule.min_notional_size} market minimum notional value.")
                             ^
SyntaxError: invalid syntax
2023-05-03 18:14:31,538 - 124563 - hummingbot.core.utils.trading_pair_fetcher - ERROR - An error occurred when fetching trading pairs for bybit.Please check the logs
Traceback (most recent call last):
  File "/home/ubuntu/dexalot6271/hummingbot/core/utils/trading_pair_fetcher.py", line 53, in fetch_all
    self._fetch_pairs_from_connector_setting(connector_setting=conn_setting)
  File "/home/ubuntu/dexalot6271/hummingbot/core/utils/trading_pair_fetcher.py", line 38, in _fetch_pairs_from_connector_setting
    connector = connector_setting.non_trading_connector_instance_with_default_configuration()
  File "/home/ubuntu/dexalot6271/hummingbot/client/settings.py", line 308, in non_trading_connector_instance_with_default_configuration
    connector_class = getattr(importlib.import_module(self.module_path()), self.class_name())
  File "/home/ubuntu/miniconda3/envs/hummingbot/lib/python3.8/importlib/__init__.py", line 127, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
  File "<frozen importlib._bootstrap>", line 1014, in _gcd_import
  File "<frozen importlib._bootstrap>", line 991, in _find_and_load
  File "<frozen importlib._bootstrap>", line 975, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 671, in _load_unlocked
  File "<frozen importlib._bootstrap_external>", line 783, in exec_module
  File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
  File "/home/ubuntu/dexalot6271/hummingbot/connector/exchange/bybit/bybit_exchange.py", line 13, in <module>
    from hummingbot.connector.exchange_py_base import ExchangePyBase
  File "/home/ubuntu/dexalot6271/hummingbot/connector/exchange_py_base.py", line 263
    self.logger().warning("f"Quantizing order amount to 0 because order notional value is below {trading_rule.min_notional_size} market minimum notional value.")
                             ^
SyntaxError: invalid syntax
2023-05-03 18:14:31,540 - 124563 - hummingbot.core.utils.trading_pair_fetcher - ERROR - An error occurred when fetching trading pairs for bybit_testnet.Please check the logs
Traceback (most recent call last):
  File "/home/ubuntu/dexalot6271/hummingbot/core/utils/trading_pair_fetcher.py", line 53, in fetch_all
    self._fetch_pairs_from_connector_setting(connector_setting=conn_setting)
  File "/home/ubuntu/dexalot6271/hummingbot/core/utils/trading_pair_fetcher.py", line 38, in _fetch_pairs_from_connector_setting
    connector = connector_setting.non_trading_connector_instance_with_default_configuration()
  File "/home/ubuntu/dexalot6271/hummingbot/client/settings.py", line 308, in non_trading_connector_instance_with_default_configuration
    connector_class = getattr(importlib.import_module(self.module_path()), self.class_name())
  File "/home/ubuntu/miniconda3/envs/hummingbot/lib/python3.8/importlib/__init__.py", line 127, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
  File "<frozen importlib._bootstrap>", line 1014, in _gcd_import
  File "<frozen importlib._bootstrap>", line 991, in _find_and_load
  File "<frozen importlib._bootstrap>", line 975, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 671, in _load_unlocked
  File "<frozen importlib._bootstrap_external>", line 783, in exec_module
  File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
  File "/home/ubuntu/dexalot6271/hummingbot/connector/exchange/bybit/bybit_exchange.py", line 13, in <module>
    from hummingbot.connector.exchange_py_base import ExchangePyBase
  File "/home/ubuntu/dexalot6271/hummingbot/connector/exchange_py_base.py", line 263
    self.logger().warning("f"Quantizing order amount to 0 because order notional value is below {trading_rule.min_notional_size} market minimum notional value.")
                             ^
SyntaxError: invalid syntax

logs_hummingbot.log

image
start instance dexalot_6271

@nikspz
Copy link
Contributor

nikspz commented May 4, 2023

@vic-en I'm not sure this is working as expected

Steps:
Clone and install
Start the strategy with order amount lower than min

image

Test performed:

  • Cloned and installed feature branch
  • Connected dexalot without dexalot_API_key successfully
  • Created/started strategies using AVAX-USDC, WETH.E-USDC, BTC.B-USDC successfully
  • Order cancellation: ok
  • Status --live and order_book --live sync with the exachange
  • Filled order events: ok
  • CSV, Sqlite, history matched with the exchange
  • connected dexalot using dexalot_API_key successfully

@vic-en
Copy link
Contributor Author

vic-en commented May 5, 2023

@nikspz sorry about that. I updated it again.

Copy link
Contributor

@nikspz nikspz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@vic-en fixed
image

Test performed:

  • Cloned and installed feature branch
  • Connected dexalot without dexalot_API_key successfully
  • Created/started strategies using AVAX-USDC, WETH.E-USDC, BTC.B-USDC successfully
  • Order cancellation: ok
  • Status --live and order_book --live sync with the exchange
  • Filled order events: ok
  • CSV, Sqlite, history matched with the exchange
  • connected dexalot using dexalot_API_key successfully
  • Created docker image manually successfully

@fengtality fengtality merged commit 1730535 into hummingbot:development May 6, 2023
2 checks passed
@fengtality fengtality deleted the feat/deprecate_dexalot_api_key branch May 6, 2023 02:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

None yet

3 participants