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

bloXroute Labs Solana Trader API Connector Implementation #6152

Open
wants to merge 49 commits into
base: development
Choose a base branch
from

Conversation

atulsriv
Copy link

@atulsriv atulsriv commented Mar 16, 2023

Before submitting this PR, please make sure:
CC: @aspin @kdonthi @rapcmia @magictao

  • 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 implements an instance hummingbot exchange connector using bloXroute Labs Solana Trader API (https://docs.bloxroute.com/solana/trader-api).

Tests performed by the developer:
Modified ExchangePyBase to allow for connectors that lacks UserStreamDataSource.
Adds all connector components for the connector.

Tips for QA testing:
Ensure that the connector runs as intended.

kdonthi and others added 30 commits December 23, 2022 19:17
* Create an orderbook manager to replace the data source/tracker
* Tests for orderbook manager
* Tested updates are working for `dca_example.py` without buy
@rapcmia rapcmia requested a review from nikspz March 17, 2023 00:37
@rapcmia
Copy link
Contributor

rapcmia commented Mar 17, 2023

PR update:

  • Follow the guide https://docs.bloxroute.com/solana/trader-api/about/hummingbot-connector
  • Successfully setup client using commit 3aeba79 and just want to confirm if the version of the client is v1.13.0 is correct?
    • Our current development branch is dev-1.14.0
  • The connect command does not showbloxroute-openbook
  • The connect command does not show any option for bloxroute-openbook
  • Autocomplete list does not show bloxroute-openbook
WindowsTerminal_vSJr5RQ3H5.mp4

@atulsriv
Copy link
Author

atulsriv commented Mar 20, 2023

PR update:

  • Follow the guide https://docs.bloxroute.com/solana/trader-api/about/hummingbot-connector

  • Successfully setup client using commit 3aeba79 and just want to confirm if the version of the client is v1.13.0 is correct?

    • Our current development branch is dev-1.14.0
  • The connect command does not showbloxroute-openbook

  • The connect command does not show any option for bloxroute-openbook

  • Autocomplete list does not show bloxroute-openbook

@magictao

@rapcmia Can you run ./install and ./compile when you initially checkout the branch and see if you get the same result? (I noticed you didn't do this in the video clip). This should update some runtime yml files in conf/ that will allow the autogen list of the bloxroute connector to get populated.

@rapcmia
Copy link
Contributor

rapcmia commented Mar 21, 2023

@rapcmia Can you run ./install and ./compile when you initially checkout the branch and see if you get the same result? (I noticed you didn't do this in the video clip). This should update some runtime yml files in conf/ that will allow the autogen list of the bloxroute connector to get populated.

Yes, I initially install and compile it and still getting the same results

@atulsriv
Copy link
Author

@rapcmia Can you run ./install and ./compile when you initially checkout the branch and see if you get the same result? (I noticed you didn't do this in the video clip). This should update some runtime yml files in conf/ that will allow the autogen list of the bloxroute connector to get populated.

Yes, I initially install and compile it and still getting the same results

can you run a pip list and paste the output? I think as an interim solution, you might have to manually run:
pip install bxsolana-trader. It should be at package version 1.5.0

@rapcmia
Copy link
Contributor

rapcmia commented Mar 22, 2023

can you run a pip list and paste the output? I think as an interim solution, you might have to manually run:
pip install bxsolana-trader. It should be at package version 1.5.0

Hi @atulsriv yes please see below the screenshot. We tried to install the pip install bxsolana-trader as well but still no go. I had a colleague to check this PR as well but getting the same results. Bloxroute-openbook is not available
image

@atulsriv
Copy link
Author

can you run a pip list and paste the output? I think as an interim solution, you might have to manually run:
pip install bxsolana-trader. It should be at package version 1.5.0

Hi @atulsriv yes please see below the screenshot. We tried to install the pip install bxsolana-trader as well but still no go. I had a colleague to check this PR as well but getting the same results. Bloxroute-openbook is not available image

Ok revisiting this, will get you a response in a few hours @rapcmia

@atulsriv
Copy link
Author

can you run a pip list and paste the output? I think as an interim solution, you might have to manually run:
pip install bxsolana-trader. It should be at package version 1.5.0

Hi @atulsriv yes please see below the screenshot. We tried to install the pip install bxsolana-trader as well but still no go. I had a colleague to check this PR as well but getting the same results. Bloxroute-openbook is not available image

Ok revisiting this, will get you a response in a few hours @rapcmia

@rapcmia
Ok, so I started from scratch. I deleted my repo and cloned the bloxroute/hummingbot fork and checked out the branch of the PR. I ran the install script afterwards, and the output of pip list showed I had bxsolana-trader 1.4.0. The version of bxsolana-trader 1.4.0 had some breaking changes so the code on this branch can only work with bxsolana-trader 1.5.0. Anyways, your screenshot does show 1.5.0. I ran pip uninstall bxsolana-trader and then pip install bxsolana-trader, which then put 1.5.0 on my output of pip list

After that I ran conda activate hummingbot
then ./compile
and then bin/hummingbot.py as usual, and was able to create the connector.

Can you try pip uninstall bxsolana-trader and then a subsequent pip install bxsolana-trader and then use these instructions above, and let me know if it makes any difference? Otherwise, if this doesn't work, let's PM when you are free so I can try to figure out what is going on.

In addition, did any logs start generating in logs/hummingbot.log? If so, can you send me the output? There may be some other error that isn't obvious to me right now, might be in this log.

Thanks!

@rapcmia
Copy link
Contributor

rapcmia commented Mar 23, 2023

Hi @atulsriv thanks for the reply. I redo the installation as requested pip uninstall bxsolana-trader && pip install bxsolana-trader then ./install && conda activate hummingbot && ./compile and still no go. We would also normally check the connector on the connector_status.py file but it does not seem to be available too and the client is still running on 1.13.0 which should be on dev-1.14.0. Yes you can message me or @nikspz on discord

WindowsTerminal_AUEdI6Ug9X.mp4

No particularly related to bloxroute still sending you the logs 🙇
logs_hummingbot.log

@rapcmia rapcmia changed the base branch from master to development April 4, 2023 02:26
@atulsriv
Copy link
Author

https://www.loom.com/share/4e56762c19cd4a948f7892d9bcfedd99
https://www.loom.com/share/861e553d83d54ea5be286bfbdf7a15cc

added video instructions on how to get it setup, it addresses the connector not instantiating issue. make sure before you run ./install.sh you can see bxsolana-trader at version 1.5.0 in your pip list. after you run conda activate hummingbot, make sure you can still see this in pip list.

@rapcmia
Copy link
Contributor

rapcmia commented Apr 26, 2023

Thanks for the update @atulsriv

  • Watched loom video and follow same instructions
  • Confirm the PR is running on latest dev branch
  • Successfully installed bxsolana-trader 1.5.0 and also check pip list after activating hummingbot env ✅
  • Start the hummingbot client
    image
    • Getting this error upon start of client
  • Confirm bloxroute-openbook is available however getting the error even connect command wont work after adding API key ( bloxroute + solana phantom wallet )
    image
     2023-04-26 15:18:05,565 - 26950 - hummingbot.core.utils.async_utils - ERROR - Unhandled error in background task: Can't instantiate abstract class BloxrouteOpenbookExchange with abstract methods _is_order_not_found_during_cancelation_error, _is_order_not_found_during_status_update_error
     Traceback (most recent call last):
       File "/home/rapcmia/github/hummingbot/6152/hummingbot/core/utils/async_utils.py", line 9, in safe_wrapper
         return await c
       File "/home/rapcmia/github/hummingbot/6152/hummingbot/client/command/connect_command.py", line 62, in connect_exchange
         await self._perform_connect(connector_config)
       File "/home/rapcmia/github/hummingbot/6152/hummingbot/client/command/connect_command.py", line 142, in _perform_connect
         err_msg = await self.validate_n_connect_connector(connector_name)
       File "/home/rapcmia/github/hummingbot/6152/hummingbot/client/command/connect_command.py", line 121, in validate_n_connect_connector
         err_msg = await asyncio.wait_for(
       File "/home/rapcmia/miniconda3/envs/hummingbot/lib/python3.8/asyncio/tasks.py", line 483, in wait_for
         return fut.result()
       File "/home/rapcmia/github/hummingbot/6152/hummingbot/user/user_balances.py", line 86, in add_exchange
         market = UserBalances.connect_market(exchange, client_config_map, **api_details)
       File "/home/rapcmia/github/hummingbot/6152/hummingbot/user/user_balances.py", line 45, in connect_market
         connector = connector_class(**init_params)
     TypeError: Can't instantiate abstract class BloxrouteOpenbookExchange with abstract methods _is_order_not_found_during_cancelation_error, _is_order_not_found_during_status_update_errorc
    

Steps to reproduce:

  • Clone PR then pip install bxsolana-trader
  • Run install, activate hummingbot then compile
  • Connect bloxroute-openbook

logs_hummingbot.log

@atulsriv
Copy link
Author

Thanks for the update @atulsriv

  • Watched loom video and follow same instructions

  • Confirm the PR is running on latest dev branch

  • Successfully installed bxsolana-trader 1.5.0 and also check pip list after activating hummingbot env ✅

  • Start the hummingbot client
    image

    • Getting this error upon start of client
  • Confirm bloxroute-openbook is available however getting the error even connect command wont work after adding API key ( bloxroute + solana phantom wallet )
    image

     2023-04-26 15:18:05,565 - 26950 - hummingbot.core.utils.async_utils - ERROR - Unhandled error in background task: Can't instantiate abstract class BloxrouteOpenbookExchange with abstract methods _is_order_not_found_during_cancelation_error, _is_order_not_found_during_status_update_error
     Traceback (most recent call last):
       File "/home/rapcmia/github/hummingbot/6152/hummingbot/core/utils/async_utils.py", line 9, in safe_wrapper
         return await c
       File "/home/rapcmia/github/hummingbot/6152/hummingbot/client/command/connect_command.py", line 62, in connect_exchange
         await self._perform_connect(connector_config)
       File "/home/rapcmia/github/hummingbot/6152/hummingbot/client/command/connect_command.py", line 142, in _perform_connect
         err_msg = await self.validate_n_connect_connector(connector_name)
       File "/home/rapcmia/github/hummingbot/6152/hummingbot/client/command/connect_command.py", line 121, in validate_n_connect_connector
         err_msg = await asyncio.wait_for(
       File "/home/rapcmia/miniconda3/envs/hummingbot/lib/python3.8/asyncio/tasks.py", line 483, in wait_for
         return fut.result()
       File "/home/rapcmia/github/hummingbot/6152/hummingbot/user/user_balances.py", line 86, in add_exchange
         market = UserBalances.connect_market(exchange, client_config_map, **api_details)
       File "/home/rapcmia/github/hummingbot/6152/hummingbot/user/user_balances.py", line 45, in connect_market
         connector = connector_class(**init_params)
     TypeError: Can't instantiate abstract class BloxrouteOpenbookExchange with abstract methods _is_order_not_found_during_cancelation_error, _is_order_not_found_during_status_update_errorc
    

Steps to reproduce:

  • Clone PR then pip install bxsolana-trader
  • Run install, activate hummingbot then compile
  • Connect bloxroute-openbook

logs_hummingbot.log

After a bit of time, I haven't been able to reproduce this error. are you using both string authorization headers and solana PRIVATE key?

@atulsriv
Copy link
Author

Thanks for the update @atulsriv

  • Watched loom video and follow same instructions

  • Confirm the PR is running on latest dev branch

  • Successfully installed bxsolana-trader 1.5.0 and also check pip list after activating hummingbot env ✅

  • Start the hummingbot client
    image

    • Getting this error upon start of client
  • Confirm bloxroute-openbook is available however getting the error even connect command wont work after adding API key ( bloxroute + solana phantom wallet )
    image

     2023-04-26 15:18:05,565 - 26950 - hummingbot.core.utils.async_utils - ERROR - Unhandled error in background task: Can't instantiate abstract class BloxrouteOpenbookExchange with abstract methods _is_order_not_found_during_cancelation_error, _is_order_not_found_during_status_update_error
     Traceback (most recent call last):
       File "/home/rapcmia/github/hummingbot/6152/hummingbot/core/utils/async_utils.py", line 9, in safe_wrapper
         return await c
       File "/home/rapcmia/github/hummingbot/6152/hummingbot/client/command/connect_command.py", line 62, in connect_exchange
         await self._perform_connect(connector_config)
       File "/home/rapcmia/github/hummingbot/6152/hummingbot/client/command/connect_command.py", line 142, in _perform_connect
         err_msg = await self.validate_n_connect_connector(connector_name)
       File "/home/rapcmia/github/hummingbot/6152/hummingbot/client/command/connect_command.py", line 121, in validate_n_connect_connector
         err_msg = await asyncio.wait_for(
       File "/home/rapcmia/miniconda3/envs/hummingbot/lib/python3.8/asyncio/tasks.py", line 483, in wait_for
         return fut.result()
       File "/home/rapcmia/github/hummingbot/6152/hummingbot/user/user_balances.py", line 86, in add_exchange
         market = UserBalances.connect_market(exchange, client_config_map, **api_details)
       File "/home/rapcmia/github/hummingbot/6152/hummingbot/user/user_balances.py", line 45, in connect_market
         connector = connector_class(**init_params)
     TypeError: Can't instantiate abstract class BloxrouteOpenbookExchange with abstract methods _is_order_not_found_during_cancelation_error, _is_order_not_found_during_status_update_errorc
    

Steps to reproduce:

  • Clone PR then pip install bxsolana-trader
  • Run install, activate hummingbot then compile
  • Connect bloxroute-openbook

logs_hummingbot.log

After a bit of time, I haven't been able to reproduce this error. are you using both string authorization headers and solana PRIVATE key?

But as a follow up, I am able to just use bloXroute auth header, and a solana private key from phantom and run the fixed grid strategy. Do you have time today for a debug call sometime?

@atulsriv
Copy link
Author

Thanks for the update @atulsriv

  • Watched loom video and follow same instructions

  • Confirm the PR is running on latest dev branch

  • Successfully installed bxsolana-trader 1.5.0 and also check pip list after activating hummingbot env ✅

  • Start the hummingbot client
    image

    • Getting this error upon start of client
  • Confirm bloxroute-openbook is available however getting the error even connect command wont work after adding API key ( bloxroute + solana phantom wallet )
    image

     2023-04-26 15:18:05,565 - 26950 - hummingbot.core.utils.async_utils - ERROR - Unhandled error in background task: Can't instantiate abstract class BloxrouteOpenbookExchange with abstract methods _is_order_not_found_during_cancelation_error, _is_order_not_found_during_status_update_error
     Traceback (most recent call last):
       File "/home/rapcmia/github/hummingbot/6152/hummingbot/core/utils/async_utils.py", line 9, in safe_wrapper
         return await c
       File "/home/rapcmia/github/hummingbot/6152/hummingbot/client/command/connect_command.py", line 62, in connect_exchange
         await self._perform_connect(connector_config)
       File "/home/rapcmia/github/hummingbot/6152/hummingbot/client/command/connect_command.py", line 142, in _perform_connect
         err_msg = await self.validate_n_connect_connector(connector_name)
       File "/home/rapcmia/github/hummingbot/6152/hummingbot/client/command/connect_command.py", line 121, in validate_n_connect_connector
         err_msg = await asyncio.wait_for(
       File "/home/rapcmia/miniconda3/envs/hummingbot/lib/python3.8/asyncio/tasks.py", line 483, in wait_for
         return fut.result()
       File "/home/rapcmia/github/hummingbot/6152/hummingbot/user/user_balances.py", line 86, in add_exchange
         market = UserBalances.connect_market(exchange, client_config_map, **api_details)
       File "/home/rapcmia/github/hummingbot/6152/hummingbot/user/user_balances.py", line 45, in connect_market
         connector = connector_class(**init_params)
     TypeError: Can't instantiate abstract class BloxrouteOpenbookExchange with abstract methods _is_order_not_found_during_cancelation_error, _is_order_not_found_during_status_update_errorc
    

Steps to reproduce:

  • Clone PR then pip install bxsolana-trader
  • Run install, activate hummingbot then compile
  • Connect bloxroute-openbook

logs_hummingbot.log

After a bit of time, I haven't been able to reproduce this error. are you using both string authorization headers and solana PRIVATE key?

But as a follow up, I am able to just use bloXroute auth header, and a solana private key from phantom and run the fixed grid strategy. Do you have time today for a debug call sometime?

@rapcmia just following up on my last comment and seeing if you can provide a few more details. Are you using a solana private key from phantom wallet, or another solana wallet? What bloxRoute authorization header are you using?

@rapcmia
Copy link
Contributor

rapcmia commented Jun 2, 2023

Hi @atulsriv good day to you
Apologies for the late response,

Are you using a solana private key from phantom wallet, or another solana wallet?`

  • Yes im using solana private key from phantom wallet:
    • Confirm bloxroute-openbook is available however getting the error even connect command wont work after adding API key ( bloxroute + solana phantom wallet )

What bloxRoute authorization header are you using?
We use the one on the https://portal.bloxroute.com/
image

Also if ever bloxroute team plan to add this connector, you may want to submit a Pull Request Proposal so we can add to our list and do further review. Thanks!

@atulsriv
Copy link
Author

atulsriv commented Jun 5, 2023

Hi @atulsriv good day to you Apologies for the late response,

Are you using a solana private key from phantom wallet, or another solana wallet?`

  • Yes im using solana private key from phantom wallet:
    • Confirm bloxroute-openbook is available however getting the error even connect command wont work after adding API key ( bloxroute + solana phantom wallet )

What bloxRoute authorization header are you using? We use the one on the https://portal.bloxroute.com/ image

Also if ever bloxroute team plan to add this connector, you may want to submit a Pull Request Proposal so we can add to our list and do further review. Thanks!

@rapcmia , please pull in the latest changes, it should resolve the error you are seeing. There were some out of sync changes from the latest master branch on the main hummingbot repo.

@atulsriv
Copy link
Author

Hi @atulsriv good day to you Apologies for the late response,
Are you using a solana private key from phantom wallet, or another solana wallet?`

  • Yes im using solana private key from phantom wallet:
    • Confirm bloxroute-openbook is available however getting the error even connect command wont work after adding API key ( bloxroute + solana phantom wallet )

What bloxRoute authorization header are you using? We use the one on the https://portal.bloxroute.com/ image
Also if ever bloxroute team plan to add this connector, you may want to submit a Pull Request Proposal so we can add to our list and do further review. Thanks!

@rapcmia , please pull in the latest changes, it should resolve the error you are seeing. There were some out of sync changes from the latest master branch on the main hummingbot repo.

@rapcmia did you get a chance to look at the above comment?

@atulsriv atulsriv marked this pull request as ready for review June 16, 2023 13:47
@fengtality
Copy link
Sponsor Contributor

To get the Foundation to review/merge this pull request and include this connector in ongoing releases, a New Connector Proposal needs to be submitted and approved. See https://hummingbot.org/governance/proposals/#new-connector-proposals for more information.

@hummingbot hummingbot deleted a comment from nikspz Jan 17, 2024
@youngrake
Copy link

is there any update per this?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants