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

General improvements to gateway #5381

Merged

Conversation

james-hummingbot
Copy link
Contributor

Before submitting this PR, please make sure:

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

A description of the changes proposed in the pull request:

  • Make amm_arb handle MarketOrderFailureEvent properly
  • Update GatewayInFlightOrder to use InFlightOrder
  • Include nonce expiry for each nonce tracked and nonce architecture in general
  • Improve ConfigManagerV2 error messages
  • Add more details about gateway status in hummingbot
  • Use autorouter for uniswap
  • improve output from gateway status
  • avoid logging /network/status calls
  • simplify gateway create logic when infura api key is added
  • make initial docker not found error less technical and scary.

Tests performed by the developer:

Tips for QA testing:
Try running hummingbot and gateway with various amm_arb strategies and exchanges.

Daniel Tan and others added 30 commits May 3, 2022 22:20
…nce_manager

(feat) Include nonce expiry in `NonceManager`
@vic-en
Copy link
Contributor

vic-en commented Jun 24, 2022

@rapcmia The pr is ready again.
I also caught a bug at the approval stage and fixed that as well.

Let me know if you have any other issues.

@rapcmia
Copy link
Contributor

rapcmia commented Jun 27, 2022

PR update:

  • Tested commit 7995641a4 and confirmed we are able to run trades for Uniswap kovan testnet now successfully
  • Trade data on history, CSV and Txhash for uniswap-kovan matched and all ok
  • Tested sushiswap-kovan and we are able to trigger no arbitrage opportunity for WETH-DAI / ETH-DAI pair

However when we are testing the trade execution for sushiswap-kovan, we are getting Error: nonce has already been used [ See: https://links.ethers.org/v5-errors-NONCE_EXPIRED which doesn't happen on uniswap-kovan when testing multiple trades. We are under the impression that its something to do with Sushiswap connector? please advise, thank you

Client logs

2022-06-27 03:18:22,968 - 261943 - hummingbot.strategy.amm_arb.amm_arb - INFO - Placing SELL order for 0.010000000000000 WETH at sushiswap_ethereum_kovan at 4197.084111000000000 price [clock=2022-06-27 03:18:22+00:00]
2022-06-27 03:18:28,811 - 261943 - hummingbot.core.gateway.gateway_http_client - INFO - An unknown error has occurred on gateway. Please send your logs to dev@hummingbot.io
2022-06-27 03:18:28,811 - 261943 - hummingbot.core.gateway.gateway_http_client - ERROR - Error on POST https://localhost:24745/amm/trade Error: {'message': 'Unknown error.', 'httpErrorCode': 503, 'errorCode': 1099, 'stack': 'Error: nonce has already been used [ See: https://links.ethers.org/v5-errors-NONCE_EXPIRED ] (error={"reason":"processing response error","code":"SERVER_ERROR","body":"{\\"jsonrpc\\":\\"2.0\\",\\"id\\":257,\\"error\\":{\\"code\\":-32010,\\"message\\":\\"Transaction nonce is too low. Try incrementing the nonce.\\"}}","error":{"code":-32010},"requestBody":"{\\"method\\":\\"eth_sendRawTransaction\\",\\"params\\":[\\"0x02f901732a820518847866c108847866c108832dc6c0941b02da8cb0d097eb8d57a175b88c7d8b4799750680b9010438ed1739000000000000000000000000000000000000000000000000002386f26fc1000000000000000000000000000000000000000000000000000240cf47966e28bbd400000000000000000000000000000000000000000000000000000000000000a0000000000000000000000000e1f9bd605b2d6817c86bec8ee6f5e610e253f7df0000000000000000000000000000000000000000000000000000000062b923d90000000000000000000000000000000000000000000000000000000000000002000000000000000000000000d0a1e359811322d97991e03f863a0c30c2cf029c0000000000000000000000004f96fe3b7a6cf9725f59d353f723c1bdb64ca6aac001a03f0e12de9799eefe313afd450254fc209542ecaeecb57fdce02a8448f1072a46a02ebcbe4374d7b855b3c5cc9e50667f04a9e4b12bba84e509626d4f195f167185\\"],\\"id\\":257,\\"jsonrpc\\":\\"2.0\\"}","requestMethod":"POST","url":"https://kovan.infura.io/v3/my-api-key"}, method="sendTransaction", transaction="0x02f901732a820518847866c108847866c108832dc6c0941b02da8cb0d097eb8d57a175b88c7d8b4799750680b9010438ed1739000000000000000000000000000000000000000000000000002386f26fc1000000000000000000000000000000000000000000000000000240cf47966e28bbd400000000000000000000000000000000000000000000000000000000000000a0000000000000000000000000e1f9bd605b2d6817c86bec8ee6f5e610e253f7df0000000000000000000000000000000000000000000000000000000062b923d90000000000000000000000000000000000000000000000000000000000000002000000000000000000000000d0a1e359811322d97991e03f863a0c30c2cf029c0000000000000000000000004f96fe3b7a6cf9725f59d353f723c1bdb64ca6aac001a03f0e12de9799eefe313afd450254fc209542ecaeecb57fdce02a8448f1072a46a02ebcbe4374d7b855b3c5cc9e50667f04a9e4b12bba84e509626d4f195f167185", code=NONCE_EXPIRED, version=providers/5.6.8)\n    at Logger.makeError (/usr/src/app/node_modules/@ethersproject/logger/src.ts/index.ts:261:28)\n    at Logger.throwError (/usr/src/app/node_modules/@ethersproject/logger/src.ts/index.ts:273:20)\n    at checkError (/usr/src/app/node_modules/@ethersproject/providers/src.ts/json-rpc-provider.ts:105:16)\n    at StaticJsonRpcProvider.<anonymous> (/usr/src/app/node_modules/@ethersproject/providers/src.ts/json-rpc-provider.ts:603:20)\n    at step (/usr/src/app/node_modules/@ethersproject/providers/lib/json-rpc-provider.js:48:23)\n    at Object.throw (/usr/src/app/node_modules/@ethersproject/providers/lib/json-rpc-provider.js:29:53)\n    at rejected (/usr/src/app/node_modules/@ethersproject/providers/lib/json-rpc-provider.js:21:65)\n    at processTicksAndRejections (node:internal/process/task_queues:96:5)'}
2022-06-27 03:18:28,811 - 261943 - GatewayEVMAMM - ERROR - Error submitting SELL swap order to sushiswap on kovan for 0.010000000000000 WETH-DAI 4197.084111000000000.
Traceback (most recent call last):
  File "/home/ubuntu/github/5381/hummingbot/connector/gateway_EVM_AMM.py", line 520, in _create_order
    order_result: Dict[str, Any] = await GatewayHttpClient.get_instance().amm_trade(
  File "/home/ubuntu/github/5381/hummingbot/core/gateway/gateway_http_client.py", line 403, in amm_trade
    return await self.api_request("post", "amm/trade", request_payload)
  File "/home/ubuntu/github/5381/hummingbot/core/gateway/gateway_http_client.py", line 167, in api_request
    raise e
  File "/home/ubuntu/github/5381/hummingbot/core/gateway/gateway_http_client.py", line 163, in api_request
    raise ValueError(f"Error on {method.upper()} {url} Error: {parsed_response}")
ValueError: Error on POST https://localhost:24745/amm/trade Error: {'message': 'Unknown error.', 'httpErrorCode': 503, 'errorCode': 1099, 'stack': 'Error: nonce has already been used [ See: https://links.ethers.org/v5-errors-NONCE_EXPIRED ] (error={"reason":"processing response error","code":"SERVER_ERROR","body":"{\\"jsonrpc\\":\\"2.0\\",\\"id\\":257,\\"error\\":{\\"code\\":-32010,\\"message\\":\\"Transaction nonce is too low. Try incrementing the nonce.\\"}}","error":{"code":-32010},"requestBody":"{\\"method\\":\\"eth_sendRawTransaction\\",\\"params\\":[\\"0x02f901732a820518847866c108847866c108832dc6c0941b02da8cb0d097eb8d57a175b88c7d8b4799750680b9010438ed1739000000000000000000000000000000000000000000000000002386f26fc1000000000000000000000000000000000000000000000000000240cf47966e28bbd400000000000000000000000000000000000000000000000000000000000000a0000000000000000000000000e1f9bd605b2d6817c86bec8ee6f5e610e253f7df0000000000000000000000000000000000000000000000000000000062b923d90000000000000000000000000000000000000000000000000000000000000002000000000000000000000000d0a1e359811322d97991e03f863a0c30c2cf029c0000000000000000000000004f96fe3b7a6cf9725f59d353f723c1bdb64ca6aac001a03f0e12de9799eefe313afd450254fc209542ecaeecb57fdce02a8448f1072a46a02ebcbe4374d7b855b3c5cc9e50667f04a9e4b12bba84e509626d4f195f167185\\"],\\"id\\":257,\\"jsonrpc\\":\\"2.0\\"}","requestMethod":"POST","url":"https://kovan.infura.io/v3/my-api-key"}, method="sendTransaction", transaction="0x02f901732a820518847866c108847866c108832dc6c0941b02da8cb0d097eb8d57a175b88c7d8b4799750680b9010438ed1739000000000000000000000000000000000000000000000000002386f26fc1000000000000000000000000000000000000000000000000000240cf47966e28bbd400000000000000000000000000000000000000000000000000000000000000a0000000000000000000000000e1f9bd605b2d6817c86bec8ee6f5e610e253f7df0000000000000000000000000000000000000000000000000000000062b923d90000000000000000000000000000000000000000000000000000000000000002000000000000000000000000d0a1e359811322d97991e03f863a0c30c2cf029c0000000000000000000000004f96fe3b7a6cf9725f59d353f723c1bdb64ca6aac001a03f0e12de9799eefe313afd450254fc209542ecaeecb57fdce02a8448f1072a46a02ebcbe4374d7b855b3c5cc9e50667f04a9e4b12bba84e509626d4f195f167185", code=NONCE_EXPIRED, version=providers/5.6.8)\n    at Logger.makeError (/usr/src/app/node_modules/@ethersproject/logger/src.ts/index.ts:261:28)\n    at Logger.throwError (/usr/src/app/node_modules/@ethersproject/logger/src.ts/index.ts:273:20)\n    at checkError (/usr/src/app/node_modules/@ethersproject/providers/src.ts/json-rpc-provider.ts:105:16)\n    at StaticJsonRpcProvider.<anonymous> (/usr/src/app/node_modules/@ethersproject/providers/src.ts/json-rpc-provider.ts:603:20)\n    at step (/usr/src/app/node_modules/@ethersproject/providers/lib/json-rpc-provider.js:48:23)\n    at Object.throw (/usr/src/app/node_modules/@ethersproject/providers/lib/json-rpc-provider.js:29:53)\n    at rejected (/usr/src/app/node_modules/@ethersproject/providers/lib/json-rpc-provider.js:21:65)\n    at processTicksAndRejections (node:internal/process/task_queues:96:5)'}
2022-06-27 03:18:28,816 - 261943 - hummingbot.core.event.event_reporter - EVENT_LOG - {"timestamp": 1656299908.0, "order_id": "sell-WETH-DAI-1656299902968774", "order_type": "OrderType.LIMIT", "event_name": "MarketOrderFailureEvent", "event_source": "sushiswap_ethereum_kovan"}
2022-06-27 03:18:28,816 - 261943 - hummingbot.connector.client_order_tracker - INFO - Order sell-WETH-DAI-1656299902968774 has failed. Order Update: OrderUpdate(trading_pair='WETH-DAI', update_timestamp=1656299908.0, new_state=<OrderState.FAILED: 6>, client_order_id='sell-WETH-DAI-1656299902968774', exchange_order_id=None, misc_updates=None)
2022-06-27 03:18:28,816 - 261943 - hummingbot.strategy.amm_arb.amm_arb - ERROR - Order sell-WETH-DAI-1656299902968774 seems to have failed in this arbitrage opportunity. Dropping Arbitrage Proposal.  [clock=2022-06-27 03:18:28+00:00]

Docker logs:

2022-06-27 04:38:25 | info | 	Expected execution price is 4239.478856, limit price is 4197.084111000000000. | undefined
2022-06-27 04:38:28 | error | 	nonce has already been used [ See: https://links.ethers.org/v5-errors-NONCE_EXPIRED ] (error={"reason":"processing response error","code":"SERVER_ERROR","body":"{\"jsonrpc\":\"2.0\",\"id\":257,\"error\":{\"code\":-32010,\"message\":\"Transaction nonce is too low. Try incrementing the nonce.\"}}","error":{"code":-32010},"requestBody":"{\"method\":\"eth_sendRawTransaction\",\"params\":[\"0x02f901732a820518847866c108847866c108832dc6c0941b02da8cb0d097eb8d57a175b88c7d8b4799750680b9010438ed1739000000000000000000000000000000000000000000000000002386f26fc1000000000000000000000000000000000000000000000000000240cf47966e28bbd400000000000000000000000000000000000000000000000000000000000000a0000000000000000000000000e1f9bd605b2d6817c86bec8ee6f5e610e253f7df0000000000000000000000000000000000000000000000000000000062b923d90000000000000000000000000000000000000000000000000000000000000002000000000000000000000000d0a1e359811322d97991e03f863a0c30c2cf029c0000000000000000000000004f96fe3b7a6cf9725f59d353f723c1bdb64ca6aac001a03f0e12de9799eefe313afd450254fc209542ecaeecb57fdce02a8448f1072a46a02ebcbe4374d7b855b3c5cc9e50667f04a9e4b12bba84e509626d4f195f167185\"],\"id\":257,\"jsonrpc\":\"2.0\"}","requestMethod":"POST","url":"https://kovan.infura.io/v3/my-api-key"}, method="sendTransaction", transaction="0x02f901732a820518847866c108847866c108832dc6c0941b02da8cb0d097eb8d57a175b88c7d8b4799750680b9010438ed1739000000000000000000000000000000000000000000000000002386f26fc1000000000000000000000000000000000000000000000000000240cf47966e28bbd400000000000000000000000000000000000000000000000000000000000000a0000000000000000000000000e1f9bd605b2d6817c86bec8ee6f5e610e253f7df0000000000000000000000000000000000000000000000000000000062b923d90000000000000000000000000000000000000000000000000000000000000002000000000000000000000000d0a1e359811322d97991e03f863a0c30c2cf029c0000000000000000000000004f96fe3b7a6cf9725f59d353f723c1bdb64ca6aac001a03f0e12de9799eefe313afd450254fc209542ecaeecb57fdce02a8448f1072a46a02ebcbe4374d7b855b3c5cc9e50667f04a9e4b12bba84e509626d4f195f167185", code=NONCE_EXPIRED, version=providers/5.6.8) | Error: nonce has already been used [ See: https://links.ethers.org/v5-errors-NONCE_EXPIRED ] (error={"reason":"processing response error","code":"SERVER_ERROR","body":"{\"jsonrpc\":\"2.0\",\"id\":257,\"error\":{\"code\":-32010,\"message\":\"Transaction nonce is too low. Try incrementing the nonce.\"}}","error":{"code":-32010},"requestBody":"{\"method\":\"eth_sendRawTransaction\",\"params\":[\"0x02f901732a820518847866c108847866c108832dc6c0941b02da8cb0d097eb8d57a175b88c7d8b4799750680b9010438ed1739000000000000000000000000000000000000000000000000002386f26fc1000000000000000000000000000000000000000000000000000240cf47966e28bbd400000000000000000000000000000000000000000000000000000000000000a0000000000000000000000000e1f9bd605b2d6817c86bec8ee6f5e610e253f7df0000000000000000000000000000000000000000000000000000000062b923d90000000000000000000000000000000000000000000000000000000000000002000000000000000000000000d0a1e359811322d97991e03f863a0c30c2cf029c0000000000000000000000004f96fe3b7a6cf9725f59d353f723c1bdb64ca6aac001a03f0e12de9799eefe313afd450254fc209542ecaeecb57fdce02a8448f1072a46a02ebcbe4374d7b855b3c5cc9e50667f04a9e4b12bba84e509626d4f195f167185\"],\"id\":257,\"jsonrpc\":\"2.0\"}","requestMethod":"POST","url":"https://kovan.infura.io/v3/my-api-key"}, method="sendTransaction", transaction="0x02f901732a820518847866c108847866c108832dc6c0941b02da8cb0d097eb8d57a175b88c7d8b4799750680b9010438ed1739000000000000000000000000000000000000000000000000002386f26fc1000000000000000000000000000000000000000000000000000240cf47966e28bbd400000000000000000000000000000000000000000000000000000000000000a0000000000000000000000000e1f9bd605b2d6817c86bec8ee6f5e610e253f7df0000000000000000000000000000000000000000000000000000000062b923d90000000000000000000000000000000000000000000000000000000000000002000000000000000000000000d0a1e359811322d97991e03f863a0c30c2cf029c0000000000000000000000004f96fe3b7a6cf9725f59d353f723c1bdb64ca6aac001a03f0e12de9799eefe313afd450254fc209542ecaeecb57fdce02a8448f1072a46a02ebcbe4374d7b855b3c5cc9e50667f04a9e4b12bba84e509626d4f195f167185", code=NONCE_EXPIRED, version=providers/5.6.8)
    at Logger.makeError (/usr/src/app/node_modules/@ethersproject/logger/src.ts/index.ts:261:28)
    at Logger.throwError (/usr/src/app/node_modules/@ethersproject/logger/src.ts/index.ts:273:20)
    at checkError (/usr/src/app/node_modules/@ethersproject/providers/src.ts/json-rpc-provider.ts:105:16)
    at StaticJsonRpcProvider.<anonymous> (/usr/src/app/node_modules/@ethersproject/providers/src.ts/json-rpc-provider.ts:603:20)
    at step (/usr/src/app/node_modules/@ethersproject/providers/lib/json-rpc-provider.js:48:23)
    at Object.throw (/usr/src/app/node_modules/@ethersproject/providers/lib/json-rpc-provider.js:29:53)
    at rejected (/usr/src/app/node_modules/@ethersproject/providers/lib/json-rpc-provider.js:21:65)
    at processTicksAndRejections (node:internal/process/task_queues:96:5)

image

For Pangolin and TraderJoe, we are still getting the same behavior when checking balance and running the Amm-arb strategy

Setup AMM-arb for Pangolin-Avax and still getting this error of call revert exception.. which was introduce on #5408. The strategy would not start and kept returning the same error on logs. Checked moralis.io and made user the Dapps is up running and correct moralis node API is set but getting the same error.

7995641a4.zip

@james-hummingbot
Copy link
Contributor Author

@rapcmia @vic-en It looks like hummingbot was not using /nextNonce, which is the new code for the nonces. I changed it.

@james-hummingbot
Copy link
Contributor Author

@rapcmia
@vic-en 's commits should fix the avalanche issues.

@vic-en
Copy link
Contributor

vic-en commented Jun 27, 2022

@rapcmia Pls update to commit last commit 61deddc before testing sushiswap

@nikspz
Copy link
Contributor

nikspz commented Jun 28, 2022

@james-hummingbot @vic-en Uniswap/Sushiswap kovan now fixed 👍

commit 61deddc

Pangolin avalanche mainnet:
Steps:

  1. clone/install feature branch, create docker image
  2. add moralis node API key for pangolin avalanche manually (gateway config avalanche.nodeAPIKey)
  3. start the strategy
  4. check the balance

Actual:
Return Error: call revert exception after start the strategy / checking balance

image

After restart of the bot:
image

@vic-en
Copy link
Contributor

vic-en commented Jun 28, 2022

@nikspz I believe that issue is fixed. Can you test pangolin again?
Just re-run balance command on my end.
image

@rapcmia
Copy link
Contributor

rapcmia commented Jun 28, 2022

PR update:

  • Tested 61deddc
  • Run gateway connect uniswapLP and select kovan then enter private keys, ok

However, upon checking the logs, it would return an error of EVM_Range_AMM and when running balance command it would also have an error of Unhandled error in background task: 'binance_paper_trade'. Tried to relaunch the bot and it seems to crash all the time. The workaround is to delete and reclone the PR again

2022-06-28 03:37:31,166 - 280094 - hummingbot.core.utils.async_utils - ERROR - Unhandled error in background task: 'EVM_Range_AMM'
Traceback (most recent call last):
  File "/home/ubuntu/github/5381/hummingbot/core/utils/async_utils.py", line 9, in safe_wrapper
    return await c
  File "/home/ubuntu/github/5381/hummingbot/client/command/gateway_command.py", line 485, in _gateway_connect
    AllConnectorSettings.create_connector_settings()
  File "/home/ubuntu/github/5381/hummingbot/client/settings.py", line 303, in create_connector_settings
    type=ConnectorType[connection_spec["trading_type"]],
  File "/home/ubuntu/miniconda3/envs/hummingbot/lib/python3.8/enum.py", line 344, in __getitem__
    return cls._member_map_[name]
KeyError: 'EVM_Range_AMM'
2022-06-28 03:37:42,029 - 280094 - hummingbot.core.utils.async_utils - ERROR - Unhandled error in background task: 'binance_paper_trade'
Traceback (most recent call last):
  File "/home/ubuntu/github/5381/hummingbot/core/utils/async_utils.py", line 9, in safe_wrapper
    return await c
  File "/home/ubuntu/github/5381/hummingbot/client/command/balance_command.py", line 88, in show_balances
    all_ex_bals = await asyncio.wait_for(
  File "/home/ubuntu/miniconda3/envs/hummingbot/lib/python3.8/asyncio/tasks.py", line 483, in wait_for
    return fut.result()
  File "/home/ubuntu/github/5381/hummingbot/user/user_balances.py", line 121, in all_balances_all_exchanges
    await self.update_exchanges()
  File "/home/ubuntu/github/5381/hummingbot/user/user_balances.py", line 117, in update_exchanges
    results = await safe_gather(*tasks)
  File "/home/ubuntu/github/5381/hummingbot/core/utils/async_utils.py", line 22, in safe_gather
    return await asyncio.gather(*args, **kwargs)
  File "/home/ubuntu/github/5381/hummingbot/user/user_balances.py", line 93, in update_exchange_balance
    return await self.add_exchange(exchange_name, **api_keys)
  File "/home/ubuntu/github/5381/hummingbot/user/user_balances.py", line 71, in add_exchange
    market = UserBalances.connect_market(exchange, **api_details)
  File "/home/ubuntu/github/5381/hummingbot/user/user_balances.py", line 25, in connect_market
    trading_pairs: List[str] = gateway_connector_trading_pairs(conn_setting.name)
  File "/home/ubuntu/github/5381/hummingbot/client/settings.py", line 426, in gateway_connector_trading_pairs
    if AllConnectorSettings.get_connector_settings()[conn].uses_gateway_generic_connector() and \
KeyError: 'binance_paper_trade'

image

61deddc.zip

@nikspz
Copy link
Contributor

nikspz commented Jun 28, 2022

@vic-en Upon crosschecking issue still showing
Could you try these steps?

Steps:

  1. clone/install feature branch, create docker image, gateway generate/create
  2. add moralis node API key for pangolin avalanche manually (gateway config avalanche.nodeAPIKey)
  3. create amm arb strategy using pangolin avalanche
  4. start the strategy

Actual:
Returns an Error: call revert exception after start of the strategy

my Env: AWS, Ubuntu Source
commit 61deddc

image

@vic-en
Copy link
Contributor

vic-en commented Jun 28, 2022

PR update:

  • Tested 61deddc
  • Run gateway connect uniswapLP and select kovan then enter private keys, ok

However, upon checking the logs, it would return an error of EVM_Range_AMM and when running balance command it would also have an error of Unhandled error in background task: 'binance_paper_trade'. Tried to relaunch the bot and it seems to crash all the time. The workaround is to delete and reclone the PR again

2022-06-28 03:37:31,166 - 280094 - hummingbot.core.utils.async_utils - ERROR - Unhandled error in background task: 'EVM_Range_AMM'
Traceback (most recent call last):
  File "/home/ubuntu/github/5381/hummingbot/core/utils/async_utils.py", line 9, in safe_wrapper
    return await c
  File "/home/ubuntu/github/5381/hummingbot/client/command/gateway_command.py", line 485, in _gateway_connect
    AllConnectorSettings.create_connector_settings()
  File "/home/ubuntu/github/5381/hummingbot/client/settings.py", line 303, in create_connector_settings
    type=ConnectorType[connection_spec["trading_type"]],
  File "/home/ubuntu/miniconda3/envs/hummingbot/lib/python3.8/enum.py", line 344, in __getitem__
    return cls._member_map_[name]
KeyError: 'EVM_Range_AMM'
2022-06-28 03:37:42,029 - 280094 - hummingbot.core.utils.async_utils - ERROR - Unhandled error in background task: 'binance_paper_trade'
Traceback (most recent call last):
  File "/home/ubuntu/github/5381/hummingbot/core/utils/async_utils.py", line 9, in safe_wrapper
    return await c
  File "/home/ubuntu/github/5381/hummingbot/client/command/balance_command.py", line 88, in show_balances
    all_ex_bals = await asyncio.wait_for(
  File "/home/ubuntu/miniconda3/envs/hummingbot/lib/python3.8/asyncio/tasks.py", line 483, in wait_for
    return fut.result()
  File "/home/ubuntu/github/5381/hummingbot/user/user_balances.py", line 121, in all_balances_all_exchanges
    await self.update_exchanges()
  File "/home/ubuntu/github/5381/hummingbot/user/user_balances.py", line 117, in update_exchanges
    results = await safe_gather(*tasks)
  File "/home/ubuntu/github/5381/hummingbot/core/utils/async_utils.py", line 22, in safe_gather
    return await asyncio.gather(*args, **kwargs)
  File "/home/ubuntu/github/5381/hummingbot/user/user_balances.py", line 93, in update_exchange_balance
    return await self.add_exchange(exchange_name, **api_keys)
  File "/home/ubuntu/github/5381/hummingbot/user/user_balances.py", line 71, in add_exchange
    market = UserBalances.connect_market(exchange, **api_details)
  File "/home/ubuntu/github/5381/hummingbot/user/user_balances.py", line 25, in connect_market
    trading_pairs: List[str] = gateway_connector_trading_pairs(conn_setting.name)
  File "/home/ubuntu/github/5381/hummingbot/client/settings.py", line 426, in gateway_connector_trading_pairs
    if AllConnectorSettings.get_connector_settings()[conn].uses_gateway_generic_connector() and \
KeyError: 'binance_paper_trade'

image

61deddc.zip

You're getting this because the connection you added while testing uniswapLp connector/strategy persisted.
You need to delete or manually remove that entry in gateway_connections.json file in the client conf dir.

@vic-en
Copy link
Contributor

vic-en commented Jun 28, 2022

@vic-en Upon crosschecking issue still showing Could you try these steps?

Steps:

  1. clone/install feature branch, create docker image, gateway generate/create
  2. add moralis node API key for pangolin avalanche manually (gateway config avalanche.nodeAPIKey)
  3. create amm arb strategy using pangolin avalanche
  4. start the strategy

Actual: Returns an Error: call revert exception after start of the strategy

my Env: AWS, Ubuntu Source commit 61deddc

image

@nikspz I believe some steps are missing from above. I doubt the client would be starting the custom build docker just with the steps you've given. However, I did further attempt to start a strategy with an account with less funds and definitely not blocked by the issue you're reporting.

image
Just an insufficient balance error which is normal in my case.
I'll also further test with an account with just enough asset.

@rapcmia
Copy link
Contributor

rapcmia commented Jun 28, 2022

@vic-en thanks for the info, there are no changes on the settings we have atm for gateway config avalanche. This has been my setup even when avalanche was working before this issue happened and made sure DApps is running on Moralis as well. Im trying to reproduce the screenshot you provided using a another test wallet but no avail.
image

We made sure as well the docker gateway image is created within the ./gateway folder using docker build -t coinalpha/gateway-v2-dev:name-of-image -f Dockerfile . which every commit seems to be working ok for us when testing previous issues on the PR.

I did a clean uninstall/install and made sure no docker instance is present even on .hummingbot-gateway/ folder and purge all docker images available on AWS and tested again but still getting the same error of call revert exception. Screenrecord below when testing commit e08bb61

WindowsTerminal_eFot9Lro26.mp4

@james-hummingbot
Copy link
Contributor Author

@vic-en the filtering is working, but getTokenBySymbol uses the wrong value. It uses tokenList instead of _tokenMap.

@vic-en
Copy link
Contributor

vic-en commented Jun 28, 2022

@rapcmia Sorry for the misunderstanding. Turned out the tokens you were testing with weren't filtered.
I fixed all now and also updated some tokenList files. Your tokens should work now.
Kindly run tests again now.

@rapcmia
Copy link
Contributor

rapcmia commented Jun 29, 2022

@vic-en Thanks for the update and no worries, we are seeing some changes on the latest commit. Test in progress

Copy link
Contributor

@arnelhbot arnelhbot left a comment

Choose a reason for hiding this comment

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

Test Performed

  • Installed branch successfully
  • Generated certificate and gateway create with no issues
  • Connected Uniswap, Susushiswap, Pangolin Traderjoe and checked balance with no issues
  • Created simple AMM_Arbitrage and started strategy
  • Verified no arbitrage opportunity in logs
  • Verified filled orders and data match with history
  • Confirmed CSV file and txhash to match on snowtrace
  • Tested on Source AWS Instance and Docker Build

@JeremyKono JeremyKono merged commit 4d50bfa into hummingbot:development Jun 29, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

None yet

8 participants