Skip to content

Commit

Permalink
Merge pull request #1758 from Drakkar-Software/dev
Browse files Browse the repository at this point in the history
master merge
  • Loading branch information
GuillaumeDSM authored Jul 13, 2021
2 parents f41ce7a + 0b395a9 commit 5643b06
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 3 deletions.
2 changes: 1 addition & 1 deletion docs/source/pages/Exchanges.rst
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ Depending on the exchange, there can be accounts requirements: for example
Binance requires a relatively new (after july 1st 2021) account that doesn't have a
referral code.

If your current account is not meeting the partner exchange requirement, you will
If an account you are using is not meeting a partner exchange requirement, you will
see an error message: this doesn't prevent your from using OctoBot.
However the OctoBot team would greatly appreciate if you could create a
new account that meets the exchange's requirements to support the project.
Expand Down
1 change: 1 addition & 0 deletions octobot/community/community_fields.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,3 +34,4 @@ class CommunityFields(enum.Enum):
PORTFOLIO_VALUE = "portfoliovalue"
PROFITABILITY = "profitability"
TRADED_VOLUMES = "tradedvolumes"
SUPPORTS = "supports"
15 changes: 14 additions & 1 deletion octobot/community/community_manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,8 @@ def _get_bot_community(self):
community_fields.CommunityFields.REFERENCE_MARKET.value: self.reference_market,
community_fields.CommunityFields.PORTFOLIO_VALUE.value: self._get_real_portfolio_value(),
community_fields.CommunityFields.PROFITABILITY.value: self._get_profitability(),
community_fields.CommunityFields.TRADED_VOLUMES.value: self._get_traded_volumes()
community_fields.CommunityFields.TRADED_VOLUMES.value: self._get_traded_volumes(),
community_fields.CommunityFields.SUPPORTS.value: self._get_supports()
}
}

Expand Down Expand Up @@ -187,6 +188,18 @@ def _get_traded_volumes(self):
volume_by_currency[currency] = trade.total_cost
return volume_by_currency

def _get_supports(self):
supporting_exchanges = []
for exchange_manager in self.exchange_managers:
exchange_name = trading_api.get_exchange_name(exchange_manager)
if self.has_real_trader \
and trading_api.is_sponsoring(exchange_name) \
and trading_api.is_valid_account(exchange_manager):
supporting_exchanges.append(exchange_name)
return {
community_fields.CommunityFields.EXCHANGES.value: supporting_exchanges
}

def _get_real_portfolio_value(self):
if self.has_real_trader:
total_value = 0
Expand Down
2 changes: 1 addition & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ cython==0.29.23

# Drakkar-Software requirements
OctoBot-Commons==1.6.4
OctoBot-Trading==1.13.1
OctoBot-Trading==1.13.3
OctoBot-Evaluators==1.6.16
OctoBot-Tentacles-Manager==2.5.2
OctoBot-Services==1.2.21
Expand Down

0 comments on commit 5643b06

Please sign in to comment.