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/injective chain streams #6760

Merged

Conversation

aarmoa
Copy link
Contributor

@aarmoa aarmoa commented Jan 8, 2024

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:

  • Changed injective-py dependency to point to the version required to interact with Injective mainnet after the chain upgrade taking place on January 11th.
  • Refactored Injective v2 connectors to use the new chain streams (available in chain upgrade version v1.12)

Tests performed by the developer:

  • All unit tests passing in green
  • Tested by running spot and perpetual market making strategies in testnet.

Tips for QA testing:

  • Until the chain upgrade is done in Injective mainnet this PR should be only tested using testnet

abel added 30 commits October 4, 2023 10:21
…D (client order ID) to create orders, cancel orders and process their updates
… order id) if it is already available to cancel orders (to make the new connector backwards compatible)
…ective Indexer, to much the ids of the trades received through the chain stream
…onnectors. Updated unit tests to work correctly after the refactoring.
…d in chain streams, and start using again the tradeId with the trades provided by the Indexer
…onnectors to start using the new TradesV2 logic in the indexer
@aarmoa
Copy link
Contributor Author

aarmoa commented Jan 9, 2024

I have just pushed a fix for the orderbooks updates processing. For some reason GitHub is not reflecting it in the PR yet, but please consider that the last commit you should see before testing is 60673a20f5aa59ccec98e8744c5cf523c604d88c

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.

Test performed:

  • Cloned and installed feature branch
  • Manually built docker image successfully
  • connected injective_v2 and injective_v2_perpetual using testnet and delegate_acount successfully
  • checked balance successfully
  • created second account to balance order book manually
  • Created/started pureMM using injective_v2 on testnet helix app successfully
  • review orders placing/refresh/filled, recorded in CSV data
  • Created/started perpetualMM using injective_v2_perpetual on testnet helix app successfully
  • review orders to OPEN placing/refreshed succesfully
  • orders to CLOSE placed/filled according to the config params set

Note: need to fix failing tests on this PR

@aarmoa
Copy link
Contributor Author

aarmoa commented Jan 12, 2024

Hello @nikspz. Thank you for taking the time to review the PR.
The failing test has nothing to do with the changes in this PR. I don't think it is my responsibility to fix tests I have neither created nor modified in any way.

@cardosofede cardosofede merged commit 1809b40 into hummingbot:development Jan 12, 2024
2 checks passed
@aarmoa aarmoa deleted the feat/injective_chain_streams branch January 12, 2024 20:27
@0xferit
Copy link
Contributor

0xferit commented Feb 6, 2024

A clean installation prevents the error below, as pointed out by @david-hummingbot. I'm keeping the message in case someone needs it.

Trying to compile and start from the source at v1.24.0 prints out this error:

(hummingbot) root@hummingbot-debian-2024:~/hummingbot# ./start Traceback (most recent call last): File "/root/hummingbot/./bin/hummingbot_quickstart.py", line 15, in <module> from bin.hummingbot import UIStartListener, detect_available_port File "/root/hummingbot/bin/hummingbot.py", line 10, in <module> from hummingbot.client.config.client_config_map import ClientConfigMap File "/root/hummingbot/hummingbot/client/config/client_config_map.py", line 23, in <module> from hummingbot.connector.connector_base import ConnectorBase File "hummingbot/connector/connector_base.pyx", line 6, in init hummingbot.connector.connector_base from hummingbot.client.config.trade_fee_schema_loader import TradeFeeSchemaLoader File "/root/hummingbot/hummingbot/client/config/trade_fee_schema_loader.py", line 3, in <module> from hummingbot.client.config.fee_overrides_config_map import fee_overrides_config_map File "/root/hummingbot/hummingbot/client/config/fee_overrides_config_map.py", line 32, in <module> init_fee_overrides_config() File "/root/hummingbot/hummingbot/client/config/fee_overrides_config_map.py", line 29, in init_fee_overrides_config fee_overrides_config_map.update(fee_overrides_dict()) File "/root/hummingbot/hummingbot/client/config/fee_overrides_config_map.py", line 12, in fee_overrides_dict for name in AllConnectorSettings.get_connector_settings().keys(): File "/root/hummingbot/hummingbot/client/settings.py", line 571, in get_connector_settings cls.all_connector_settings = cls.create_connector_settings() File "/root/hummingbot/hummingbot/client/settings.py", line 484, in create_connector_settings util_module = importlib.import_module(util_module_path) File "/root/miniconda3/envs/hummingbot/lib/python3.10/importlib/__init__.py", line 126, in import_module return _bootstrap._gcd_import(name[level:], package, level) File "/root/hummingbot/hummingbot/connector/derivative/injective_v2_perpetual/injective_v2_perpetual_utils.py", line 8, in <module> from hummingbot.connector.exchange.injective_v2.injective_v2_utils import ( File "/root/hummingbot/hummingbot/connector/exchange/injective_v2/injective_v2_utils.py", line 10, in <module> from hummingbot.connector.exchange.injective_v2 import injective_constants as CONSTANTS File "/root/hummingbot/hummingbot/connector/exchange/injective_v2/injective_constants.py", line 17, in <module> EXTRA_TRANSACTION_GAS = pyinjective.constant.GAS_FEE_BUFFER_AMOUNT AttributeError: module 'pyinjective.constant' has no attribute 'GAS_FEE_BUFFER_AMOUNT' (hummingbot) root@hummingbot-debian-2024:~/hummingbot#

Important part: EXTRA_TRANSACTION_GAS = pyinjective.constant.GAS_FEE_BUFFER_AMOUNT AttributeError: module 'pyinjective.constant' has no attribute 'GAS_FEE_BUFFER_AMOUNT'

I think it's relevant to this pull request.

I also tested building from source at v1.23.0, and it works fine.

@david-hummingbot
Copy link
Contributor

@0xferit You'll need to do a full uninstall, remove the hummingbot conda environment and then run install and compile again.

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

6 participants