hummingbot / gateway

Middleware that standardizes DEX API endpoints on different blockchain networks
Apache License 2.0
73 stars 127 forks source link

Uniswap router not returning prices #150

Closed toxicehc closed 1 year ago

toxicehc commented 1 year ago

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
  4. 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

nikspz commented 1 year ago

hi @toxicehc upon checking could be related to the issue using infura nodeURL / on the uniswap side. We'll investigate this one

nikspz commented 1 year ago

Reproduced on another alchemy nodeURL, will investigate more. image

toxicehc commented 1 year ago

Reproduced on another alchemy nodeURL, will investigate more. image

Hello Nick - since the PR on the dev gateway was done yesterday it is now working on the updated code from Vadim

nikspz commented 1 year ago

image Yep Seems fixed on latest development (dev-1.18.0)

fengtality commented 1 year ago

This appears to be an issue with Uniswap's router: https://github.com/Uniswap/smart-order-router as it's not returning a price for a swap:

2023-06-30 07:31:45 | info |     Fetching pair data for 0x6B175474E89094C44Da98b954EedeAC495271d0F-0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2. | undefined
2023-06-30 07:32:07 | info |     18 request(s) sent in last 300 seconds. | undefined
2023-06-30 07:32:49 | error |     Price query failed: Request failed with status code 522 | Error: Price query failed: Request failed with status code 522
    at /Users/feng/Code/gateway/dist/src/connectors/uniswap/uniswap.controllers.js:74:23
    at Generator.throw (<anonymous>)
    at rejected (/Users/feng/Code/gateway/dist/src/connectors/uniswap/uniswap.controllers.js:6:65)
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)

Setting the flag useRouter to false fixes this issue. This is currently on development branch (https://github.com/hummingbot/gateway/tree/development) and will be included in the v1.18 release

cardosofede commented 1 year ago

@fengtality probably this issue needs to be moved to the Gateway repo since it's an issue with the SDK

emusol commented 1 year ago

currently adding liquidity positions dont work also with the fix on the development branch, the issue with the liquidity started 2 weeks ago aswell