Code Monkey home page Code Monkey logo

gateway's Introduction

Hummingbot

Hummingbot Gateway

Hummingbot Gateway is a REST API that exposes connections to various blockchains (wallet, node & chain interaction) and decentralized exchanges (pricing, trading & liquidity provision). It is written in Typescript and takes advantage of existing blockchain and DEX SDKs. The advantage of using gateway is it provideds a programming language agnostic approach to interacting with blockchains and DEXs.

Gateway may be used alongside the main Hummingbot client to enable trading on DEXs, or as a standalone module by external developers.

Installation via Docker

If you are installing Gateway alongside Hummingbot, check out the Deploy Examples repository that helps you deploy various types of Hummingbot and Gateway configurations. For most new users, we recommend following the Hummingbot Gateway Compose deployment.

The repo also contains Bash Scripts that help you install the Gateway Docker image on a standalone basis.

Installation from source

Dependencies:

  • NodeJS (16.0.0 or higher)
  • Yarn: run npm install -g yarn after installing NodeJS
# Install dependencies
yarn

# Complile Typescript into JS
$ yarn build

# Run Gateway setup script, which helps you set configs and CERTS_PATH
$ chmod a+x gateway-setup.sh
$ ./gateway-setup.sh

# Start the Gateway server using PASSPHRASE
$ yarn start --passphrase=<PASSPHRASE>

Build Docker image

To build the gateway docker image locally execute the below make command:

make docker

Pass the ${TAG} environmental variable to add a tag to the docker image. For example, the below command will create the hummingbot/gateway:dev image.

TAG=dev make docker

Documentation

See the official Gateway docs.

The API is documented using Swagger. When Gateway is started, it also generates Swagger API docs at: https://localhost:8080

Contributing

There are a number of ways to contribute to gateway.

Configuration

  • If you want to turn off https, set unsafeDevModeWithHTTP to true in conf/server.yml.

  • If you want Gateway to log to standard out, set logToStdOut to true in conf/server.yml.

  • The format of configuration files are dictated by src/services/config-manager-v2.ts and the corresponding schema files in src/services/schema.

  • If you want to turn off https, set unsafeDevModeWithHTTP to true in conf/server.yml.

  • For each supported chain, token lists that translate address to symbols for each chain are stored in /conf/lists. You can add tokens here to make them available to Gateway.

Architecture

Here are some files we recommend you look at in order to get familiar with the Gateway codebase:

Testing

For a pull request merged into the codebase, it has to pass unit test coverage requirements. Take a look at Workflow for more details.

Unit tests

Read this document for more details about how to write unit test in gateway: How we write unit tests for gateway.

Run all unit tests.

yarn test:unit

Run an individual test folder or file

yarn jest test/<folder>/<file>

Manual tests

We have found it is useful to test individual endpoints with curl commands. We have a collection of prepared curl calls. POST bodies are stored in JSON files. Take a look at the curl calls for gateway. Note that some environment variables are expected.

Linting

This repo uses eslint and prettier. When you run git commit it will trigger the pre-commit hook. This will run eslint on the src and test directories.

You can lint before committing with:

yarn run lint

You can run the prettifier before committing with:

yarn run prettier

gateway's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

gateway's Issues

Docker - Unhandled error in background tasks due to no such file or directory

Describe the bug
When setting up docker using bash scripts gateway-create.sh and selected {N, no}on the prompt Do you want to generate default token lists? [Y/N] it will still successfully create a docker gateway container and wont copy any to the conf/list/... folder resulting on the below screenshot error when connecting to any of hummingbot's DEX connector which is expected due to no such file or directory

image

Sample screenshot of tokenListSource
image

While this is true that there is an error, a user should be able to fix this by:

  1. Stop and delete the gateway docker container (sample container: gw1), docker stop gw1 && docker rm gw1
  2. Run the gateway-create.sh script again and this time make sure to select Y on prompt Do you want to generate default token lists? [Y/N] ๐Ÿ‘€

Steps To Reproduce

  • Run gateway-create.sh
  • Enter Gateway version you want to use [latest/latest-arm] โœ…
  • Enter a name for your new Gateway instance (default = "gateway") โœ…
  • Enter the folder name where your Gateway files will be saved (default = "xxx_files") โœ…
  • Enter the passphrase you used to generate certificates in Hummingbot โœ…
  • Do you want to proceed with installation? Y
    • Created gateway successfully
    • Do you want to generate certs from a Hummingbot instance? Y โœ…
    • Enter the path to the folder where Hummingbot certificates are stored โœ…
    • Do you want to generate default token lists? [Y/N] select N or press enter
  • Go back to client and setup connector

Release version
N/A, issue related to Deploy example's bash scripts which is related to gateway setup

(bug) nonce will sometimes decrement

Describe the bug

  • the /evm/nonce route will decrement after a while, causing the next tx sent by Gateway to fail
  • Only exists on development

Steps To Reproduce

Chain: binance-smart-chain
Network: mainnet
Connector: pancakeswap

Calling /evm/nonce on main:
Screen Shot 2023-03-13 at 4 26 42 PM

Calling /evm/nonce development, after Gateway server starts for 5 min:
Screen Shot 2023-03-13 at 4 31 34 PM

I believe this is related to do with the changes introduced for Injective:
https://github.com/hummingbot/gateway/blame/development/src/evm/evm.nonce.ts

Gateway logs not recorded using `docker-gateway`

the issue on logging docker-gateway

gateway logs not recorded in gateway_files/gateway_logs
using docker-gateway

Steps:

  1. Clone and install hummingbot using development branch
  2. Gateway generate_certs
  3. Set up gateway docker with ./create-gateway.sh
  4. Create/ Run amm_arb strategy
  5. Review gateway_files/logs

Actual:
No logs recorded for docker-gateway

Expected:
Gateway logs recorded, user could access to Gateway logs records

Gateway - getting price query failed error after restarting gateway connection

Gateway - after restart of the gateway Client failed to get access to the token list for amm_data_feed_example.py script

Steps To Reproduce

  1. Clone and install Source client + gateway
  2. gateway generate certs
  3. ./gateway-setup.sh
  4. yarn start --passphrase=password, make sure gateway is ONLINE
  5. connect quickswap and uniswap polygon mainnet
  6. start the script amm data_feed example
  7. check status and review script working
  8. stop the gateway
  9. yarn start --passphrase=password again and make sure gateway is ONLINE
  10. start the same script again

Actual:
review that bot Failed to get data from AmmDataFeed

Expected:
Client are able to start the script successfully again after restart of the gateway

Loom Video:
https://www.loom.com/share/c456e9e18ff04e47af9f5153b1393118

logs_amm_data_feed_example.log
logs_gateway_app.log


2023-07-19 15:01:18,451 - 439205 - hummingbot.data_feed.amm_gateway_data_feed - ERROR - Error getting data from AmmDataFeed[uniswap_polygon_mainnet]Check network connection. Error: Error on POST https://localhost:15888/amm/price Error: {'message': 'Price query failed: Token not supported: WMATIC', 'httpErrorCode': 500, 'errorCode': 1013, 'stack': 'Error: Price query failed: Token not supported: WMATIC\n    at /home/nikita/gwstaging/dist/src/connectors/uniswap/uniswap.controllers.js:74:23\n    at Generator.throw (<anonymous>)\n    at rejected (/home/nikita/gwstaging/dist/src/connectors/uniswap/uniswap.controllers.js:6:65)\n    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)'}
2023-07-19 15:01:18,452 - 439205 - hummingbot.data_feed.amm_gateway_data_feed - ERROR - Error getting data from AmmDataFeed[quickswap_polygon_mainnet]Check network connection. Error: Error on POST https://localhost:15888/amm/price Error: {'message': 'Price query failed: Token not supported: LINK', 'httpErrorCode': 500, 'errorCode': 1013, 'stack': 'Error: Price query failed: Token not supported: LINK\n    at /home/nikita/gwstaging/dist/src/connectors/uniswap/uniswap.controllers.js:74:23\n    at Generator.throw (<anonymous>)\n    at rejected (/home/nikita/gwstaging/dist/src/connectors/uniswap/uniswap.controllers.js:6:65)\n    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)'}
2023-07-19 15:01:18,770 - 439205 - hummingbot.connector.exchange.binance.binance_api_order_book_data_source.BinanceAPIOrderBookDataSource - INFO - Subscribed to public order book and trade channels...
2023-07-19 15:01:18,819 - 439205 - hummingbot.core.data_type.order_book_tracker - INFO - Initialized order book for BTC-USDT. 1/1 completed.
2023-07-19 15:01:19,001 - 439205 - hummingbot.strategy.script_strategy_base - WARNING - binance is not ready. Please wait...
2023-07-19 15:01:19,481 - 439205 - hummingbot.data_feed.amm_gateway_data_feed - ERROR - Error getting data from AmmDataFeed[quickswap_polygon_mainnet]Check network connection. Error: Error on POST https://localhost:15888/amm/price Error: {'message': 'Price query failed: Token not supported: WMATIC', 'httpErrorCode': 500, 'errorCode': 1013, 'stack': 'Error: Price query failed: Token not supported: WMATIC\n    at /home/nikita/gwstaging/dist/src/connectors/uniswap/uniswap.controllers.js:74:23\n    at Generator.throw (<anonymous>)\n    at rejected (/home/nikita/gwstaging/dist/src/connectors/uniswap/uniswap.controllers.js:6:65)\n    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)'}
2023-07-19 15:01:19,527 - 439205 - hummingbot.data_feed.amm_gateway_data_feed - ERROR - Error getting data from AmmDataFeed[uniswap_polygon_mainnet]Check network connection. Error: Error on POST https://localhost:15888/amm/price Error: {'message': 'Price query failed: Token not supported: LINK', 'httpErrorCode': 500, 'errorCode': 1013, 'stack': 'Error: Price query failed: Token not supported: LINK\n    at /home/nikita/gwstaging/dist/src/connectors/uniswap/uniswap.controllers.js:74:23\n    at Generator.throw (<anonymous>)\n    at rejected (/home/nikita/gwstaging/dist/src/connectors/uniswap/uniswap.controllers.js:6:65)\n    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)'}
2023-07-19 15:01:19,580 - 439205 - hummingbot.client.ui.hummingbot_cli - ERROR - Unhandled error in prompt_toolkit: Error on POST https://localhost:15888/amm/price Error: {'message': 'Price query failed: Token not supported: LINK', 'httpErrorCode': 500, 'errorCode': 1013, 'stack': 'Error: Price query failed: Token not supported: LINK\n    at /home/nikita/gwstaging/dist/src/connectors/uniswap/uniswap.controllers.js:74:23\n    at Generator.throw (<anonymous>)\n    at rejected (/home/nikita/gwstaging/dist/src/connectors/uniswap/uniswap.controllers.js:6:65)\n    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)'}
NoneType: None
2023-07-19 15:01:19,580 - 439205 - hummingbot.client.ui.hummingbot_cli - ERROR - Unhandled error in prompt_toolkit: Error on POST https://localhost:15888/amm/price Error: {'message': 'Price query failed: Token not supported: WMATIC', 'httpErrorCode': 500, 'errorCode': 1013, 'stack': 'Error: Price query failed: Token not supported: WMATIC\n    at /home/nikita/gwstaging/dist/src/connectors/uniswap/uniswap.controllers.js:74:23\n    at Generator.throw (<anonymous>)\n    at rejected (/home/nikita/gwstaging/dist/src/connectors/uniswap/uniswap.controllers.js:6:65)\n    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)'}
NoneType: None
2023-07-19 15:01:19,581 - 439205 - hummingbot.client.ui.hummingbot_cli - ERROR - Unhandled error in prompt_toolkit: Error on POST https://localhost:15888/amm/price Error: {'message': 'Price query failed: Token not supported: AAVE', 'httpErrorCode': 500, 'errorCode': 1013, 'stack': 'Error: Price query failed: Token not supported: AAVE\n    at /home/nikita/gwstaging/dist/src/connectors/uniswap/uniswap.controllers.js:74:23\n    at Generator.throw (<anonymous>)\n    at rejected (/home/nikita/gwstaging/dist/src/connectors/uniswap/uniswap.controllers.js:6:65)\n    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)'}
NoneType: None
2023-07-19 15:01:19,581 - 439205 - hummingbot.client.ui.hummingbot_cli - ERROR - Unhandled error in prompt_toolkit: Error on POST https://localhost:15888/amm/price Error: {'message': 'Price query failed: Token not supported: LINK', 'httpErrorCode': 500, 'errorCode': 1013, 'stack': 'Error: Price query failed: Token not supported: LINK\n    at /home/nikita/gwstaging/dist/src/connectors/uniswap/uniswap.controllers.js:74:23\n    at Generator.throw (<anonymous>)\n    at rejected (/home/nikita/gwstaging/dist/src/connectors/uniswap/uniswap.controllers.js:6:65)\n    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)'}
NoneType: None
2023-07-19 15:01:19,581 - 439205 - hummingbot.client.ui.hummingbot_cli - ERROR - Unhandled error in prompt_toolkit: Error on POST https://localhost:15888/amm/price Error: {'message': 'Price query failed: Token not supported: WMATIC', 'httpErrorCode': 500, 'errorCode': 1013, 'stack': 'Error: Price query failed: Token not supported: WMATIC\n    at /home/nikita/gwstaging/dist/src/connectors/uniswap/uniswap.controllers.js:74:23\n    at Generator.throw (<anonymous>)\n    at rejected (/home/nikita/gwstaging/dist/src/connectors/uniswap/uniswap.controllers.js:6:65)\n    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)'}
NoneType: None

Gateway - Failed to connect using existed wallet

Gateway - Failed to connect to the same chain using existed wallet. Issue reproduced using Avalanche and ethereum, polygon, BSC chains

Steps To Reproduce

  1. clone and install latest development branch
  2. gateway connect one connector with one chain (for example pangolin avalanche)
  3. check balance to make sure its connected
  4. gateway connect connector with the same chain (for example traderjoe avalanche)
  5. Do you want to connect to avalanche-avalanche with one of your existing wallets on Gateway? (Yes/No) >>> Yes
  6. Pick the wallet if its showed

Actual:
second connector not connected when chose case to connect existed wallet

Expected:
Bot able to connect using existed wallet

2023-03-27 07:33:13,077 - 2588670 - hummingbot.core.utils.async_utils - ERROR - Unhandled error in background task: local variable 'additional_prompt_values' referenced before assignment
Traceback (most recent call last):
  File "/home/ubuntu/development/hummingbot/core/utils/async_utils.py", line 9, in safe_wrapper
    return await c
  File "/home/ubuntu/development/hummingbot/client/command/gateway_command.py", line 315, in _gateway_connect
    additional_prompt_values=additional_prompt_values,
UnboundLocalError: local variable 'additional_prompt_values' referenced before assignment

Logs:
logs_hummingbot.log

Loom video:
https://www.loom.com/share/ac7bdd468f484454bbc2dbe98ed36d3a

image

Release version
dev-1.14.0 (commit 65e38b5)

NOTE: User still able to connect entering his private key, issue only in connecting using existed wallet

Docker Compose Method from DEV1.18 to Latest 1.18 gives errors

update config to latest
docker pull
docker compose pull
then docker compose up -d
then docker attach gateway
and then the gateway was looping like this:

Node.js v18.10.0
Gateway API server stopped unexpectedly. Restarting...
/home/gateway/dist/src/services/config-manager-v2.js:92
throw new Error(The JSON schema for namespace ${id} (${schemaPath}) does not exist.);
^

Error: The JSON schema for namespace defikingdoms (/home/gateway/dist/src/services/schema/defikingdoms-schema.json) does not exist.
at new ConfigurationNamespace (/home/gateway/dist/src/services/config-manager-v2.js:92:19)
at ConfigManagerV2.addNamespace (/home/gateway/dist/src/services/config-manager-v2.js:227:78)
at ConfigManagerV2.loadConfigRoot (/home/gateway/dist/src/services/config-manager-v2.js:296:18)
at new ConfigManagerV2 (/home/gateway/dist/src/services/config-manager-v2.js:193:14)
at ConfigManagerV2.getInstance (/home/gateway/dist/src/services/config-manager-v2.js:186:41)
at getLogPath (/home/gateway/dist/src/services/logger.js:43:55)
at Object. (/home/gateway/dist/src/services/logger.js:49:18)
at Module._compile (node:internal/modules/cjs/loader:1149:14)
at Module._extensions..js (node:internal/modules/cjs/loader:1203:10)
at Module.load (node:internal/modules/cjs/loader:1027:32)

Delete contents of folder restart no improvement

Ripple DEX/Chain connector

Description

Bounty

Injective protocol - No active order displayed and unable to cancel orders

Describe the bug
We can confirm that issue on wallet has been fix on hummingbot/hummingbot#6168 however when we tried to setup a simple PMM strategy, the client was able to create orders but at the same time getting order {order_id} has failed resulting to no active orders displayed. Crosschecking the Injective protocol website and confirmed orders are active.

image

It is also observed that it will not let us cancel the orders from the client resulting to:

  • Orders stuck on exchange
  • Docker logs shows DELETE endpoint submitted but orders are not removed (waited for 3-5mins, refreshed website)
  • Balance command displays allocated assets

image

image

Steps To Reproduce

  1. Setup client and gateway development branch
  2. Setup simple PMM and observe client / gateway behavior

Release version
dev-1.14.0
gateway development branch

Attachments
// It is important that you attach the required files for us to be able to investigate the issue.
// Please attach the chain.yml file from your gateway "conf" folder, e.g ethereum.yml

Injective protocol.zip

Gateway - Unable to use approve-token and getting token not supported error

Describe the bug
While testing the development branch + gateway (source), it was observed that the gateway approve-token does not seem to work as expected. In the past when using the connector it would approve but now on the new setup and repository it wont let us and can be reproduce using most of the gateway connectors

Pancakeswap-BSC
2023-02-13_10-25

Sushiswap-BSC
2023-02-13_10-25_1

Pangolin-Avalanche
2023-02-13_10-37

2023-02-13 11:01:54,307 - 27574 - hummingbot.client.hummingbot_application - INFO - stop command initiated.
2023-02-13 11:02:09,193 - 27574 - hummingbot.client.hummingbot_application - INFO - Connector pangolin Tokens 0xB31f66AA3C1e785363F0875A1B74E27b85FD66c7 will now be approved for spending for 'pangolin_avalanche_avalanche'.
2023-02-13 11:02:10,682 - 27574 - hummingbot.core.gateway.gateway_http_client - WARNING - Call to https://localhost:15888/evm/approve failed. See logs for more details.
2023-02-13 11:02:10,682 - 27574 - hummingbot.client.hummingbot_application - ERROR - Error approving tokens: Error on POST https://localhost:15888/evm/approve Error: {'message': 'Token not supported: 0xB31f66AA3C1e785363F0875A1B74E27b85FD66c7', 'httpErrorCode': 500, 'errorCode': 1006, 'stack': 'Error: Token not supported: 0xB31f66AA3C1e785363F0875A1B74E27b85FD66c7\n    at /Users/ralphcomia/hbot/github/gateway/dist/src/chains/ethereum/ethereum.controllers.js:134:19\n    at Generator.next (<anonymous>)\n    at fulfilled (/Users/ralphcomia/hbot/github/gateway/dist/src/chains/ethereum/ethereum.controllers.js:5:58)'}

Please see recording below using Pangolin-Avalanche and WAVAX-USDC as example

Note: _Users can still manually approve tokens via exchange website

Steps To Reproduce

  1. Setup client + gateway (source)
  2. Select any gateway connector
  3. Look for supported tokens, sample WETH, DAI, etc..
  4. Run gateway approve-token and observe the error message

Release version
N/a

Attachments
logs_amm-pangolin-test.log
logs_gateway_app.log.2023-02-13.log

WARNING: Do NOT publish any exchange API keys or your wallet's private key. Whoever has access to them may steal your assets!

Optional: your discord username:

Open ocean (polygon) transactions on AMM arbitrage fail with the error under priced

Describe the bug
Every time a transaction is submitted it says failed, I increased the gas price for polygon and gas limit for open ocean but it fails. It says "transaction underpriced".

Steps To Reproduce

  1. create amm bot with the connector open ocean polygon
  2. let it run
  3. every transaction through gateway fails.

Screenshots
image
from the gateway logs

image
from the log pane

Release version
1.15

Discord user: JelledJam (6,9)#6105

Injective protocol - Balance command does not display the correct values

Describe the bug
While testing a PR we noticed that the balance for Injective does not display the correct values. This makes the client not able to create orders due to insufficient balances

Note: Same wallet has been used for testing before and still got the assets available

Development client
image

image

Exchange account - https://helixapp.com/account
image

Steps To Reproduce

  1. Connect Injective wallet
  2. Run balance command
  3. Setup simple PMM and observe client behavior

Release version
// Include your bot's version number (Can be found at the upper left corner of your CLI).
Gateway development branch

Attachments
// It is important that you attach the required files for us to be able to investigate the issue.
// Please attach the chain.yml file from your gateway "conf" folder, e.g ethereum.yml
No config available, all settings are on default

Dexalot - Failed to cancel orders after pureMM strategy stopped

Dexalot - Failed to cancel orders after strategy stop, using pureMM strategy causing orders left uncancelled on the exchange side

Steps To Reproduce

  1. Clone and install latest development branch Client + gateway
  2. connect dexalot
  3. create pureMM strategy using dexalot
  4. review orders were created on the exchange side
  5. stop the strategy and review (failed) orders not cancelled

Loom video:
https://www.loom.com/share/97ede6889d8640c4be545680ff1a2649

logs_dexalotdev.log
dexalotdev.zip
image

Release version
dev-1.19.0

Wallet nonce is negative if it has never been used before on a chain

Describe the bug

If a users tries to use Gateway to send transactions with a wallet that has never been used before on a chain, Gateway throws errors because it tried to apply a negative nonce.

