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

Feat/balancer connector #130

Closed

Conversation

zedquach
Copy link

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:
Add connector and tests for Balancer

Tests performed by the developer:
Automatic test for balancer only. There is a bunch of failed unit tests that belong to others.

Tips for QA testing:
For some reason I can't get the gateway running from source anymore, it just stuck without starting the server. Any idea? Happen with master too.

@zedquach zedquach mentioned this pull request Jun 12, 2023
@fengtality
Copy link
Contributor

For some reason I can't get the gateway running from source anymore, it just stuck without starting the server. Any idea? Happen with master too.

After you install Gateway from source, run gateway-setup.sh and check your /conf/ethereum.yml file afterwards. It's probably an issue with the tokenListSource not working properly. Alternatively, DM me on Discord and I can probably help you debug and troubleshoot it pretty easily.

@zedquach
Copy link
Author

For some reason I can't get the gateway running from source anymore, it just stuck without starting the server. Any idea? Happen with master too.

After you install Gateway from source, run gateway-setup.sh and check your /conf/ethereum.yml file afterwards. It's probably an issue with the tokenListSource not working properly. Alternatively, DM me on Discord and I can probably help you debug and troubleshoot it pretty easily.

I got it working again, don't know why, so much for deterministic :( Anyway, got a few bug to fix. Should be done soon

@nikspz
Copy link
Contributor

nikspz commented Jun 26, 2023

hi @zedquach Could you please add your updates on this PR?
Could you please resolve branch conflicts?

@zedquach
Copy link
Author

hi @zedquach Could you please add your updates on this PR? Could you please resolve branch conflicts?

Hey sorry, I was sick last week. Please give me a day or two.

@nikspz
Copy link
Contributor

nikspz commented Jun 28, 2023

Hi @zedquach.
Please be informed about hummingbot ongoing migration to python3.10 this week.
The new PR referring to the hummingbot/hummingbot#6389 will be created and merged before all the connectors PRs to prevent connectors conflicts with python3.10 environment

@nikspz
Copy link
Contributor

nikspz commented Jul 3, 2023

@zedquach Could you please resolve branch conflicts?

@fengtality
Copy link
Contributor

Screen Shot 2023-07-04 at 3 22 50 PM

Did some initial testing... seems like the WETH-DAI pair should return a price, but it fails currently. This is using Ethereum mainnet.

@zedquach
Copy link
Author

zedquach commented Jul 4, 2023

@fengtality ya, something weird is going on. One moment it was working fine, the next moment it fails. I'm investigating.

@rapcmia
Copy link
Contributor

rapcmia commented Jul 7, 2023

PR update:

  • Ran test on latest commit 2f65c1ef2ac5c while there are branch conflicts
  • Ran test on local mbp(m1) with latest development client

