Skip to content
This repository was archived by the owner on Feb 25, 2023. It is now read-only.

Conversation

@gyozajiro
Copy link
Contributor

  • merge balancer & uniswap endpoint to under /eth
  • consolidate functions on balancer, uniswap swaps price lookup
  • cache swap pool as class property
  • replace token contract address with token symbol on request param
  • add mainnet token list (1inch)
  • add maxswaps, ethGasStation api, gas level param to .env

* merge balancer & uniswap endpoint to under /eth
* consolidate functions on balancer, uniswap swaps price lookup
* cache swap pool as class property
* replace token contract address with token symbol on request param
* add mainnet token list (1inch)
* add maxswaps, ethGasStation api, gas level param to .env
@gyozajiro
Copy link
Contributor Author

gyozajiro commented Jan 30, 2021

API Endpoints are consolidated as below:

General Ethereum API

# get ethereum-based wallet balances
/eth/balances

# get token allowance amount
/eth/allowances

# approve token allowance amount
/eth/approve

# get tx status update
/eth/poll

Balancer/Uniswap API

# initiate swap pool, auto-approve allowance
eth/{protocol}/start

# lookup buy/sell price
eth/{protocol}/price

# execute buy/sell trade
eth/{protocol}/trade

Terra API

# 
terra/start
terra/price
terra/trade

Import Postman collection & environment file in test/postman/v2 for latest endpoints and request params

@gyozajiro
Copy link
Contributor Author

Client PR for this feature. https://github.com/CoinAlpha/hummingbot/pull/2905.

sdgoh added 15 commits February 2, 2021 22:31
* Consolidate log into `info`. Remove debug, error, and rejection. 
* Enable debug mode logging for development
* Check for undefined erc20 token list url source
* Fix token list conversion for allowance & approval
* accept balancer exchange proxy in .env
* accept balancer gas base, gas per swap overwrite in .env
* accept eth approval gas limit, manual gas fee setting in .env when ethgasstation not set to true
* accept uniswap router setting in .env
* accept uniswap gas limit, ttl, update period overwrite 
* update .env.example
* Add initiate one-time gas retrieval
@dennisocana dennisocana linked an issue Mar 12, 2021 that may be closed by this pull request
@dennisocana
Copy link
Contributor

Requesting review from @vic-en as well so he can work on the story https://github.com/CoinAlpha/hummingbot/issues/3037

sdgoh added 3 commits March 12, 2021 12:49
* get on-chain pool data update to prevent change in pool balance prior to trade execution
* remove pool cache loop during strategy initialisation
vic-en
vic-en previously requested changes Mar 16, 2021
vic-en and others added 5 commits March 16, 2021 15:27
@PtrckM
Copy link

PtrckM commented Mar 24, 2021

  • using the config1
    image

  • no problem on subsequent orders
    image

  • however using this config2
    image

  • resulting with Fail with error 'UniswapV2Router: EXCESSIVE_INPUT_AMOUNT'
    image
    image

  • also the history are incorrect on uniswap/balancer side
    image

  • different behavior on balancer using config3
    image
    image
    image

-logs config1 config2 (uniswap)
logs_doonconf.log
logs_uniswap.log

-logs config3 balancer
logs_ditomobile.log

@PtrckM
Copy link

PtrckM commented Mar 30, 2021

  • not able to run gateway, tried on different node versions v10.22.0, v10.22.1 and v10.23.1 all fails. Both mainnet and kovan fails
    image

  • able to run on both commit e354cbecaac8f6da93f424f453125acf9c462244 and 658429896355eaae3e3a4a0dd3a064f9c2a06e9d without any problems.
    image

@PtrckM
Copy link

PtrckM commented Mar 30, 2021

  • fix issue where gateway can't start
    image

  • suggested UNISWAP_ALLOWED_SLIPPAGE=1.5
    image

@gyozajiro gyozajiro dismissed vic-en’s stale review March 31, 2021 07:00

Change not required after code refactor in subsequent commits

@gyozajiro gyozajiro requested a review from vic-en March 31, 2021 07:03
Copy link
Contributor

@vic-en vic-en left a comment

Choose a reason for hiding this comment

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

LGTM

Copy link

@PtrckM PtrckM left a comment

Choose a reason for hiding this comment

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

Tested and confirmed working by QA.

@vic-en vic-en merged commit bf7cc08 into development Mar 31, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Refactor Gateway endpoint to consolidate functions

5 participants