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

fix/dont use router in uniswaplp #153

Merged
merged 5 commits into from
Jul 14, 2023
Merged

Conversation

fengtality
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:

Tips for QA testing:

  • Please run Gateway from source and test adding liquidity

@fengtality fengtality requested a review from nikspz July 11, 2023 23:47
@nikspz
Copy link
Contributor

nikspz commented Jul 12, 2023

Test performed:

  • Cloned and install: fix PR gw branch + Client - latest development branch
  • Created/started uniswapLP startegy using uniswap arbitrum successfully and WETH-USDC.E pair
  • bot returned error One of the tokens in this position isn't recognized
  • However Reviewed liquidity added successfully
  • Created/started uniswapLP startegy using uniswap arbitrum successfully and WETH-ARB pair
  • bot returned error One of the tokens in this position isn't recognized
  • However Reviewed liquidity added successfully

logs_gateway_app.log
logs_conf_uniswap_v3_lp_1.log
logs_unilp2.log
gw153.zip

2023-07-12 05:26:13,712 - 218157 - GatewayEVMAMMLP - INFO - Created ADD liquidity order add-WETH-USDC.E-1689139570209342 txHash: 0x3e7c326316df003591835b6ef0a9e39fb29efbcb51f064ce198bca9775a25d86 on arbitrum_one. Estimated Gas Cost: 0.000015069000000000  (gas limit: 3000000, gas price: 0.1000000000000000055511151231257827021181583404541015625)
2023-07-12 05:26:13,713 - 218157 - hummingbot.core.event.event_reporter - EVENT_LOG - {"timestamp": 1689139573.0, "order_id": "add-WETH-USDC.E-1689139570209342", "exchange_order_id": "0x3e7c326316df003591835b6ef0a9e39fb29efbcb51f064ce198bca9775a25d86", "order_action": "LPType.ADD", "trading_pair": "WETH-USDC.E", "fee_tier": "LOW", "lower_price": "1790.288903791500000", "upper_price": "1978.740367348500000", "amount": "0.005000", "creation_timestamp": 1689139570.0, "token_id": 0, "event_name": "RangePositionUpdateEvent", "event_source": "uniswapLP_ethereum_arbitrum_one"}
2023-07-12 05:26:14,265 - 218157 - GatewayEVMAMMLP - INFO - Liquidity added for position with ID 719713.
2023-07-12 05:26:14,275 - 218157 - hummingbot.core.event.event_reporter - EVENT_LOG - {"timestamp": 1689139574.0, "order_id": "add-WETH-USDC.E-1689139570209342", "exchange_order_id": "0x3e7c326316df003591835b6ef0a9e39fb29efbcb51f064ce198bca9775a25d86", "trading_pair": "WETH-USDC.E", "lower_price": "1790.288903791500000", "upper_price": "1978.740367348500000", "amount": "0", "fee_tier": "LOW", "creation_timestamp": 1689139570.0, "trade_fee": {"percent": "0", "percent_token": null, "flat_fees": [{"token": "ETH", "amount": "0.0001003772000000000055720539294"}]}, "token_id": 719713, "event_name": "RangePositionLiquidityAddedEvent", "event_source": "uniswapLP_ethereum_arbitrum_one"}
2023-07-12 05:26:15,214 - 218157 - 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> (/home/nikita/gwfixlp/dist/src/connectors/uniswap/uniswap.lp.js:76:23)\n    at Generator.next (<anonymous>)\n    at fulfilled (/home/nikita/gwfixlp/dist/src/connectors/uniswap/uniswap.lp.js:28:58)\n    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)"}
Traceback (most recent call last):
  File "/home/nikita/development/hummingbot/connector/gateway/amm_lp/gateway_evm_amm_lp.py", line 1097, in _status_polling_loop
    await safe_gather(
  File "/home/nikita/development/hummingbot/core/utils/async_utils.py", line 22, in safe_gather
    return await asyncio.gather(*args, **kwargs)
  File "/home/nikita/development/hummingbot/connector/gateway/amm_lp/gateway_evm_amm_lp.py", line 970, in update_nft
    raise nft_update_result
  File "/home/nikita/development/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 "/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/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> (/home/nikita/gwfixlp/dist/src/connectors/uniswap/uniswap.lp.js:76:23)\n    at Generator.next (<anonymous>)\n    at fulfilled (/home/nikita/gwfixlp/dist/src/connectors/uniswap/uniswap.lp.js:28:58)\n    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)"}
2023-07-12 05:26:16,207 - 218157 - 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> (/home/nikita/gwfixlp/dist/src/connectors/uniswap/uniswap.lp.js:76:23)\n    at Generator.next (<anonymous>)\n    at fulfilled (/home/nikita/gwfixlp/dist/src/connectors/uniswap/uniswap.lp.js:28:58)\n    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)"}
Traceback (most recent call last):
  File "/home/nikita/development/hummingbot/connector/gateway/amm_lp/gateway_evm_amm_lp.py", line 1097, in _status_polling_loop
    await safe_gather(
  File "/home/nikita/development/hummingbot/core/utils/async_utils.py", line 22, in safe_gather
    return await asyncio.gather(*args, **kwargs)
  File "/home/nikita/development/hummingbot/connector/gateway/amm_lp/gateway_evm_amm_lp.py", line 970, in update_nft
    raise nft_update_result
  File "/home/nikita/development/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 "/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/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> (/home/nikita/gwfixlp/dist/src/connectors/uniswap/uniswap.lp.js:76:23)\n    at Generator.next (<anonymous>)\n    at fulfilled (/home/nikita/gwfixlp/dist/src/connectors/uniswap/uniswap.lp.js:28:58)\n    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)"}
2023-07-12 05:26:17,191 - 218157 - 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> (/home/nikita/gwfixlp/dist/src/connectors/uniswap/uniswap.lp.js:76:23)\n    at Generator.next (<anonymous>)\n    at fulfilled (/home/nikita/gwfixlp/dist/src/connectors/uniswap/uniswap.lp.js:28:58)\n    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)"}
Traceback (most recent call last):
  File "/home/nikita/development/hummingbot/connector/gateway/amm_lp/gateway_evm_amm_lp.py", line 1097, in _status_polling_loop
    await safe_gather(
  File "/home/nikita/development/hummingbot/core/utils/async_utils.py", line 22, in safe_gather
    return await asyncio.gather(*args, **kwargs)
  File "/home/nikita/development/hummingbot/connector/gateway/amm_lp/gateway_evm_amm_lp.py", line 970, in update_nft
    raise nft_update_result
  File "/home/nikita/development/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 "/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/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> (/home/nikita/gwfixlp/dist/src/connectors/uniswap/uniswap.lp.js:76:23)\n    at Generator.next (<anonymous>)\n    at fulfilled (/home/nikita/gwfixlp/dist/src/connectors/uniswap/uniswap.lp.js:28:58)\n    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)"}

image
image

@emusol
Copy link

emusol commented Jul 12, 2023

Wow thats good! will this fix also remove liquidity?

@nikspz nikspz changed the title dont use router in uniswaplp fix/dont use router in uniswaplp Jul 12, 2023
@nikspz
Copy link
Contributor

nikspz commented Jul 12, 2023

Bot Client do not have feature to remove liquidity from UniswapLP currently @emusol

@emusol
Copy link

emusol commented Jul 12, 2023

Bot Client do not have feature to remove liquidity from UniswapLP currently @emusol

gateway had this functionality, I have custom script utilizing it successfully before the issue with uniswaplp started

@nikspz
Copy link
Contributor

nikspz commented Jul 12, 2023

@emusol Could you please share the script for further testing?

@emusol
Copy link

emusol commented Jul 12, 2023

@nikspz I am working on something I can share, for now I have a similar error to you, one of the tokens in this position isnt recognize, so my script cant reach the removal stage

@nikspz
Copy link
Contributor

nikspz commented Jul 12, 2023

Tried to remove with curl command:

remove liquidity

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

Got same issue: One of the tokens in this position isn't recognized
image

On the uniswapLP side position is not removed
image

@nikspz
Copy link
Contributor

nikspz commented Jul 12, 2023

Created issue for removing liquidity as it also exist for the latest development branch
#154

@nikspz nikspz merged commit 2230acf into development Jul 14, 2023
4 of 5 checks passed
@nikspz nikspz deleted the feat/test-uniswaplp-fix branch July 14, 2023 14:04
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.

3 participants