gateway icon indicating copy to clipboard operation
gateway copied to clipboard

UniswapLP Polygon mainnet - 'Token not supported' error

Open fengtality opened this issue 2 years ago • 6 comments

Original issue: https://github.com/hummingbot/hummingbot/issues/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)

fengtality avatar Feb 25 '23 16:02 fengtality

While gateway create is now deprecated, the error message above seems to indicate that Hummingbot could not resolve the WMATIC symbol.

I confirmed that Gateway can resolve the WMATIC symbol via Postman: Screen Shot 2023-02-25 at 8 22 27 AM.

I'll check if this works in Hummingbot later.

fengtality avatar Feb 25 '23 16:02 fengtality

Latest development 1.14.0 Issue reproduced image

Noticed that on uniswap WMATIC token will be placed as MATIC-USDC WMATIC-USDC turned into MATIC-USDC when creating a pool

Also noticed that bot mentioned WETH-USDC as the non-active market for uniswapLP-polygon-mainnet However this market exists on the exchange image

nikspz avatar Mar 06 '23 11:03 nikspz

Same issue (Token not supported) testing other pairs (UNI-USDC) image

p.s. for the note: was able to trade UNI-USDC using amm_arb strategy

nikspz avatar Mar 06 '23 11:03 nikspz

@nikspz Can you still reproduce this issue?

fengtality avatar Jun 06 '23 00:06 fengtality

Yes, reproduced on dev-1.17.0

logs_unilppolygondev117.log UniswapLP polygon mainnet WBTC-USDC - Token not supported error image

logs_uniswlpwmaticusdc.log UniswapLP polygon mainnet WMATIC-USDC - Token not supported error image Got trades on WMATIC-USDC using amm_arb before testing uniswapLP

nikspz avatar Jun 06 '23 16:06 nikspz

I think UniswapLP does not support Polygon yet. I was looking at the code, and it seems that UniswapLP is not handling the 'Polygon' chain.

https://github.com/hummingbot/gateway/blob/main/src/connectors/uniswap/uniswap.lp.helper.ts#L38

You can notice that in uniswap.ts, it is being checked if it's Ethereum; otherwise, it will be Polygon.

https://github.com/hummingbot/gateway/blob/main/src/connectors/uniswap/uniswap.ts#L61

I'm trying to fix this, but I think I'll spend some time testing to make sure everything is running smoothly.

johna1203 avatar Aug 07 '23 17:08 johna1203