Test on Hummingbot client + this PR

  • Able to setup this PR and development client successfully
  • Due to branch conflicts within the PR specifically on yarn.lock, this resulted to this error on gateway when setting up
    image
  • Confirm balancer is showing on gateway list and gateway connect
    image
  • However when running gateway config does not work:
    image
  • gateway connect also command does not work for most of gateway connectors on this PR
    • Setup balancer {goerli, arbitrum_one} but getting unhandled error
      image
      2023-07-07 12:29:36,084 - 4623 - hummingbot.core.gateway.gateway_http_client - WARNING - Call to https://localhost:15888/chain/config failed. See logs for more details.
      2023-07-07 12:29:36,086 - 4623 - hummingbot.core.utils.async_utils - ERROR - Unhandled error in background task: 0, message='Attempt to decode JSON with unexpected mimetype: text/html; charset=utf-8', url=URL('https://localhost:15888/chain/config')
      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/hummingbot/client/command/gateway_command.py", line 240, in _gateway_connect
          await self._test_node_url_from_gateway_config(chain, network, attempt_connection=False)
        File "/Users/rapcomia/github/hummingbot/development/hummingbot/client/command/gateway_api_manager.py", line 83, in _test_node_url_from_gateway_config
          config_dict: Dict[str, Any] = await GatewayHttpClient.get_instance().get_configuration()
        File "/Users/rapcomia/github/hummingbot/development/hummingbot/core/gateway/gateway_http_client.py", line 268, in get_configuration
          return await self.api_request("get", "chain/config", fail_silently=fail_silently)
        File "/Users/rapcomia/github/hummingbot/development/hummingbot/core/gateway/gateway_http_client.py", line 218, in api_request
          raise e
        File "/Users/rapcomia/github/hummingbot/development/hummingbot/core/gateway/gateway_http_client.py", line 197, in api_request
          parsed_response = await response.json()
        File "/Users/rapcomia/anaconda3/envs/hummingbot/lib/python3.10/site-packages/aiohttp/client_reqrep.py", line 1104, in json
          raise ContentTypeError(
      aiohttp.client_exceptions.ContentTypeError: 0, message='Attempt to decode JSON with unexpected mimetype: text/html; charset=utf-8', url=URL('https://localhost:15888/chain/config')
      
      • Crosscheck this error on latest development gateway, all working ok ✅

Test some endpoints using thunderclient using goerli and arbitrum_one

  • get/connectors ✅
    image
  • network/config ✅
  • evm/allowances ✅
  • amm/price: Getting error Price query failed: fetchData: Couldn't update vault data
    image

Note:

  • Assuming these issues are not related to the current branch conflicts
  • Polygon network is not tested ❌

@zedquach
Copy link
Author

zedquach commented Jul 9, 2023

I was able to get the eth mainnet working reliably. As for the others, the problem seems to come from their subgraph. There is also a similar issueon their repo.

balancer/balancer-sdk#479

@nikspz
Copy link
Contributor

nikspz commented Jul 12, 2023

Steps:
Clone and install feature branch + latest development on client
gateway connect balancer

Actual:
failed to connect wallet

Expected:
Should be Able to connect

image
image

@nikspz
Copy link
Contributor

nikspz commented Jul 24, 2023

hi @zedquach Do you have updates on this bounty?

@fengtality
Copy link
Contributor

fengtality commented Jul 25, 2023 via email

@nikspz
Copy link
Contributor

nikspz commented Jul 25, 2023

Currently failed to install the PR branch, @zedquach Could you please fix?
Steps:

  1. git clone -b feat/balancer-connector https://github.com/zedquach/gateway gwbalancer130
  2. cd gwbalancer130
  3. yarn
  4. yarn build

Actual:

(base) ubuntu:~/gwbalancer130$ yarn build
yarn run v1.22.19
$ rimraf dist && mkdir dist
$ tsc --skipLibCheck --project ./ && yarn copy-files
src/connectors/traderjoe/traderjoe.ts:15:51 - error TS2307: Cannot find module '@traderjoe-xyz/sdk' or its corresponding type declarations.

15 import { Token, TokenAmount, JSBI, Percent } from '@traderjoe-xyz/sdk';
                                                     ~~~~~~~~~~~~~~~~~~~~

src/connectors/uniswap/uniswap.lp.helper.ts:345:9 - error TS2345: Argument of type 'import("/home/nikita/gwbalancer130/node_modules/@uniswap/sdk-core/dist/
entities/fractions/price").Price<import("/home/nikita/gwbalancer130/node_modules/@uniswap/sdk-core/dist/entities/token").Token, import("/home/nikita/gwbala
ncer130/node_modules/@uniswap/sdk-core/dist/entities/token").Token>' is not assignable to parameter of type 'import("/home/nikita/gwbalancer130/node_module
s/@uniswap/router-sdk/node_modules/@uniswap/sdk-core/dist/entities/fractions/price").Price<import("/home/nikita/gwbalancer130/node_modules/@uniswap/router-
sdk/node_modules/@uniswap/sdk-core/dist/entities/token").Token, import("/home/nikita/gwbalancer130/node_modules/@uni...'.
  Types of property 'multiply' are incompatible.
    Type '<TOtherQuote extends import("/home/nikita/gwbalancer130/node_modules/@uniswap/sdk-core/dist/entities/currency").Currency>(other: import("/home/ni
kita/gwbalancer130/node_modules/@uniswap/sdk-core/dist/entities/fractions/price").Price<import("/home/nikita/gwbalancer130/node_modules/@uniswap/sdk-core/d
ist/entities/toke...' is not assignable to type '<TOtherQuote extends import("/home/nikita/gwbalancer130/node_modules/@uniswap/router-sdk/node_modules/@uni
swap/sdk-core/dist/entities/currency").Currency>(other: import("/home/nikita/gwbalancer130/node_modules/@uniswap/router-sdk/node_modules/@uniswap/sdk-core/
dist/entities/fractions/price").Price<import("/home/niki...'.
      Types of parameters 'other' and 'other' are incompatible.
        Type 'import("/home/nikita/gwbalancer130/node_modules/@uniswap/router-sdk/node_modules/@uniswap/sdk-core/dist/entities/fractions/price").Price<impo
rt("/home/nikita/gwbalancer130/node_modules/@uniswap/router-sdk/node_modules/@uniswap/sdk-core/dist/entities/token").Token, TOtherQuote>' is not assignable
 to type 'import("/home/nikita/gwbalancer130/node_modules/@uniswap/sdk-core/dist/entities/fractions/price").Price<import("/home/nikita/gwbalancer130/node_m
odules/@uniswap/sdk-core/dist/entities/token").Token, TOtherQuote>'.
          The types returned by 'invert()' are incompatible between these types.
            Type 'import("/home/nikita/gwbalancer130/node_modules/@uniswap/router-sdk/node_modules/@uniswap/sdk-core/dist/entities/fractions/price").Price<
TOtherQuote, import("/home/nikita/gwbalancer130/node_modules/@uniswap/router-sdk/node_modules/@uniswap/sdk-core/dist/entities/token").Token>' is not assign
able to type 'import("/home/nikita/gwbalancer130/node_modules/@uniswap/sdk-core/dist/entities/fractions/price").Price<TOtherQuote, import("/home/nikita/gwb
alancer130/node_modules/@uniswap/sdk-core/dist/entities/token").Token>'.
              Types have separate declarations of a private property 'adjustedForDecimals'.

image

@fengtality
Copy link
Contributor

Closing in favor of #174

@fengtality fengtality closed this Jul 25, 2023
fengtality added a commit that referenced this pull request Jul 25, 2023
@fengtality fengtality mentioned this pull request Jul 25, 2023
2 tasks
vic-en pushed a commit to vic-en/gateway that referenced this pull request Apr 6, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants