hummingbot icon indicating copy to clipboard operation
hummingbot copied to clipboard

Feat/single gateway balance allowance

Open isreallee82 opened this issue 2 years ago • 17 comments

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: since there is a potential proposed feature for single balance display #3975.

Addittion of a new gateway balance command that reports balances for single connected wallets. Reafctor of all the necessary function to make the command work. Fix other related bugs.

Tests performed by the developer:

Added few exchanges tor the client pangolin_avalanche_avalanche ✅ uniswarp_ethereum_mainet ✅ uniswap_ethereum_arbitrum_one ✅ others pending

Tips for QA testing:

isreallee82 avatar Dec 28 '23 08:12 isreallee82

@fengtality @rapcmia @nikspz Would it be preferable for the overall gateway balance to include allowances, or should I maintain its current state of separate displays for each balance exchange, prioritizing a faster user experience?

isreallee82 avatar Dec 28 '23 16:12 isreallee82

hi @isreallee82 I think https://github.com/hummingbot/hummingbot/issues/3975 Enhancement was requested in 2021 for CEX connectors like binance gate_io etc. to check separate balance (like balance binance, balance gate_io etc.). That was not a bounty, just a enhancement request. Will provide you updates later regarding gateway allowances implementation

nikspz avatar Dec 28 '23 20:12 nikspz

sure I know clearly @nikspz

isreallee82 avatar Dec 28 '23 20:12 isreallee82

also is it right to create a pr for an enhancement as I did @nikspz?

isreallee82 avatar Dec 28 '23 20:12 isreallee82

@isreallee82 Yes sure it's totally okay. Just make sure to discuss implementation before submitting to prevent not priority changes. Thank you for trying to improve the Client, really appreciate it

nikspz avatar Dec 29 '23 06:12 nikspz

alright will note that @nikspz

isreallee82 avatar Dec 29 '23 10:12 isreallee82

@isreallee82 Thanks for this contribution. I think adding allowances to the gateway balance command makes sense. However, I think some changes are needed to make this work properly for users.

  • Adding the allowances column to gateway balance is preferable, so that the user can see the allowances for each exchange.

  • I like your addition of the flag to the gateway balance command, since it should speed up operations for users who don't need balances for all their networks. However, I think it should be structured as a --chain flag with autocomplete for the chain_network, not the exchange_chain_network, like

gateway balance --chain ethereum_mainnet
  • Currently, the autocomplete for commands that expect chain_network still shows exchange_chain_network. Change this to chain_network:
Screen Shot 2024-01-07 at 11 21 06 AM
  • Clean the gateway connect command so that:
    • the 2nd column is titled Chain_Network
    • the 2nd column data is formatted like ethereum_mainnet

fengtality avatar Jan 07 '24 19:01 fengtality

Thank you for your valuable input and suggestions, @fengtality. i'll promptly implement the suggested modifications and push the updates as soon as possible.

isreallee82 avatar Jan 07 '24 20:01 isreallee82

I think this should be it @fengtality @nikspz

isreallee82 avatar Jan 08 '24 18:01 isreallee82

Hey @isreallee82 apologies, I reviewed this PR and realized that we actually need a different approach to allowances:

Unfortunately, I got a bit confused and asked you add allowances into gateway balance, which is wrong. Since allowances are at the DEX level (spender is specified) while balances are at the wallet/network level, a single command doesn't really work for both. You either have redundant information or missing info.

It would be better to have a separate gateway allowances command that lists the allowances for each connected DEX for the designated wallet, similar to what gateway connect. I think this is worthy of a P2 bounty to implement this functionality correctly and add tests. I'll write up in a separate bounty issue.

fengtality avatar Jan 10 '24 01:01 fengtality

I agree got abit confused myself @fengtality more reason I included each connectors initially for spender since a connector is required for spender. its alright, should I remove all allowance related, since this pr was initially for feature/ single gateway balance display

isreallee82 avatar Jan 10 '24 01:01 isreallee82

Yes, it's best to remove all the allowances-related code from this PR. I think everything else should still be good to merge in.

On Tue, Jan 9, 2024 at 5:39 PM Ajayi Israel @.***> wrote:

I agree got abit confused myself @fengtality https://github.com/fengtality more reason I included each connectors initially for spender since a connector is required for spender. its alright, should I remove all allowance related, since this pr was initially for feature/ single gateway balance display

— Reply to this email directly, view it on GitHub https://github.com/hummingbot/hummingbot/pull/6743#issuecomment-1884055699, or unsubscribe https://github.com/notifications/unsubscribe-auth/AANWHVUWZXCRVIKGSZKT6FDYNXWMNAVCNFSM6AAAAABBFG7SFGVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTQOBUGA2TKNRZHE . You are receiving this because you were mentioned.Message ID: @.***>

-- Michael Feng @.*** +1 908 938 8733

fengtality avatar Jan 10 '24 02:01 fengtality

alright will do that

isreallee82 avatar Jan 10 '24 02:01 isreallee82

I think the pr is good for a review now

isreallee82 avatar Jan 10 '24 15:01 isreallee82

@isreallee82 @nikspz created bounty here for allowance command https://github.com/hummingbot/hummingbot/issues/6769

fengtality avatar Jan 11 '24 22:01 fengtality

Hey @isreallee82 - I realized that we should pause and rethink these changes to gateway balance and wanted to let you know before you do more work on this PR and the new allowances bounty. The reason is that I didn't consider the case where users add different wallets for different connectors on the same network.

Screen Shot 2024-01-12 at 5 21 41 AM

In this case, gateway balance would only show balances for the first connected wallet, and there's no way for users to see balances for the second wallet.

I'll think about this a bit more and clean this up in the allowances bounty issue.

fengtality avatar Jan 12 '24 13:01 fengtality

True @fengtality Thank you for bringing this to my attention. I agree that pausing to rethink these changes is a prudent step.

isreallee82 avatar Jan 12 '24 14:01 isreallee82

Closing this PR in prior to this one https://github.com/hummingbot/hummingbot/pull/6787

nikspz avatar Apr 11 '24 08:04 nikspz