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/add trade fee in base and quote #6288

Merged

Conversation

cardosofede
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:
Add the value of the trade fee in quote asset. This is very useful for reporting purposes since if the fees are paid in another token, the rate oracle can be used to translate this difference.

Tests performed by the developer:
Run a bot and see that everything is working.
Test the new solution with the dashboard

Tips for QA testing:

@cardosofede cardosofede changed the base branch from master to development May 9, 2023 15:34
@cardosofede cardosofede force-pushed the feat/add_trade_fee_in_base_and_quote branch from 2514b1f to 9270c5b Compare May 9, 2023 15:38
@@ -260,11 +266,11 @@ def _did_fill_order(self,
order_id=order_id,
trade_type=evt.trade_type.name,
order_type=evt.order_type.name,
price=Decimal(
Copy link
Sponsor Contributor

Choose a reason for hiding this comment

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

Is this change needed?

"position", ]

self.assertEqual(expected_attributes, TradeFill.attribute_names_for_file_export())

def test_attribute_names_for_file_export_are_valid(self):
Copy link
Sponsor Contributor

Choose a reason for hiding this comment

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

Why remove this test instead of adding an mock entry for trade_fee_in_quote?

Copy link
Sponsor Contributor

@fengtality fengtality left a comment

Choose a reason for hiding this comment

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

LGTM

Tested alongside hummingbot/dashboard#15

@rapcmia rapcmia requested review from nikspz and rapcmia May 10, 2023 02:16
Copy link
Contributor

@nikspz nikspz left a comment

Choose a reason for hiding this comment

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

Tests performed:

  • Cloned and install feature branch and PR6288
  • Manually Created docker image successfully
  • conda env create -f environment_conda.yml
  • conda activate streamlit-apps
  • streamlit run main.py
  • Copied URL to browser
  • Created symlink with ln -s /path/to/hummingbot/data data
  • Review Strategy Performance tab now shows fees in USDT for binance spot
  • Confirmed fees amount is showing correct amount

Note: for binance perpetual there's ongoing issue on dashboard's Strategy Performance tab with AttributeError: module 'ccxt' has no attribute 'binance_perpetual'

@nikspz nikspz merged commit a6585d4 into hummingbot:development May 11, 2023
2 checks passed
@rapcmia rapcmia mentioned this pull request May 12, 2023
@nikspz nikspz mentioned this pull request May 22, 2023
2 tasks
@rapcmia rapcmia mentioned this pull request May 23, 2023
2 tasks
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.

None yet

3 participants