Steps To Reproduce

  • Use a new wallet on a chain
  • Approve a token, and get error
{
    "message": "Unknown error.",
    "httpErrorCode": 503,
    "errorCode": 1099,
    "stack": "Error: invalid hexlify value [ See: https://links.ethers.org/v5-errors-NUMERIC_FAULT ] (operation=\"checkSafeInteger\", fault=\"out-of-safe-range\", value=-1, code=NUMERIC_FAULT, version=bytes/5.7.0)\n    at Logger.makeError (/Users/feng/Code/gateway/node_modules/@ethersproject/wallet/node_modules/@ethersproject/logger/lib/index.js:238:21)\n    at Logger.throwError (/Users/feng/Code/gateway/node_modules/@ethersproject/wallet/node_modules/@ethersproject/logger/lib/index.js:247:20)\n    at Logger.checkSafeUint53 (/Users/feng/Code/gateway/node_modules/@ethersproject/wallet/node_modules/@ethersproject/logger/lib/index.js:285:18)\n    at hexlify (/Users/feng/Code/gateway/node_modules/@ethersproject/wallet/node_modules/@ethersproject/bytes/lib/index.js:151:16)\n    at /Users/feng/Code/gateway/node_modules/@ethersproject/wallet/node_modules/@ethersproject/transactions/lib/index.js:181:59\n    at Array.forEach (<anonymous>)\n    at _serialize (/Users/feng/Code/gateway/node_modules/@ethersproject/wallet/node_modules/@ethersproject/transactions/lib/index.js:175:23)\n    at serialize (/Users/feng/Code/gateway/node_modules/@ethersproject/wallet/node_modules/@ethersproject/transactions/lib/index.js:246:16)\n    at /Users/feng/Code/gateway/node_modules/@ethersproject/wallet/lib/index.js:163:116\n    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)"
}
  • Run /evm/nonce route:
{
    "nonce": -2
}

Proposed fix

Adjust /evm/nonce so that it is floored at 0 and make corresponding adjustments to nextNonce, etc

Uniswap router not returning prices

Describe the bug

Since yesterday I cannot get the price of a pair on uniswap polygon.

Steps to reproduce

  1. Clean install v17 source
  2. Create amm_arb strategy
  3. Start strategy - gets stuck on 'starting networking' - reports errors

image
Log files indicate:
2023-06-29 15:28:06,510 - 10872 - hummingbot.core.gateway.gateway_http_client - WARNING - Call to https://localhost:15888/amm/price failed. See logs for more details.
2023-06-29 15:28:06,510 - 10872 - GatewayEVMAMM - WARNING - Error on POST https://localhost:15888/amm/price Error: {'message': 'Price query failed: Request failed with status code 522', 'httpErrorCode': 500, 'errorCode': 1013, 'stack': 'Error: Price query failed: Request failed with status code 522\n at /home/toxicehc/gateway/dist/src/connectors/uniswap/uniswap.controllers.js:74:23\n at Generator.throw ()\n at rejected (/home/toxicehc/gateway/dist/src/connectors/uniswap/uniswap.controllers.js:6:65)\n at processTicksAndRejections (internal/process/task_queues.js:95:5)'}
2023-06-29 15:28:06,813 - 10872 - hummingbot.core.gateway.gateway_http_client - WARNING - Call to https://localhost:15888/amm/price failed. See logs for more details.
2023-06-29 15:28:06,814 - 10872 - GatewayEVMAMM - WARNING - Error on POST https://localhost:15888/amm/price Error: {'message': 'Price query failed: Request failed with status code 522', 'httpErrorCode': 500, 'errorCode': 1013, 'stack': 'Error: Price query failed: Request failed with status code 522\n at /home/toxicehc/gateway/dist/src/connectors/uniswap/uniswap.controllers.js:74:23\n at Generator.throw ()\n at rejected (/home/toxicehc/gateway/dist/src/connectors/uniswap/uniswap.controllers.js:6:65)\n at processTicksAndRejections (internal/process/task_queues.js:95:5)'}
2023-06-29 15:28:22,161 - 10872 - hummingbot.core.gateway.gateway_http_client - WARNING - Call to https://localhost:15888/amm/price failed. See logs for more details.
2023-06-29 15:28:22,161 - 10872 - GatewayEVMAMM - WARNING - Error on POST https://localhost:15888/amm/price Error: {'message': 'Price query failed: Request failed with status code 522', 'httpErrorCode': 500, 'errorCode': 1013, 'stack': 'Error: Price query failed: Request failed with status code 522\n at /home/toxicehc/gateway/dist/src/connectors/uniswap/uniswap.controllers.js:74:23\n at Generator.throw ()\n at rejected (/home/toxicehc/gateway/dist/src/connectors/uniswap/uniswap.controllers.js:6:65)\n at processTicksAndRejections (internal/process/task_queues.js:95:5)'}
2023-06-29 15:28:22,161 - 10872 - hummingbot.strategy.amm_arb.amm_arb - INFO - No arbitrage opportunity.

Release version

V1.17

Type of installation

Source

Attach required files

logs_hummingbot.log
logs_conf_amm_arb_1.log

UniswapLP - failed to remove liquidity (One of the tokens in this position isn't recognized)

Describe the bug
UniswapLP - failed to remove liquidity

Steps To Reproduce
0. You Have added liquidity with id 123456

  1. Clone and install latest development Client + gateway
  2. set it up gateway to ONLINE with generate certs and yarn start
  3. connect uniswap arbitrum_one
  4. set up GATEWAY_CERT, GATEWAY_KEY and ETH_ADDRESS
  5. change eth_uniswap_position network to arbitrum_one and tokenId to 123456
  6. execute curl -s -X POST -k --key $GATEWAY_KEY --cert $GATEWAY_CERT -H "Content-Type: application/json" -d "$(envsubst < ./requests/eth_uniswap_position.json)" https://localhost:15888/amm/liquidity/remove | jq

Actual:
Failed to remove liquidity with error:

"httpErrorCode": 503,
  "errorCode": 1099,
  "stack": "Error: One of the tokens in this position isn't recognized. $token0: undefined, $token1: undefined\n    at UniswapLP.<anonymous> (/home/nikita/gwtest1/dist/src/connectors/uniswap/uniswap.lp.helper.js:285:23)\n    at Generator.next (<anonymous>)\n    at fulfilled (/home/nikita/gwtest1/dist/src/connectors/uniswap/uniswap.lp.helper.js:28:58)\n    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)"

image
Release version
dev-1.18.0

Algorand chain/Tinyman DEX: can't add wallet

Describe the bug
When trying to connect to Tinyman (Dex on Algorand), the private key/mnemonic is not recognized and an error is thrown.

Steps To Reproduce
Connect to tinyman (testnet or mainnet, doesn't matter) and try to add your private key (or mnemonic, tested with both). An error is thrown

| error | The privateKey param is not a valid Algorand private key or mnemonic. | Error: The privateKey param is not a valid Algorand private key or mnemoc. at throwIfErrorsExist (/home/gateway/dist/src/services/validators.js:38:15) at /home/gateway/dist/src/services/validators.js:103:40 at /home/gateway/dist/src/services/wallet/wallet.routes.js:25:58 at Generator.next (<anonymous>) at /home/gateway/dist/src/services/wallet/wallet.routes.js:8:71 at new Promise (<anonymous>) at __awaiter (/home/gateway/dist/src/services/wallet/wallet.routes.js:4:12) at /home/gateway/dist/src/services/wallet/wallet.routes.js:24:86 at /home/gateway/dist/src/services/error-handler.js:37:28 at Layer.handle [as handle_request] (/home/gateway/node_modules/express/lib/router/layer.js:95:5)

I've tested it with the same private key/mnemonic that I use with the official Algorand SDK with no issues.

Release version
Tested with the latest docker image and installation from source (main and development branches)

V1.13 Install from source Gateway uniswap polygon nonce issue

Clean install from source cannot execute any transactions.

It kicks out this error on every single transaction:
2023-03-15 11:37:00 | info | Expected execution price is 0.047863, limit price is 0.047575326988000. | undefined
2023-03-15 11:37:00 | info | Providing the next nonce 258 for address[masked]. | undefined
2023-03-15 11:37:00 | error | Transaction with nonce 258 for address [masked] failed : Error: replacement fee too low [ See: https://links.ethers.org/v5-errors-REPLACEMENT_UNDERPRICED ] (error={"reason":"processing response error","code":"SERVER_ERROR","body":"{"jsonrpc":"2.0","id":35700,"error":{"code":-32000,"message":"replacement transaction underpriced"}}\n","error":{"code":-32000},"requestBody":"{"method":"eth_sendRawTransaction",

checking on oklink in the mempool there is no such nonce txn. Previous txn was 257.

Running a simple AMM ARB between HUOBI and Uniswap Polygon

Here are the steps to reproduce the issue (see attachments in the section below):

  1. Clean install V1.13 from Source
  2. Clean install Gateway from Source

Screenshots
image

Release version
V1.13

Optional: your discord username:
toxicehc#5599

uniswap_v3_lp error after opening position - One of the tokens in this position isn't recognized

Describe the bug
I'm running latest latest Hummingbot(1.18.0) and Gateway(1.18.0). The strategy i'm trying to run is uniswap_v3_lp on ethereum arbitrum one but I'm getting this error immediately after a position is added:

One of the tokens in this position isn't recognized. | Error: One of the tokens in this position isn't recognized.

Error in logs:

2023-07-25 13:49:08,017 - 29915 - GatewayEVMAMMLP - INFO - Created ADD liquidity order add-WETH-USDT-1690282143386635 txHash: 0xdf4772e2301b4cf7045538a7596bbb056b994754bf8ef05453eee0010703c930 on arbitrum_one. Estimated Gas Cost: 0.000015069000000000  (gas limit: 3000000, gas price: 0.1000000000000000055511151231257827021181583404541015625)
2023-07-25 13:49:08,018 - 29915 - hummingbot.core.event.event_reporter - EVENT_LOG - {"timestamp": 1690282148.0, "order_id": "add-WETH-USDT-1690282143386635", "exchange_order_id": "0xdf4772e2301b4cf7045538a7596bbb056b994754bf8ef05453eee0010703c930", "order_action": "LPType.ADD", "trading_pair": "WETH-USDT", "fee_tier": "LOWEST", "lower_price": "1846.253652335600000", "upper_price": "1864.808965424400000", "amount": "0.001000", "creation_timestamp": 1690282143.0, "token_id": 0, "event_name": "RangePositionUpdateEvent", "event_source": "uniswapLP_ethereum_arbitrum_one"}
GatewayEVMAMMLP - INFO - Liquidity added for position with ID 743687.
hummingbot.core.event.event_reporter - EVENT_LOG - {"timestamp": 1690282150.0, "order_id": "add-WETH-USDT-1690282143386635", "exchange_order_id": "0xdf4772e2301b4cf7045538a7596bbb056b994754bf8ef05453eee0010703c930", "trading_pair": "WETH-USDT", "lower_price": "1846.253652335600000", "upper_price": "1864.808965424400000", "amount": "0", "fee_tier": "LOWEST", "creation_timestamp": 1690282143.0, "trade_fee": {"percent": "0", "percent_token": null, "flat_fees": [{"token": "ETH", "amount": "0.0001393066000000000077330697401"}]}, "token_id": 743687, "event_name": "RangePositionLiquidityAddedEvent", "event_source": "uniswapLP_ethereum_arbitrum_one"}
hummingbot.core.gateway.gateway_http_client - WARNING - Call to https://localhost:15888/amm/liquidity/position failed. See logs for more details.
GatewayEVMAMMLP - ERROR - Error on POST https://localhost:15888/amm/liquidity/position Error: {'message': 'Unknown error.', 'httpErrorCode': 503, 'errorCode': 1099, 'stack': "Error: One of the tokens in this position isn't recognized.\n    at UniswapLP.<anonymous> (/gateway/dist/src/connectors/uniswap/uniswap.lp.js:76:23)\n    at Generator.next (<anonymous>)\n    at fulfilled (/gateway/dist/src/connectors/uniswap/uniswap.lp.js:28:58)\n    at processTicksAndRejections (node:internal/process/task_queues:96:5)"}
Traceback (most recent call last):
  File "/hummingbot/hummingbot/connector/gateway/amm_lp/gateway_evm_amm_lp.py", line 1097, in _status_polling_loop
    await safe_gather(
  File "/hummingbot/hummingbot/core/utils/async_utils.py", line 22, in safe_gather
    return await asyncio.gather(*args, **kwargs)
  File "/hummingbot/hummingbot/connector/gateway/amm_lp/gateway_evm_amm_lp.py", line 970, in update_nft
    raise nft_update_result
  File "/hummingbot/hummingbot/core/gateway/gateway_http_client.py", line 798, in amm_lp_position
    return await self.api_request("post", "amm/liquidity/position", request_payload)
  File "/hummingbot/hummingbot/core/gateway/gateway_http_client.py", line 218, in api_request
    raise e
  File "/hummingbot/hummingbot/core/gateway/gateway_http_client.py", line 206, in api_request
    raise ValueError(f"Error on {method.upper()} {url} Error: {parsed_response}")

Steps To Reproduce
Here are the steps to reproduce the issue (see attachments in the section below):

  1. Connect gateway to UniswapLP and ethereum arbitrum_one
  2. Choose uniswap_v3_lpStrategy as your strategy
  3. Start the strategy
  4. A new liquidity position should be created, but fail immediately after when the strategy tries to get the position info
    ...

Release version
1.18.0

Interact directly with the pool in Uniswap connector

Description

  • Users have reported that the Uniswap connector is slow compared to other connectors as well as other bots, resulting in missed arbitrage opportunities
  • This may be due to the fact that it uses the smart order router to estimate and execute trades, rather than getting a quote and executing a trade
  • Add the ability to use these direct methods rather than the router to the Uniswap connector as an option
  • Afterwards, estimateSellTrade, estimateBuyTrade, and executeTrade should be able to use the quote/trade methodology described in the Uniswap docs, but also the existing router method
  • The following variables to the Uniswap connector config should be added:
    • useRouter (bool): if True, estimation and execution functions use router; if false, use quote and trade functions of SDK;
    • feeTier (string): Matches one of the Uniswap fee tier strings. If useRouter is False, then user has to specify feeTier to find the right pool
  • Add these new variables to the Uniswap default config template. By default, useRouter should be True, and feeTier is "MEDIUM"

Bounty

  • Sponsor: Hummingbot Foundation
  • Bounty Type: Enhancement / Open Source
  • Bounty Amount: 100,000 HBOT (P1)
  • Developer Payment: 100,000 HBOT (100%)
  • Status: Open

Gateway - Failed to yarn start when `passhrase is numerical` (property must be of type string)

Gateway - Failed to yarn --start when passhrase is numerical

Steps:

  1. git clone -b development https://github.com/hummingbot/hummingbot.git development
  2. install, compile and start the bot
  3. for gateway generate-certs use numbers as passphrase (1234)
  4. open another terminal and clone gateway git clone -b development https://github.com/hummingbot/gateway gateway
  5. cd gateway && yarn && yarn build
  6. ./gateway-setup.sh
  7. yarn start --passphrase=1234

Actual:
Bot returns error and Failed to start
error | Failed to start the server with https. Confirm that the SSL certificate files exist and are correct. Error: TypeError [ERR_INVALID_ARG_TYPE]: The "options.passphrase" property must be of type string. Received type number (1234)

Expected:
Bot is able to start when passphrase is numbers

image

FYI: Issue was previously fixed here for gateway in hummingbot repo: hummingbot/hummingbot#6067

Simplify codes for xdc blockchain

Feature Suggestion

Below is the rpc of xdc blockchain

My previous codes is here: https://github.com/gzliudan/hummingbot/commits/xdc-release-1.12.0., it support both ofrpc nodes and erpc ndoes

1681125961661

James and others have done a lot of work to support the XDC blockchain in PR #45 which includes 42 commit, such as fork @ethersproject and ethers. In fact we can cut down rpc ndoes, and use erpc nodes only to do all tasks. Then a lots of commits in PR #45 are unnecessary, so the codes can be simplified greatly. This is what I did in new version: https://github.com/gzliudan/hummingbot-gateway/commits/xdc-release-1.13.0 .

1681181360901

So I suggest: remove the support of rpc nodes, kepp use erpc ndoes only.

Gateway - does not display gateway containers on gateway-copy-cert command

Describe the bug
While running some tests on docker build, the command gateway-copy-certs.sh does not display the containers that are under hummingbot/gateway

image

Checking the script the command docker ps -a --filter ancestor=hummingbot/gateway does not call containers under the hummingbot/gateway. Tried to look on the docs but no go and possible issue on docker side,

Note: created ticket for monitoring only

Steps To Reproduce

  1. Create at least two gateway docker build
  2. Run gateway-copy-certs.sh

Getting duplicate values for USDC.e on UI when starting AMM-arbitrage strategy

Describe the bug
Observed when checking USDC.e supported connectors the UI returns two tokens with same value when starting the AMM-Arbitrage strategy. This happened for both avalanche (traderjoe, pangoln) and uniswap (arbitrum_one) when we initially setup the gateway connector-token command with a set of tokens that would display on balance command

image

Steps To Reproduce

  1. Setup latest development client and gateway
  2. Setup connector-token command and add USDC.e or USDC.E
  3. Setup amm-arb with avalanche or uniswap arbitrum_one connector
  4. Observe the display balance upon starting the amm-arb

Release version
development 1.18.0 (gateway+client)

Attachments
no logs needed

Gateway - Typo or invalid config would return an Error: connection to gateway failed

Describe the bug
When you enter an incorrect parameters or typos when running gateway config insert-parameter-here the client would return Error: Connection to Gateway localhost:xxxx failed

image

Should it be that the client would return that its a invalid config or parameter?

Steps To Reproduce

  1. Setup client and gateway of any build
  2. Run gateway config xxx where xxx can be anything of a parameter with typos or random

Release version
master and development

UniswapLP - Error adding liquidity

Describe the bug

Error submitting ADD liquidity order to uniswapLP

Steps to reproduce

  1. Clone and install latest development on Client + gateway
  2. Create/start uniswapLP strategy
  3. Review logs

Actual:
Liquidity is not added.
Call to https://localhost:15888/amm/liquidity/add failed

Release version

dev-1.18.0

Type of installation

Source

Attach required files

logs_conf_uniswap_v3_lp_arb.log
logs_gateway_app.log
UniswapLP-issue.zip

2023-07-11 03:47:29,207 - 160986 - hummingbot.strategy.uniswap_v3_lp.uniswap_v3_lp - INFO - Creating new position over 1783.8557719765 to 1971.6300637635 price range. [clock=2023-07-11 03:47:29+00:00]
2023-07-11 03:47:29,631 - 160986 - hummingbot.core.rate_oracle.rate_oracle - INFO - Network status has changed to NetworkStatus.CONNECTED. Starting networking...
2023-07-11 03:47:33,964 - 160986 - hummingbot.core.gateway.gateway_http_client - NETWORK - An unknown error has occurred on gateway. Please send your logs to [email protected]
2023-07-11 03:47:33,964 - 160986 - hummingbot.core.gateway.gateway_http_client - NETWORK - Error on POST https://localhost:15888/amm/liquidity/add Error: {'message': 'Unknown error.', 'httpErrorCode': 503, 'errorCode': 1099, 'stack': 'Error: Request failed with status code 404\n    at createError (/home/nikita/gateway-dev/node_modules/axios/lib/core/createError.js:16:15)\n    at settle (/home/nikita/gateway-dev/node_modules/axios/lib/core/settle.js:17:12)\n    at IncomingMessage.handleStreamEnd (/home/nikita/gateway-dev/node_modules/axios/lib/adapters/http.js:269:11)\n    at IncomingMessage.emit (node:events:523:35)\n    at endReadableNT (node:internal/streams/readable:1367:12)\n    at process.processTicksAndRejections (node:internal/process/task_queues:82:21)'}
Traceback (most recent call last):
  File "/home/nikita/development/hummingbot/core/gateway/gateway_http_client.py", line 206, in api_request
    raise ValueError(f"Error on {method.upper()} {url} Error: {parsed_response}")
ValueError: Error on POST https://localhost:15888/amm/liquidity/add Error: {'message': 'Unknown error.', 'httpErrorCode': 503, 'errorCode': 1099, 'stack': 'Error: Request failed with status code 404\n    at createError (/home/nikita/gateway-dev/node_modules/axios/lib/core/createError.js:16:15)\n    at settle (/home/nikita/gateway-dev/node_modules/axios/lib/core/settle.js:17:12)\n    at IncomingMessage.handleStreamEnd (/home/nikita/gateway-dev/node_modules/axios/lib/adapters/http.js:269:11)\n    at IncomingMessage.emit (node:events:523:35)\n    at endReadableNT (node:internal/streams/readable:1367:12)\n    at process.processTicksAndRejections (node:internal/process/task_queues:82:21)'}
2023-07-11 03:47:33,965 - 160986 - hummingbot.core.gateway.gateway_http_client - WARNING - Call to https://localhost:15888/amm/liquidity/add failed. See logs for more details.
2023-07-11 03:47:33,965 - 160986 - GatewayEVMAMMLP - ERROR - Error submitting ADD liquidity order to uniswapLP on arbitrum_one for WETH-USDC.E 
Traceback (most recent call last):
  File "/home/nikita/development/hummingbot/connector/gateway/amm_lp/gateway_evm_amm_lp.py", line 436, in _add_liquidity
    order_result: Dict[str, Any] = await self._get_gateway_instance().amm_lp_add(
  File "/home/nikita/development/hummingbot/core/gateway/gateway_http_client.py", line 725, in amm_lp_add
    return await self.api_request("post", "amm/liquidity/add", request_payload)
  File "/home/nikita/development/hummingbot/core/gateway/gateway_http_client.py", line 218, in api_request
    raise e
  File "/home/nikita/development/hummingbot/core/gateway/gateway_http_client.py", line 206, in api_request
    raise ValueError(f"Error on {method.upper()} {url} Error: {parsed_response}")
ValueError: Error on POST https://localhost:15888/amm/liquidity/add Error: {'message': 'Unknown error.', 'httpErrorCode': 503, 'errorCode': 1099, 'stack': 'Error: Request failed with status code 404\n    at createError (/home/nikita/gateway-dev/node_modules/axios/lib/core/createError.js:16:15)\n    at settle (/home/nikita/gateway-dev/node_modules/axios/lib/core/settle.js:17:12)\n    at IncomingMessage.handleStreamEnd (/home/nikita/gateway-dev/node_modules/axios/lib/adapters/http.js:269:11)\n    at IncomingMessage.emit (node:events:523:35)\n    at endReadableNT (node:internal/streams/readable:1367:12)\n    at process.processTicksAndRejections (node:internal/process/task_queues:82:21)'}
2023-07-11 03:47:33,967 - 160986 - hummingbot.core.event.event_reporter - EVENT_LOG - {"timestamp": 1689047253.0, "order_id": "add-WETH-USDC.E-1689047249208333", "order_action": "LPType.ADD", "event_name": "RangePositionUpdateFailureEvent", "event_source": "uniswapLP_ethereum_arbitrum_one"}
2023-07-11 03:47:34,001 - 160986 - hummingbot.strategy.uniswap_v3_lp.uniswap_v3_lp - INFO - Creating new position over 1783.8557719765 to 1971.6300637635 price range. [clock=2023-07-11 03:47:34+00:00]
2023-07-11 03:47:38,631 - 160986 - hummingbot.core.gateway.gateway_http_client - NETWORK - An unknown error has occurred on gateway. Please send your logs to [email protected]
2023-07-11 03:47:38,631 - 160986 - hummingbot.core.gateway.gateway_http_client - NETWORK - Error on POST https://localhost:15888/amm/liquidity/add Error: {'message': 'Unknown error.', 'httpErrorCode': 503, 'errorCode': 1099, 'stack': 'Error: Request failed with status code 404\n    at createError (/home/nikita/gateway-dev/node_modules/axios/lib/core/createError.js:16:15)\n    at settle (/home/nikita/gateway-dev/node_modules/axios/lib/core/settle.js:17:12)\n    at IncomingMessage.handleStreamEnd (/home/nikita/gateway-dev/node_modules/axios/lib/adapters/http.js:269:11)\n    at IncomingMessage.emit (node:events:523:35)\n    at endReadableNT (node:internal/streams/readable:1367:12)\n    at process.processTicksAndRejections (node:internal/process/task_queues:82:21)'}
Traceback (most recent call last):
  File "/home/nikita/development/hummingbot/core/gateway/gateway_http_client.py", line 206, in api_request
    raise ValueError(f"Error on {method.upper()} {url} Error: {parsed_response}")
ValueError: Error on POST https://localhost:15888/amm/liquidity/add Error: {'message': 'Unknown error.', 'httpErrorCode': 503, 'errorCode': 1099, 'stack': 'Error: Request failed with status code 404\n    at createError (/home/nikita/gateway-dev/node_modules/axios/lib/core/createError.js:16:15)\n    at settle (/home/nikita/gateway-dev/node_modules/axios/lib/core/settle.js:17:12)\n    at IncomingMessage.handleStreamEnd (/home/nikita/gateway-dev/node_modules/axios/lib/adapters/http.js:269:11)\n    at IncomingMessage.emit (node:events:523:35)\n    at endReadableNT (node:internal/streams/readable:1367:12)\n    at process.processTicksAndRejections (node:internal/process/task_queues:82:21)'}
2023-07-11 03:47:38,631 - 160986 - hummingbot.core.gateway.gateway_http_client - WARNING - Call to https://localhost:15888/amm/liquidity/add failed. See logs for more details.
2023-07-11 03:47:38,632 - 160986 - GatewayEVMAMMLP - ERROR - Error submitting ADD liquidity order to uniswapLP on arbitrum_one for WETH-USDC.E 
Traceback (most recent call last):
  File "/home/nikita/development/hummingbot/connector/gateway/amm_lp/gateway_evm_amm_lp.py", line 436, in _add_liquidity
    order_result: Dict[str, Any] = await self._get_gateway_instance().amm_lp_add(
  File "/home/nikita/development/hummingbot/core/gateway/gateway_http_client.py", line 725, in amm_lp_add
    return await self.api_request("post", "amm/liquidity/add", request_payload)
  File "/home/nikita/development/hummingbot/core/gateway/gateway_http_client.py", line 218, in api_request
    raise e
  File "/home/nikita/development/hummingbot/core/gateway/gateway_http_client.py", line 206, in api_request
    raise ValueError(f"Error on {method.upper()} {url} Error: {parsed_response}")
ValueError: Error on POST https://localhost:15888/amm/liquidity/add Error: {'message': 'Unknown error.', 'httpErrorCode': 503, 'errorCode': 1099, 'stack': 'Error: Request failed with status code 404\n    at createError (/home/nikita/gateway-dev/node_modules/axios/lib/core/createError.js:16:15)\n    at settle (/home/nikita/gateway-dev/node_modules/axios/lib/core/settle.js:17:12)\n    at IncomingMessage.handleStreamEnd (/home/nikita/gateway-dev/node_modules/axios/lib/adapters/http.js:269:11)\n    at IncomingMessage.emit (node:events:523:35)\n    at endReadableNT (node:internal/streams/readable:1367:12)\n    at process.processTicksAndRejections (node:internal/process/task_queues:82:21)'}
2023-07-11 03:47:38,632 - 160986 - hummingbot.core.event.event_reporter - EVENT_LOG - {"timestamp": 1689047258.0, "order_id": "add-WETH-USDC.E-1689047254001869", "order_action": "LPType.ADD", "event_name": "RangePositionUpdateFailureEvent", "event_source": "uniswapLP_ethereum_arbitrum_one"}
2023-07-11 03:47:39,192 - 160986 - hummingbot.strategy.uniswap_v3_lp.uniswap_v3_lp - INFO - Creating new position over 1783.8557719765 to 1971.6300637635 price range. [clock=2023-07-11 03:47:39+00:00]
2023-07-11 03:47:43,225 - 160986 - hummingbot.core.gateway.gateway_http_client - NETWORK - An unknown error has occurred on gateway. Please send your logs to [email protected]
2023-07-11 03:47:43,225 - 160986 - hummingbot.core.gateway.gateway_http_client - NETWORK - Error on POST https://localhost:15888/amm/liquidity/add Error: {'message': 'Unknown error.', 'httpErrorCode': 503, 'errorCode': 1099, 'stack': 'Error: Request failed with status code 404\n    at createError (/home/nikita/gateway-dev/node_modules/axios/lib/core/createError.js:16:15)\n    at settle (/home/nikita/gateway-dev/node_modules/axios/lib/core/settle.js:17:12)\n    at IncomingMessage.handleStreamEnd (/home/nikita/gateway-dev/node_modules/axios/lib/adapters/http.js:269:11)\n    at IncomingMessage.emit (node:events:523:35)\n    at endReadableNT (node:internal/streams/readable:1367:12)\n    at process.processTicksAndRejections (node:internal/process/task_queues:82:21)'}
Traceback (most recent call last):
  File "/home/nikita/development/hummingbot/core/gateway/gateway_http_client.py", line 206, in api_request
    raise ValueError(f"Error on {method.upper()} {url} Error: {parsed_response}")
ValueError: Error on POST https://localhost:15888/amm/liquidity/add Error: {'message': 'Unknown error.', 'httpErrorCode': 503, 'errorCode': 1099, 'stack': 'Error: Request failed with status code 404\n    at createError (/home/nikita/gateway-dev/node_modules/axios/lib/core/createError.js:16:15)\n    at settle (/home/nikita/gateway-dev/node_modules/axios/lib/core/settle.js:17:12)\n    at IncomingMessage.handleStreamEnd (/home/nikita/gateway-dev/node_modules/axios/lib/adapters/http.js:269:11)\n    at IncomingMessage.emit (node:events:523:35)\n    at endReadableNT (node:internal/streams/readable:1367:12)\n    at process.processTicksAndRejections (node:internal/process/task_queues:82:21)'}
2023-07-11 03:47:43,226 - 160986 - hummingbot.core.gateway.gateway_http_client - WARNING - Call to https://localhost:15888/amm/liquidity/add failed. See logs for more details.
2023-07-11 03:47:43,226 - 160986 - GatewayEVMAMMLP - ERROR - Error submitting ADD liquidity order to uniswapLP on arbitrum_one for WETH-USDC.E 
Traceback (most recent call last):
  File "/home/nikita/development/hummingbot/connector/gateway/amm_lp/gateway_evm_amm_lp.py", line 436, in _add_liquidity
    order_result: Dict[str, Any] = await self._get_gateway_instance().amm_lp_add(
  File "/home/nikita/development/hummingbot/core/gateway/gateway_http_client.py", line 725, in amm_lp_add
    return await self.api_request("post", "amm/liquidity/add", request_payload)
  File "/home/nikita/development/hummingbot/core/gateway/gateway_http_client.py", line 218, in api_request
    raise e
  File "/home/nikita/development/hummingbot/core/gateway/gateway_http_client.py", line 206, in api_request
    raise ValueError(f"Error on {method.upper()} {url} Error: {parsed_response}")
ValueError: Error on POST https://localhost:15888/amm/liquidity/add Error: {'message': 'Unknown error.', 'httpErrorCode': 503, 'errorCode': 1099, 'stack': 'Error: Request failed with status code 404\n    at createError (/home/nikita/gateway-dev/node_modules/axios/lib/core/createError.js:16:15)\n    at settle (/home/nikita/gateway-dev/node_modules/axios/lib/core/settle.js:17:12)\n    at IncomingMessage.handleStreamEnd (/home/nikita/gateway-dev/node_modules/axios/lib/adapters/http.js:269:11)\n    at IncomingMessage.emit (node:events:523:35)\n    at endReadableNT (node:internal/streams/readable:1367:12)\n    at process.processTicksAndRejections (node:internal/process/task_queues:82:21)'}
2023-07-11 03:47:43,226 - 160986 - hummingbot.core.event.event_reporter - EVENT_LOG - {"timestamp": 1689047263.0, "order_id": "add-WETH-USDC.E-1689047259192714", "order_action": "LPType.ADD", "event_name": "RangePositionUpdateFailureEvent", "event_source": "uniswapLP_ethereum_arbitrum_one"}
2023-07-11 03:47:44,001 - 160986 - hummingbot.strategy.uniswap_v3_lp.uniswap_v3_lp - INFO - Creating new position over 1783.8557719765 to 1971.6300637635 price range. [clock=2023-07-11 03:47:44+00:00]
2023-07-11 03:47:50,807 - 160986 - hummingbot.core.gateway.gateway_http_client - NETWORK - An unknown error has occurred on gateway. Please send your logs to [email protected]
2023-07-11 03:47:50,808 - 160986 - hummingbot.core.gateway.gateway_http_client - NETWORK - Error on POST https://localhost:15888/amm/liquidity/add Error: {'message': 'Unknown error.', 'httpErrorCode': 503, 'errorCode': 1099, 'stack': 'Error: Request failed with status code 404\n    at createError (/home/nikita/gateway-dev/node_modules/axios/lib/core/createError.js:16:15)\n    at settle (/home/nikita/gateway-dev/node_modules/axios/lib/core/settle.js:17:12)\n    at IncomingMessage.handleStreamEnd (/home/nikita/gateway-dev/node_modules/axios/lib/adapters/http.js:269:11)\n    at IncomingMessage.emit (node:events:523:35)\n    at endReadableNT (node:internal/streams/readable:1367:12)\n    at process.processTicksAndRejections (node:internal/process/task_queues:82:21)'}
Traceback (most recent call last):
  File "/home/nikita/development/hummingbot/core/gateway/gateway_http_client.py", line 206, in api_request
    raise ValueError(f"Error on {method.upper()} {url} Error: {parsed_response}")
ValueError: Error on POST https://localhost:15888/amm/liquidity/add Error: {'message': 'Unknown error.', 'httpErrorCode': 503, 'errorCode': 1099, 'stack': 'Error: Request failed with status code 404\n    at createError (/home/nikita/gateway-dev/node_modules/axios/lib/core/createError.js:16:15)\n    at settle (/home/nikita/gateway-dev/node_modules/axios/lib/core/settle.js:17:12)\n    at IncomingMessage.handleStreamEnd (/home/nikita/gateway-dev/node_modules/axios/lib/adapters/http.js:269:11)\n    at IncomingMessage.emit (node:events:523:35)\n    at endReadableNT (node:internal/streams/readable:1367:12)\n    at process.processTicksAndRejections (node:internal/process/task_queues:82:21)'}
2023-07-11 03:47:50,809 - 160986 - hummingbot.core.gateway.gateway_http_client - WARNING - Call to https://localhost:15888/amm/liquidity/add failed. See logs for more details.
2023-07-11 03:47:50,810 - 160986 - GatewayEVMAMMLP - ERROR - Error submitting ADD liquidity order to uniswapLP on arbitrum_one for WETH-USDC.E 
Traceback (most recent call last):
  File "/home/nikita/development/hummingbot/connector/gateway/amm_lp/gateway_evm_amm_lp.py", line 436, in _add_liquidity
    order_result: Dict[str, Any] = await self._get_gateway_instance().amm_lp_add(
  File "/home/nikita/development/hummingbot/core/gateway/gateway_http_client.py", line 725, in amm_lp_add
    return await self.api_request("post", "amm/liquidity/add", request_payload)
  File "/home/nikita/development/hummingbot/core/gateway/gateway_http_client.py", line 218, in api_request
    raise e
  File "/home/nikita/development/hummingbot/core/gateway/gateway_http_client.py", line 206, in api_request
    raise ValueError(f"Error on {method.upper()} {url} Error: {parsed_response}")
ValueError: Error on POST https://localhost:15888/amm/liquidity/add Error: {'message': 'Unknown error.', 'httpErrorCode': 503, 'errorCode': 1099, 'stack': 'Error: Request failed with status code 404\n    at createError (/home/nikita/gateway-dev/node_modules/axios/lib/core/createError.js:16:15)\n    at settle (/home/nikita/gateway-dev/node_modules/axios/lib/core/settle.js:17:12)\n    at IncomingMessage.handleStreamEnd (/home/nikita/gateway-dev/node_modules/axios/lib/adapters/http.js:269:11)\n    at IncomingMessage.emit (node:events:523:35)\n    at endReadableNT (node:internal/streams/readable:1367:12)\n    at process.processTicksAndRejections (node:internal/process/task_queues:82:21)'}
2023-07-11 03:47:50,811 - 160986 - hummingbot.core.event.event_reporter - EVENT_LOG - {"timestamp": 1689047270.0, "order_id": "add-WETH-USDC.E-1689047264001833", "order_action": "LPType.ADD", "event_name": "RangePositionUpdateFailureEvent", "event_source": "uniswapLP_ethereum_arbitrum_one"}
2023-07-11 03:47:51,209 - 160986 - hummingbot.strategy.uniswap_v3_lp.uniswap_v3_lp - INFO - Creating new position over 1783.8557719765 to 1971.6300637635 price range. [clock=2023-07-11 03:47:51+00:00]
2023-07-11 03:47:57,827 - 160986 - hummingbot.core.gateway.gateway_http_client - NETWORK - An unknown error has occurred on gateway. Please send your logs to [email protected]
2023-07-11 03:47:57,828 - 160986 - hummingbot.core.gateway.gateway_http_client - NETWORK - Error on POST https://localhost:15888/amm/liquidity/add Error: {'message': 'Unknown error.', 'httpErrorCode': 503, 'errorCode': 1099, 'stack': 'Error: Request failed with status code 404\n    at createError (/home/nikita/gateway-dev/node_modules/axios/lib/core/createError.js:16:15)\n    at settle (/home/nikita/gateway-dev/node_modules/axios/lib/core/settle.js:17:12)\n    at IncomingMessage.handleStreamEnd (/home/nikita/gateway-dev/node_modules/axios/lib/adapters/http.js:269:11)\n    at IncomingMessage.emit (node:events:523:35)\n    at endReadableNT (node:internal/streams/readable:1367:12)\n    at process.processTicksAndRejections (node:internal/process/task_queues:82:21)'}
Traceback (most recent call last):
  File "/home/nikita/development/hummingbot/core/gateway/gateway_http_client.py", line 206, in api_request
    raise ValueError(f"Error on {method.upper()} {url} Error: {parsed_response}")
ValueError: Error on POST https://localhost:15888/amm/liquidity/add Error: {'message': 'Unknown error.', 'httpErrorCode': 503, 'errorCode': 1099, 'stack': 'Error: Request failed with status code 404\n    at createError (/home/nikita/gateway-dev/node_modules/axios/lib/core/createError.js:16:15)\n    at settle (/home/nikita/gateway-dev/node_modules/axios/lib/core/settle.js:17:12)\n    at IncomingMessage.handleStreamEnd (/home/nikita/gateway-dev/node_modules/axios/lib/adapters/http.js:269:11)\n    at IncomingMessage.emit (node:events:523:35)\n    at endReadableNT (node:internal/streams/readable:1367:12)\n    at process.processTicksAndRejections (node:internal/process/task_queues:82:21)'}
2023-07-11 03:47:57,828 - 160986 - hummingbot.core.gateway.gateway_http_client - WARNING - Call to https://localhost:15888/amm/liquidity/add failed. See logs for more details.
2023-07-11 03:47:57,828 - 160986 - GatewayEVMAMMLP - ERROR - Error submitting ADD liquidity order to uniswapLP on arbitrum_one for WETH-USDC.E 
Traceback (most recent call last):
  File "/home/nikita/development/hummingbot/connector/gateway/amm_lp/gateway_evm_amm_lp.py", line 436, in _add_liquidity
    order_result: Dict[str, Any] = await self._get_gateway_instance().amm_lp_add(
  File "/home/nikita/development/hummingbot/core/gateway/gateway_http_client.py", line 725, in amm_lp_add
    return await self.api_request("post", "amm/liquidity/add", request_payload)
  File "/home/nikita/development/hummingbot/core/gateway/gateway_http_client.py", line 218, in api_request
    raise e
  File "/home/nikita/development/hummingbot/core/gateway/gateway_http_client.py", line 206, in api_request
    raise ValueError(f"Error on {method.upper()} {url} Error: {parsed_response}")
ValueError: Error on POST https://localhost:15888/amm/liquidity/add Error: {'message': 'Unknown error.', 'httpErrorCode': 503, 'errorCode': 1099, 'stack': 'Error: Request failed with status code 404\n    at createError (/home/nikita/gateway-dev/node_modules/axios/lib/core/createError.js:16:15)\n    at settle (/home/nikita/gateway-dev/node_modules/axios/lib/core/settle.js:17:12)\n    at IncomingMessage.handleStreamEnd (/home/nikita/gateway-dev/node_modules/axios/lib/adapters/http.js:269:11)\n    at IncomingMessage.emit (node:events:523:35)\n    at endReadableNT (node:internal/streams/readable:1367:12)\n    at process.processTicksAndRejections (node:internal/process/task_queues:82:21)'}
2023-07-11 03:47:57,829 - 160986 - hummingbot.core.event.event_reporter - EVENT_LOG - {"timestamp": 1689047277.0, "order_id": "add-WETH-USDC.E-1689047271210465", "order_action": "LPType.ADD", "event_name": "RangePositionUpdateFailureEvent", "event_source": "uniswapLP_ethereum_arbitrum_one"}

image

Failed to create multiple containers with same tag using ./gateway-create.sh (error `container version latest already exist` and Aborting creation)

Bot fails to create another container with ./gateway-create.sh (if it using same tag)

before (1.12 master): image:container1, image:container2
now: image:container1, image:container2(not possible)

Steps to reproduce:

  1. Clone and install bot development branch
  2. create and set up one container using ./gateway-create.sh (with latest tag)
  3. make sure that container with latest tag created
  4. try to create another container using ./gateway-create.sh and default tag (latest)

Actual:
User failed to create second/another container using ./gateway-create.sh
Bot returns an error and Aborting creation
container version latest already exist, Remove existing container before creating new one

Expected:
Users should be able to create multiple docker containers using script

image

Bug: Value error due to underscore in `arbitrum_one`

Describe the bug
When using arbitrum for DEX connector on scripts like amm_data_feed_example, we are getting a returning ValueError: too many values to unpack (expected 3)

image

2023-07-18 14:15:33,851 - 8163 - GatewayEVMAMM - INFO - Network status has changed to NetworkStatus.CONNECTED. Starting networking...
2023-07-18 14:15:34,001 - 8163 - hummingbot.strategy.script_strategy_base - WARNING - uniswap_ethereum_arbitrum_one is not ready. Please wait...
2023-07-18 14:15:35,000 - 8163 - hummingbot.strategy.script_strategy_base - WARNING - uniswap_ethereum_arbitrum_one is not ready. Please wait...
2023-07-18 14:15:36,001 - 8163 - hummingbot.strategy.script_strategy_base - WARNING - uniswap_ethereum_arbitrum_one is not ready. Please wait...
2023-07-18 14:15:37,001 - 8163 - hummingbot.strategy.script_strategy_base - WARNING - uniswap_ethereum_arbitrum_one is not ready. Please wait...
2023-07-18 14:15:39,002 - 8163 - hummingbot.core.utils.async_utils - ERROR - Unhandled error in background task: too many values to unpack (expected 3)
Traceback (most recent call last):
  File "/Users/rapcomia/github/hummingbot/development/hummingbot/core/utils/async_utils.py", line 9, in safe_wrapper
    return await c
  File "/Users/rapcomia/github/hummingbot/development/scripts/amm_price_example.py", line 31, in async_task
    connector, chain, network = self.connector_chain_network.split("_")
ValueError: too many values to unpack (expected 3)
2023-07-18 14:15:39,965 - 8163 - hummingbot.core.rate_oracle.rate_oracle - INFO - Network status has changed to NetworkStatus.CONNECTED. Starting networking...

Steps To Reproduce
Use uniswap_ethereum_arbitrum_one when running AMM scripts found on ./scripts folder

Release version
dev-1.19.0

PancakeV3 connector

Description

  • Add connector to PancakeV3
  • Since Hummingbot already supports UniswapV3 and has a Uniswap V3 LP strattegy, the work is to replicate the UniswapV3 code architecture for PancakeV3 so that the UniswapV3 LP strategy works on PancakeSwap.

Bounty

Refactor chain endpoint structure

Description

  • Currently, chain-specific endpoints are in folders in the main directory, ie. /evm/ and /near
  • These endpoints are duplicative and will be difficult to maintain in the future
  • Refactor the endpoints so that there is only a single /chain/ set of endpoints
  • Each endpoint request should include a chain parameter
  • Raise NotImplemented for chains that don't implement that particular endpoint
  • Modify unit tests

Bounty

  • Sponsor: Hummingbot Foundation
  • Bounty amount: 50,000 HBOT (P2)
  • Developer portion: 100%
  • Status: OPEN

Balancer connector

Description

  • A connector to Balancer (https://balancer.fi/)
  • Should implement the Uniswapish class
  • Support ethereum, arbitrum and polygon chains
  • Contains unit tests and meets % coverage requirements

See existing work: hummingbot/hummingbot#5535

Bounty

Improve error handling when users run Gateway commands when Gateway is offline

Describe the bug
Part of possible improvement on UX is the error responses if user is not aware that gateway is offline.
image

There are instances users forget to setup gateway and directly check the list of available amm-connectors using gateway list command resulting to error Unhandled error in background task: Cannot connect to host localhost:15888 ssl:default which we believe is expected yet should better handled with simple and user friendly?
image

2023-05-17 11:18:30,140 - 886 - hummingbot.core.gateway.gateway_http_client - WARNING - Call to https://localhost:15888/connectors failed. See logs for more details.
2023-05-17 11:18:30,140 - 886 - hummingbot.core.utils.async_utils - ERROR - Unhandled error in background task: Cannot connect to host localhost:15888 ssl:default [Connect call failed ('127.0.0.1', 15888)]
Traceback (most recent call last):
  File "/home/rapcmia/miniconda3/envs/hummingbot/lib/python3.8/site-packages/aiohttp/connector.py", line 969, in _wrap_create_connection
    return await self._loop.create_connection(*args, **kwargs)  # type: ignore  # noqa
  File "/home/rapcmia/miniconda3/envs/hummingbot/lib/python3.8/asyncio/base_events.py", line 1025, in create_connection
    raise exceptions[0]
  File "/home/rapcmia/miniconda3/envs/hummingbot/lib/python3.8/asyncio/base_events.py", line 1010, in create_connection
    sock = await self._connect_sock(
  File "/home/rapcmia/miniconda3/envs/hummingbot/lib/python3.8/asyncio/base_events.py", line 924, in _connect_sock
    await self.sock_connect(sock, address)
  File "/home/rapcmia/miniconda3/envs/hummingbot/lib/python3.8/asyncio/selector_events.py", line 494, in sock_connect
    return await fut
  File "/home/rapcmia/miniconda3/envs/hummingbot/lib/python3.8/asyncio/selector_events.py", line 526, in _sock_connect_cb
    raise OSError(err, f'Connect call failed {address}')
ConnectionRefusedError: [Errno 111] Connect call failed ('127.0.0.1', 15888)

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "/home/rapcmia/github/hummingbot/dev/hummingbot/core/utils/async_utils.py", line 9, in safe_wrapper
    return await c
  File "/home/rapcmia/github/hummingbot/dev/hummingbot/client/command/gateway_command.py", line 415, in _gateway_list
    connector_list: List[Dict[str, Any]] = await self._get_gateway_instance().get_connectors()
  File "/home/rapcmia/github/hummingbot/dev/hummingbot/core/gateway/gateway_http_client.py", line 255, in get_connectors
    return await self.api_request("get", "connectors", fail_silently=fail_silently)
  File "/home/rapcmia/github/hummingbot/dev/hummingbot/core/gateway/gateway_http_client.py", line 218, in api_request
    raise e
  File "/home/rapcmia/github/hummingbot/dev/hummingbot/core/gateway/gateway_http_client.py", line 185, in api_request
    response = await client.get(url)
  File "/home/rapcmia/miniconda3/envs/hummingbot/lib/python3.8/site-packages/aiohttp/client.py", line 520, in _request
    conn = await self._connector.connect(
  File "/home/rapcmia/miniconda3/envs/hummingbot/lib/python3.8/site-packages/aiohttp/connector.py", line 535, in connect
    proto = await self._create_connection(req, traces, timeout)
  File "/home/rapcmia/miniconda3/envs/hummingbot/lib/python3.8/site-packages/aiohttp/connector.py", line 892, in _create_connection
    _, proto = await self._create_direct_connection(req, traces, timeout)
  File "/home/rapcmia/miniconda3/envs/hummingbot/lib/python3.8/site-packages/aiohttp/connector.py", line 1051, in _create_direct_connection
    raise last_exc
  File "/home/rapcmia/miniconda3/envs/hummingbot/lib/python3.8/site-packages/aiohttp/connector.py", line 1020, in _create_direct_connection
    transp, proto = await self._wrap_create_connection(
  File "/home/rapcmia/miniconda3/envs/hummingbot/lib/python3.8/site-packages/aiohttp/connector.py", line 975, in _wrap_create_connection
    raise client_error(req.connection_key, exc) from exc
aiohttp.client_exceptions.ClientConnectorError: Cannot connect to host localhost:15888 ssl:default [Connect call failed ('127.0.0.1', 15888)]

Steps To Reproduce

  1. Setup client + gateway on either source/docker build
  2. Run gateway list and observe behavior

Release version
Master and development branch

Attachments
// It is important that you attach the required files for us to be able to investigate the issue.
// Please attach the chain.yml file from your gateway "conf" folder, e.g ethereum.yml
logs_hummingbot.log

Dexalot - Unable to submit orders followed by error fetching status update for the active order

Describe the bug
When checking dexalot connector, observed that on the client it shows an active order for few seconds and eventually removed followed by an Error fetching status update for the active order.... Also while it is true that there is active order on status, the log panel does not indicate a successful created order and no order available on exchange

Screen.Recording.2023-08-16.at.7.15.29.PM.mov

On the recording above:

  • Observed that it displayed an order yet no "created successfully" on log panel
  • Active order on the status would eventually disappear after few minutes and followed with an error:
2023-08-16 11:16:10,135 - 15 - hummingbot.connector.gateway.clob_spot.gateway_clob_spot.GatewayCLOBSPOT - WARNING - Error fetching status update for the active order 0x0000000000000000001a8ecc747aee4b313d4fcd504eef4c7d7311e204a5923a: 'NoneType' object has no attribute 'get'.
2023-08-16 11:16:16,681 - 15 - hummingbot.core.event.event_reporter - EVENT_LOG - {"timestamp": 1692184576.0, "order_id": "0x0000000000000000001a8ecc747aee4b313d4fcd504eef4c7d7311e204a5923a", "order_type": "OrderType.LIMIT_MAKER", "event_name": "MarketOrderFailureEvent", "event_source": "dexalot_avalanche_dexalot"}
2023-08-16 11:16:16,681 - 15 - hummingbot.connector.client_order_tracker - INFO - Order 0x0000000000000000001a8ecc747aee4b313d4fcd504eef4c7d7311e204a5923a has failed. Order Update: OrderUpdate(trading_pair='AVAX-USDC', update_timestamp=1692184576.6427057, new_state=<OrderState.FAILED: 6>, client_order_id='0x0000000000000000001a8ecc747aee4b313d4fcd504eef4c7d7311e204a5923a', exchange_order_id=None, misc_updates=None)
2023-08-16 11:16:24,818 - 15 - hummingbot.client.hummingbot_application - INFO - stop command initiated.

Ran for few more hours and no luck on getting an order submitted to the exchange, account has enough balance to create and running on a cloud server

Steps To Reproduce

  1. Setup dexalot on PMM
  2. Observe behavior

Release version
dev-1.19.0

Attachments
logs_pmm-dexalot-02.log
pmm-dexalot-02.yml.log remove the .log

UniswapLP Polygon mainnet - 'Token not supported' error

Original issue: hummingbot/hummingbot#6099

--
Whatever I do on Polygon, I always get "Token not supported"

Steps to reproduce:

Created clean docker instance
Created gateway with 'gateway create'
Set up uniswap and uniswapLP with appropriate information and keys
Created strategy with uni_v3_lp on pair WMATIC-USDC
"start"
Release: latest / 1.12.0

log snippet:

...
2023-02-20 01:23:45 | error | Token not supported: WMATIC | Error: Token not supported: WMATIC
at getFullTokenFromSymbol (/usr/src/app/dist/src/connectors/uniswap/uniswap.controllers.js:303:15)
at /usr/src/app/dist/src/connectors/uniswap/uniswap.controllers.js:278:24
at Generator.next ()
at /usr/src/app/dist/src/connectors/uniswap/uniswap.controllers.js:8:71
at new Promise ()
at __awaiter (/usr/src/app/dist/src/connectors/uniswap/uniswap.controllers.js:4:12)
at poolPrice (/usr/src/app/dist/src/connectors/uniswap/uniswap.controllers.js:276:12)
at /usr/src/app/dist/src/amm/amm.controllers.js:79:52
at Generator.next ()
at fulfilled (/usr/src/app/dist/src/amm/amm.controllers.js:5:58)
at process.processTicksAndRejections (node:internal/process/task_queues:95:5)

`/amm/price` returns prices for non-existent pools on Sushiswap Goerli

Describe the bug

  • Call /amm/price for WETH-DAI on Sushiswap Goerli:
{
    "network": "goerli",
    "timestamp": 1678831599966,
    "latency": 0.482,
    "base": "0xB4FBF271143F4FBf7B91A5ded31805e42b2208d6",
    "quote": "0xdc31Ee1784292379Fbb2964b3B9C4124D8F89C60",
    "amount": "0.010000000000000000",
    "rawAmount": "10000000000000000",
    "expectedAmount": "1196132100000",
    "price": "117267850000000",
    "gasPrice": 33,
    "gasPriceToken": "ETH",
    "gasLimit": 3000000,
    "gasCost": "0.004972704000000000"
}

It returns a result, but a call to /amm/trade fails:
https://goerli.etherscan.io/tx/0x077d5c96cbf1b1c9b8a8d96e89ec7bd85baeb19a983ed29ae5f7190e09fd3995

There doesn't appear to be a pool for this pair:
Screen Shot 2023-03-14 at 3 16 30 PM

Expected result

  • Calling /amm/price should result in an error with "No trade found" message
  • Hummingbot client's amm-arb strategy should be able to handle this type of error

Uniswap - Getting unhandled error when using USDC.e

Describe the bug
While checking uniswap connector specifically arbitrum_one, we observed that when you use USDC.e as your token and managed to get a trade opportunity using amm-arbirage the client would return an error of Unhandled error in background task: 'USDC.e'

image

2023-07-03 20:21:38,001 - 13734 - hummingbot.core.utils.async_utils - ERROR - Unhandled error in background task: 'USDC.e'
Traceback (most recent call last):
  File "/home/rapcmia/github/hummingbot/dev/hummingbot/core/utils/async_utils.py", line 9, in safe_wrapper
    return await c
  File "/home/rapcmia/github/hummingbot/dev/hummingbot/strategy/amm_arb/amm_arb.py", line 232, in main
    await self.apply_slippage_buffers(profitable_arb_proposals)
  File "/home/rapcmia/github/hummingbot/dev/hummingbot/strategy/amm_arb/amm_arb.py", line 258, in apply_slippage_buffers
    arb_side.amount = market.quantize_order_amount(arb_side.market_info.trading_pair, arb_side.amount)
  File "hummingbot/connector/connector_base.pyx", line 481, in hummingbot.connector.connector_base.ConnectorBase.quantize_order_amount
    return self.c_quantize_order_amount(trading_pair, amount)
  File "hummingbot/connector/connector_base.pyx", line 474, in hummingbot.connector.connector_base.ConnectorBase.c_quantize_order_amount
    order_size_quantum = self.c_get_order_size_quantum(trading_pair, amount)
  File "hummingbot/connector/connector_base.pyx", line 453, in hummingbot.connector.connector_base.ConnectorBase.c_get_order_size_quantum
    return self.get_order_size_quantum(trading_pair, order_size)
  File "/home/rapcmia/github/hummingbot/dev/hummingbot/connector/gateway/amm/gateway_evm_amm.py", line 838, in get_order_size_quantum
    return max(self._amount_quantum_dict[base], self._amount_quantum_dict[quote])
KeyError: 'USDC.e'

While this is true that is returning an error, a workaround is to make sure to use USDC.E instead, below is a screenshot that works and able to arbitrage
image

Steps To Reproduce

  1. Setup latest development for both gateway and client
  2. Connect uniswap arbitrum wallet
  3. Setup simple AMM arb and observe behavior when setting market either USDC.e or USDC.E

Release version
Development 1.18.0, client + gateway

Attachments
logs_amm-arb.log
logs_gateway_app.log - Copy.2023-07-03.log
amm-arb.yml.log

gateway-network/config failed and unhandled error

unable to connect to etheruem network

Steps To Reproduce
// A concise description of the steps to reproduce the buggy behavior:Deploy Hummingbot and Gateway Instances in the hummingbot _gateway_compose file using wsl ubuntu

Here are the steps to reproduce the issue (see attachments in the section below):

  1. install wsl ubuntu and docker desktop
  2. follow the step from the readme in the hummingbot _gateway_compose file
    3 gateway connect uniswap and then get error

// If applicable, add screenshots to help explain your problem.

Release version-=1. 17. 0

file etheruem.yml docker-compose.yml

raphael@Raph3_ ~_deploy-examples_hummingbot_gateway_compose 2023-07-20 5_26_33 PM

**Optional: your discord username:whitechiken

Gateway - Unhandled error in background task: 'AMM'

Describe the bug
When checking latest client and gateway development setup, an hummingbot.core.utils.async_utils - ERROR - Unhandled error in background task: 'AMM' occurred after successfully connected AMM-connector wallets

image

2023-05-19 18:54:39,322 - 5669 - hummingbot.core.gateway.gateway_status_monitor - INFO - Gateway Service is ONLINE.
2023-05-19 18:55:22,297 - 5669 - hummingbot.core.utils.async_utils - ERROR - Unhandled error in background task: 'AMM'
Traceback (most recent call last):
  File "/home/rapcmia/github/hummingbot/dev/hummingbot/core/utils/async_utils.py", line 9, in safe_wrapper
    return await c
  File "/home/rapcmia/github/hummingbot/dev/hummingbot/client/command/gateway_command.py", line 321, in _gateway_connect
    AllConnectorSettings.create_connector_settings()
  File "/home/rapcmia/github/hummingbot/dev/hummingbot/client/settings.py", line 435, in create_connector_settings
    type=ConnectorType[connection_spec["trading_type"]],
  File "/home/rapcmia/miniconda3/envs/hummingbot/lib/python3.8/enum.py", line 344, in __getitem__
    return cls._member_map_[name]
KeyError: 'AMM'
2023-05-19 18:55:33,427 - 5669 - hummingbot.core.gateway.gateway_status_monitor - INFO - Connection to Gateway container lost...
2023-05-19 19:00:59,963 - 5669 - hummingbot.core.gateway.gateway_status_monitor - INFO - Gateway Service is ONLINE.
2023-05-19 19:01:49,052 - 6383 - hummingbot.core.gateway.gateway_status_monitor - INFO - Gateway Service is ONLINE.
2023-05-19 19:02:28,435 - 6415 - hummingbot.core.gateway.gateway_status_monitor - INFO - Gateway Service is ONLINE.
2023-05-19 19:03:57,789 - 6456 - hummingbot.core.gateway.gateway_status_monitor - INFO - Gateway Service is ONLINE.
2023-05-19 19:06:57,483 - 8193 - hummingbot.core.gateway.gateway_status_monitor - INFO - Gateway Service is ONLINE.
2023-05-19 19:07:14,489 - 8193 - hummingbot.core.utils.async_utils - ERROR - Unhandled error in background task: 'AMM'
Traceback (most recent call last):
  File "/home/rapcmia/github/hummingbot/dev/hummingbot/core/utils/async_utils.py", line 9, in safe_wrapper
    return await c
  File "/home/rapcmia/github/hummingbot/dev/hummingbot/client/command/gateway_command.py", line 321, in _gateway_connect
    AllConnectorSettings.create_connector_settings()
  File "/home/rapcmia/github/hummingbot/dev/hummingbot/client/settings.py", line 435, in create_connector_settings
    type=ConnectorType[connection_spec["trading_type"]],
  File "/home/rapcmia/miniconda3/envs/hummingbot/lib/python3.8/enum.py", line 344, in __getitem__
    return cls._member_map_[name]
KeyError: 'AMM'

This error also affects the client when we tried to relaunch making it unusable at the moment.
image

  • Work around is to delete the ../conf/gateway_connections.json file and client will work again
  • The last working commit was 6d7b639ddd219b4fad60b7cf612c2a81c2bf0076
  • Crosscheck on mbp(m1) and WSL ubuntu20.04 getting same behavior

Steps To Reproduce

  1. Setup client and gateway latest development branch
  2. Connect any AMM connector wallet then observe behavior
  3. Relaunch client to observe behavior of the bug

Release version
Development dev-1.16.0

Attachments
logs_hummingbot.log

POST price and POST trade not working for specific pair on Pancakeswap

Describe the bug
When I call POST /amm/price for the token pair USDT-HYPC, I get the following error:

Error: Price query failed: call revert exception [ See: https://links.ethers.org/v5-errors-CALL_EXCEPTION ]

However, the same request for the WBNB-HYPC pair works just fine.

Steps To Reproduce

Here are the steps to reproduce the issue (see attachments in the section below):

  1. First add HYPC to the pancakeswap token list.
    name: Hypercycle
    symbol: HYPC
    address: 0x7881cD2B5724431372F57C50E91611352557A606
    nr of decimals: 6

Note the number of decimals being lower than usual.

(By the way, I did not find an image to use, so I just used the image of a random other token in the list - this shouldn't be a problem right?)

see also the contract address here: https://bscscan.com/token/0x7881cd2b5724431372f57c50e91611352557a606

  1. Approve HYPC for trading on pancakeswap.

  2. in Postman, run POST amm/price for the WBNB-HYPC pair, just to ensure that this one is working just fine.

  3. Then do the same for the USDT-HYPC pair. This is where I get the error.
    ...

Screenshots
Screenshots added of postman results.
Screenshot from 2023-05-30 15-43-38
Screenshot from 2023-05-30 15-44-03
Screenshot from 2023-05-30 15-44-17

Release version
I did not use hummingbot for this but for what it's worth my version is 1.15.0.

Attachments
Attached the chain.yml file, as well as the token list I used.
chainyml file and bep20 token list.zip

WARNING: Do NOT publish any exchange API keys or your wallet's private key. Whoever has access to them may steal your assets!

Optional: your discord username:
BlueFish#5562

Can't decrypt SSL certs

Describe the bug
// A clear and concise description of what the bug is.

A Botcamp student reported that they are unable to start Gateway b/c of a decryption issue

Steps To Reproduce

  • User is on Ubuntu 22.04.2 LTS, on VirtualBox / Windows 10.
  • User installed Gateway from source

image-1

image

The error shown seems to indicate that the cert files are present, but Gateway is unable to decrypt them.

QA: Please try to replicate this issue.

Permission issues on conf directory

Describe the bug

The Dockerfile does not set permissions for the /usr/src/app/conf/ directory, as with other dirs (https://github.com/hummingbot/gateway/blob/development/Dockerfile#L36), thus it causes gateway to crash on startup due to access error on that path.

2023-03-26-155040_951x375_scrot

This does not happen when the gateway-create.sh script is used because the permissions are set by the script, thus it is not a generic solution. The Dockerfile should set these permissions, thus making it possible to use other deployment schemas, other than the gateway-create.sh script. Such cases include compose and the usage of docker volumes.

Discord discussion: https://discord.com/channels/530578568154054663/1004143639733215392/1079418334199685120

Steps To Reproduce

Start gateway via docker without the gateway-create.sh script.

Release version

1.13.0 / development branch

Discord username: klpanagi

Gateway - Run "gateway connect <amm-connector>" while offline resulting to unhandled error

Describe the bug
Part of possible improvement on UX is the error responses if user is not aware that gateway is offline.
image

For the gateway connect command, this error happens if user trying to setup amm-connector, uniswap for example
image

2023-05-17 11:07:05,771 - 718 - hummingbot.core.utils.async_utils - ERROR - Unhandled error in background task: [Errno 2] No such file or directory
Traceback (most recent call last):
  File "/home/rapcmia/github/hummingbot/dev/hummingbot/core/utils/async_utils.py", line 9, in safe_wrapper
    return await c
  File "/home/rapcmia/github/hummingbot/dev/hummingbot/client/command/gateway_command.py", line 172, in _gateway_connect
    connector_configs: Dict[str, Any] = await self._get_gateway_instance().get_connectors()
  File "/home/rapcmia/github/hummingbot/dev/hummingbot/core/gateway/gateway_http_client.py", line 255, in get_connectors
    return await self.api_request("get", "connectors", fail_silently=fail_silently)
  File "/home/rapcmia/github/hummingbot/dev/hummingbot/core/gateway/gateway_http_client.py", line 174, in api_request
    client = self._http_client(self._client_config_map)
  File "/home/rapcmia/github/hummingbot/dev/hummingbot/core/gateway/gateway_http_client.py", line 82, in _http_client
    ssl_ctx = ssl.create_default_context(cafile=f"{cert_path}/ca_cert.pem")
  File "/home/rapcmia/miniconda3/envs/hummingbot/lib/python3.8/ssl.py", line 745, in create_default_context
    context.load_verify_locations(cafile, capath, cadata)
FileNotFoundError: [Errno 2] No such file or directory

Suggestion: It would be better if we have a response that gateway connection is offline or equivalent for better UX

Steps To Reproduce

  1. Setup client + gateway on either source/docker build
  2. Run gateway connect <amm-connector> and observe behavior

Release version
Master and Development branch

Attachments
// It is important that you attach the required files for us to be able to investigate the issue.
// Please attach the chain.yml file from your gateway "conf" folder, e.g ethereum.yml
logs_hummingbot.log

Auto-copy token lists into `/conf/lists`

Description

  • In the last release, token lists were moved into the /conf/lists directory, allowing users to edit token lists for each chain
  • They are not copied by default, which is why Docker users have to run a separate docker cp... command
  • Since the config .yml files are copied by default into /conf , this should be possible for the lists as well
  • Take over this PR: #146

Bounty

  • Sponsor: Hummingbot Foundation
  • Budget: HGP-26
  • Classification: P3
  • Bounty: 10,000 HBOT
  • Developer share: 100% - paid upon merge to development
  • Status: Assigned to @vic-en since he has experience with Gateway codebase

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.