From 7c4c3e8c83808cd7efb3d847d5d03c5e08d56b02 Mon Sep 17 00:00:00 2001 From: Guillaume De Saint Martin Date: Fri, 15 Dec 2023 11:37:51 +0100 Subject: [PATCH 1/7] [Requirements] bump --- requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements.txt b/requirements.txt index e4d6e19ac..7e15f966a 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,6 +1,6 @@ # Drakkar-Software requirements OctoBot-Commons==1.9.34 -OctoBot-Trading==2.4.46 +OctoBot-Trading==2.4.47 OctoBot-Evaluators==1.9.3 OctoBot-Tentacles-Manager==2.9.6 OctoBot-Services==1.6.5 From 96856da1aca73e254ee77e869500d1f444046da9 Mon Sep 17 00:00:00 2001 From: Guillaume De Saint Martin Date: Fri, 15 Dec 2023 16:53:41 +0100 Subject: [PATCH 2/7] [Exchanges] add order cost test --- .../abstract_authenticated_exchange_tester.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/additional_tests/exchanges_tests/abstract_authenticated_exchange_tester.py b/additional_tests/exchanges_tests/abstract_authenticated_exchange_tester.py index 5621f9a18..d688b41e5 100644 --- a/additional_tests/exchanges_tests/abstract_authenticated_exchange_tester.py +++ b/additional_tests/exchanges_tests/abstract_authenticated_exchange_tester.py @@ -67,6 +67,8 @@ class AbstractAuthenticatedExchangeTester: # set true when cancelling any bundled order on exchange would automatically cancel the other(s) CANCEL_DOUBLE_BUNDLED_ORDERS_TOGETHER = True IGNORE_EXCHANGE_TRADE_ID = False # set True when trade.exchange_trade_id can't be set + MAX_TRADE_USD_VALUE = decimal.Decimal(8000) + MIN_TRADE_USD_VALUE = decimal.Decimal("0.1") # Implement all "test_[name]" methods, call super() to run the test, pass to ignore it. # Override the "inner_test_[name]" method to override a test content. @@ -524,6 +526,8 @@ def check_parsed_closed_order( self.check_theoretical_cost( symbols.parse_symbol(order.symbol), order.origin_quantity, order.origin_price, order.total_cost ) + if "USD" in order.market: + assert self.MIN_TRADE_USD_VALUE < order.total_cost < self.MAX_TRADE_USD_VALUE def check_raw_trades(self, trades): self.check_duplicate(trades) @@ -553,6 +557,8 @@ def check_parsed_trade(self, trade: personal_data.Trade): symbols.parse_symbol(trade.symbol), trade.executed_quantity, trade.executed_price, trade.total_cost ) + if "USD" in trade.market: + assert self.MIN_TRADE_USD_VALUE < trade.total_cost < self.MAX_TRADE_USD_VALUE def check_theoretical_cost(self, symbol, quantity, price, cost): theoretical_cost = quantity * price From 999b2164dc31209f8cf0a5f87aef2fd7ee466711 Mon Sep 17 00:00:00 2001 From: Guillaume De Saint Martin Date: Fri, 15 Dec 2023 16:54:04 +0100 Subject: [PATCH 3/7] [Requirements] bump --- requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements.txt b/requirements.txt index 7e15f966a..24a7200c0 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,6 +1,6 @@ # Drakkar-Software requirements OctoBot-Commons==1.9.34 -OctoBot-Trading==2.4.47 +OctoBot-Trading==2.4.48 OctoBot-Evaluators==1.9.3 OctoBot-Tentacles-Manager==2.9.6 OctoBot-Services==1.6.5 From 8258f59b8f2d4d005996c9ff9b3750069e26ce99 Mon Sep 17 00:00:00 2001 From: Guillaume De Saint Martin Date: Mon, 18 Dec 2023 22:29:30 +0100 Subject: [PATCH 4/7] [Requirements] bump --- requirements.txt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/requirements.txt b/requirements.txt index 24a7200c0..b2c9babb0 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,9 +1,9 @@ # Drakkar-Software requirements -OctoBot-Commons==1.9.34 +OctoBot-Commons==1.9.35 OctoBot-Trading==2.4.48 OctoBot-Evaluators==1.9.3 OctoBot-Tentacles-Manager==2.9.6 -OctoBot-Services==1.6.5 +OctoBot-Services==1.6.6 OctoBot-Backtesting==1.9.7 Async-Channel==2.2.1 trading-backend==1.2.11 From 1556e0b1367d632c7d1f969ae53dfbf3763d6d52 Mon Sep 17 00:00:00 2001 From: Guillaume De Saint Martin Date: Tue, 19 Dec 2023 20:19:35 +0100 Subject: [PATCH 5/7] [Community] init metrics migration --- octobot/community/community_analysis.py | 15 +++++++-------- octobot/community/community_manager.py | 4 ++-- octobot/community/identifiers_provider.py | 3 +++ octobot/constants.py | 2 ++ tests/unit_tests/community/test_community_data.py | 2 ++ 5 files changed, 16 insertions(+), 10 deletions(-) diff --git a/octobot/community/community_analysis.py b/octobot/community/community_analysis.py index 199ff2c93..ba16d0cbc 100644 --- a/octobot/community/community_analysis.py +++ b/octobot/community/community_analysis.py @@ -20,15 +20,12 @@ import octobot_commons.logging as logging import octobot_commons.constants as commons_constants import octobot.constants as constants +import octobot.community.identifiers_provider as identifiers_provider async def get_current_octobots_stats(): - bot_metrics_url = f"{commons_constants.METRICS_URL}metrics/community/count/" - return await _get_stats({ - "daily": f"{bot_metrics_url}0/0/-1", - "monthly": f"{bot_metrics_url}0/-1/0", - "all": f"{bot_metrics_url}0/0/0" - }) + bot_metrics_url = f"{identifiers_provider.IdentifiersProvider.COMMUNITY_API_URL}/stats" + return await _get_stats({"total_bots": bot_metrics_url}) async def _ensure_closed_sockets(): @@ -50,8 +47,8 @@ async def get_stats(url, stats_key): logger.error(f"Error when getting community status : error code={resp.status}") else: json_resp = await resp.json() - if "total" in json_resp: - bots_stats[stats_key] = json_resp["total"] + if any("total" in key for key in json_resp): + bots_stats[stats_key] = json_resp[stats_key] else: bots_stats[stats_key] = _format_top_elements(json_resp) except Exception as e: @@ -67,6 +64,8 @@ async def get_stats(url, stats_key): async def get_community_metrics(): + # todo migrate with new metrics + return {} bot_count_metrics_url = f"{commons_constants.METRICS_URL}metrics/community/count/" bot_top_metrics_url = f"{commons_constants.METRICS_URL}metrics/community/top/" one_month_time = int(time.time() - 30 * commons_constants.DAYS_TO_SECONDS) diff --git a/octobot/community/community_manager.py b/octobot/community/community_manager.py index c842acdb9..d75f8ad0a 100644 --- a/octobot/community/community_manager.py +++ b/octobot/community/community_manager.py @@ -72,13 +72,13 @@ async def start_community_task(self): # first ensure this session is not just a configuration test: register after a timer await asyncio.sleep(common_constants.TIMER_BEFORE_METRICS_REGISTRATION_SECONDS) self._init_community_config() - await self.register_session() + # await self.register_session() # waiting for metrics migration await self._update_authenticated_bot() while self.keep_running: # send a keepalive at periodic intervals await asyncio.sleep(common_constants.TIMER_BETWEEN_METRICS_UPTIME_UPDATE) try: - await self._update_session() + # await self._update_session() # waiting for metrics migration await self._update_authenticated_bot() except Exception as e: self.logger.debug(f"Exception when handling community data : {e}") diff --git a/octobot/community/identifiers_provider.py b/octobot/community/identifiers_provider.py index 3b406b92c..03c7101ea 100644 --- a/octobot/community/identifiers_provider.py +++ b/octobot/community/identifiers_provider.py @@ -22,6 +22,7 @@ class IdentifiersProvider: ENABLED_ENVIRONMENT: str = None COMMUNITY_LANDING_URL: str = None + COMMUNITY_API_URL: str = None COMMUNITY_URL: str = None FRONTEND_PASSWORD_RECOVER_URL: str = None BACKEND_URL: str = None @@ -31,6 +32,7 @@ class IdentifiersProvider: def use_production(): IdentifiersProvider.COMMUNITY_URL = constants.OCTOBOT_COMMUNITY_URL IdentifiersProvider.COMMUNITY_LANDING_URL = constants.OCTOBOT_COMMUNITY_LANDING_URL + IdentifiersProvider.COMMUNITY_API_URL = constants.OCTOBOT_COMMUNITY_API_URL IdentifiersProvider.FRONTEND_PASSWORD_RECOVER_URL = constants.OCTOBOT_COMMUNITY_RECOVER_PASSWORD_URL IdentifiersProvider.BACKEND_URL = constants.COMMUNITY_BACKEND_URL IdentifiersProvider.BACKEND_KEY = constants.COMMUNITY_BACKEND_KEY @@ -40,6 +42,7 @@ def use_production(): def use_staging(): IdentifiersProvider.COMMUNITY_URL = constants.STAGING_OCTOBOT_COMMUNITY_URL IdentifiersProvider.COMMUNITY_LANDING_URL = constants.STAGING_OCTOBOT_COMMUNITY_LANDING_URL + IdentifiersProvider.COMMUNITY_API_URL = constants.STAGING_OCTOBOT_COMMUNITY_API_URL IdentifiersProvider.FRONTEND_PASSWORD_RECOVER_URL = constants.STAGING_COMMUNITY_RECOVER_PASSWORD_URL IdentifiersProvider.BACKEND_URL = constants.STAGING_COMMUNITY_BACKEND_URL IdentifiersProvider.BACKEND_KEY = constants.STAGING_COMMUNITY_BACKEND_KEY diff --git a/octobot/constants.py b/octobot/constants.py index 52baf943a..a4c41aa3d 100644 --- a/octobot/constants.py +++ b/octobot/constants.py @@ -62,6 +62,7 @@ # production env SHOULD ONLY BE USED THROUGH CommunityIdentifiersProvider OCTOBOT_COMMUNITY_LANDING_URL = os.getenv("COMMUNITY_SERVER_URL", "https://octobot.cloud") +OCTOBOT_COMMUNITY_API_URL = os.getenv("COMMUNITY_SERVER_URL", f"{OCTOBOT_COMMUNITY_LANDING_URL}/api/community") OCTOBOT_COMMUNITY_URL = os.getenv("COMMUNITY_SERVER_URL", "https://app.octobot.cloud") OCTOBOT_COMMUNITY_RECOVER_PASSWORD_URL = OCTOBOT_COMMUNITY_URL # default env @@ -70,6 +71,7 @@ # staging env SHOULD ONLY BE USED THROUGH CommunityIdentifiersProvider STAGING_OCTOBOT_COMMUNITY_LANDING_URL = os.getenv("COMMUNITY_SERVER_URL", "https://beta.octobot.cloud") +STAGING_OCTOBOT_COMMUNITY_API_URL = os.getenv("COMMUNITY_SERVER_URL", f"{STAGING_OCTOBOT_COMMUNITY_LANDING_URL}/api/community") STAGING_OCTOBOT_COMMUNITY_URL = os.getenv("COMMUNITY_SERVER_URL", "https://app-beta.octobot.cloud/") STAGING_COMMUNITY_RECOVER_PASSWORD_URL = STAGING_OCTOBOT_COMMUNITY_URL STAGING_COMMUNITY_BACKEND_URL = os.getenv("COMMUNITY_BACKEND_URL", "https://wmfkgvgzokyzhvxowbyg.supabase.co") diff --git a/tests/unit_tests/community/test_community_data.py b/tests/unit_tests/community/test_community_data.py index fb6ffb7e7..15b9f081c 100644 --- a/tests/unit_tests/community/test_community_data.py +++ b/tests/unit_tests/community/test_community_data.py @@ -21,6 +21,8 @@ @pytest.mark.asyncio async def test_get_community_metrics(): metrics = await community_analysis.get_community_metrics() + assert metrics == {} + return # todo migrate with new metrics assert len(metrics) == 9 # ensure metrics are not empty assert all(content for content in metrics.values()) From 6476e6ec7e6a1535e96f335c5e2f2fa7da5d2b42 Mon Sep 17 00:00:00 2001 From: Guillaume De Saint Martin Date: Tue, 19 Dec 2023 21:42:04 +0100 Subject: [PATCH 6/7] [Tentacles] replace static by tentacles url --- octobot/commands.py | 4 ---- octobot/configuration_manager.py | 15 ++------------- octobot/constants.py | 2 +- 3 files changed, 3 insertions(+), 18 deletions(-) diff --git a/octobot/commands.py b/octobot/commands.py index c99c3ca48..0528f4622 100644 --- a/octobot/commands.py +++ b/octobot/commands.py @@ -46,10 +46,6 @@ def call_tentacles_manager(command_args): octobot_logger.init_logger() tentacles_urls = [ configuration_manager.get_default_tentacles_url(), - # tentacles_manager_api.get_compiled_tentacles_url( - # constants.DEFAULT_COMPILED_TENTACLES_URL, - # constants.TENTACLES_REQUIRED_VERSION - # ) ] sys.exit(tentacles_manager_cli.handle_tentacles_manager_command(command_args, tentacles_urls=tentacles_urls, diff --git a/octobot/configuration_manager.py b/octobot/configuration_manager.py index e4f79926b..9ac59bdf7 100644 --- a/octobot/configuration_manager.py +++ b/octobot/configuration_manager.py @@ -154,8 +154,8 @@ def get_default_tentacles_url(version=None): if constants.TENTACLES_REQUIRED_VERSION else constants.LONG_VERSION return os.getenv( constants.ENV_TENTACLES_URL, - f"{constants.STATIC_OCTOBOT_ONLINE}/" - f"{tentacles_repository}/" + f"https://{tentacles_repository}." + f"{constants.OCTOBOT_ONLINE}/" f"{os.getenv(constants.ENV_TENTACLES_PACKAGES_SOURCE, constants.OFFICIALS)}/" f"{os.getenv(constants.ENV_TENTACLES_PACKAGES_TYPE, constants.TENTACLE_PACKAGES)}/" f"{os.getenv(constants.ENV_TENTACLE_CATEGORY, constants.TENTACLE_CATEGORY)}/" @@ -165,17 +165,6 @@ def get_default_tentacles_url(version=None): ) -def get_default_compiled_tentacles_url(): - return os.getenv( - constants.ENV_COMPILED_TENTACLES_URL, - f"{constants.STATIC_OCTOBOT_ONLINE}/{constants.TENTACLES_REPOSITORY}/" - f"{os.getenv(constants.ENV_TENTACLES_PACKAGES_SOURCE, constants.OFFICIALS)}/" - f"{os.getenv(constants.ENV_COMPILED_TENTACLES_PACKAGES_TYPE, constants.TENTACLE_PACKAGES)}/" - f"{os.getenv(constants.ENV_COMPILED_TENTACLES_CATEGORY, constants.COMPILED_TENTACLE_CATEGORY)}/" - f"{os.getenv(constants.ENV_COMPILED_TENTACLES_SUBCATEGORY, '')}" - ) - - def get_user_local_config_file(): try: import octobot_commons.constants as commons_constants diff --git a/octobot/constants.py b/octobot/constants.py index a4c41aa3d..2181deb5f 100644 --- a/octobot/constants.py +++ b/octobot/constants.py @@ -39,7 +39,7 @@ OCTOBOT_DOCS_URL = os.getenv("DOCS_OCTOBOT_ONLINE_URL", "https://www.octobot.cloud/guides") EXCHANGES_DOCS_URL = os.getenv("DOCS_OCTOBOT_ONLINE_URL", "https://www.octobot.cloud/guides/exchanges/") DEVELOPER_DOCS_URL = os.getenv("DOCS_OCTOBOT_ONLINE_URL", "https://www.octobot.cloud/guides/developers/") -STATIC_OCTOBOT_ONLINE = os.getenv("TENTACLES_OCTOBOT_ONLINE_URL", "https://static.octobot.online") +OCTOBOT_ONLINE = os.getenv("TENTACLES_OCTOBOT_ONLINE_URL", "octobot.online") OCTOBOT_FEEDBACK = os.getenv("FEEDBACK_OCTOBOT_ONLINE_URL", "https://feedback.octobot.cloud/") TENTACLES_REPOSITORY = "tentacles" BETA_TENTACLES_REPOSITORY = "dev-tentacles" From 57919dfdf47f6986ab4c45867f570996dee417f7 Mon Sep 17 00:00:00 2001 From: Guillaume De Saint Martin Date: Tue, 19 Dec 2023 22:58:15 +0100 Subject: [PATCH 7/7] [Version] v1.0.5 --- CHANGELOG.md | 12 ++++++++++++ README.md | 2 +- octobot/__init__.py | 2 +- 3 files changed, 14 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 0718a160d..2914babd6 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,18 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 *It is strongly advised to perform an update of your tentacles after updating OctoBot. (start.py tentacles --install --all)* +## [1.0.5] - 2023-12-19 +### Added +- [GPTEvaluator] Settings to limit used tokens and disable re-evaluation +### Updated +- [WebInterface] Improve home display on smaller screens +### Fixed +- [Telegram] Fixed multiple telegram commands issues +- [TradingViewSignalsTradingMode] Fixed buy orders quantity issues +- [WebInterface] Fixed logs issues +- [GoogleTrends] Fixed issues with crypto in multiple words +- [Exchanges] Rare candles fetch error + ## [1.0.4] - 2023-12-10 ### Added - [Strategies] OctoBot cloud strategies can now be downloaded and used as regular OctoBot profiles diff --git a/README.md b/README.md index 9e714cfe7..4c6486e9c 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -# OctoBot [1.0.4](https://octobot.click/gh-changelog) +# OctoBot [1.0.5](https://octobot.click/gh-changelog) [![PyPI](https://img.shields.io/pypi/v/OctoBot.svg?logo=pypi)](https://octobot.click/gh-pypi) [![Downloads](https://pepy.tech/badge/octobot/month)](https://pepy.tech/project/octobot) [![Dockerhub](https://img.shields.io/docker/pulls/drakkarsoftware/octobot.svg?logo=docker)](https://octobot.click/gh-dockerhub) diff --git a/octobot/__init__.py b/octobot/__init__.py index f77bb31fe..181734bb6 100644 --- a/octobot/__init__.py +++ b/octobot/__init__.py @@ -16,5 +16,5 @@ PROJECT_NAME = "OctoBot" AUTHOR = "Drakkar-Software" -VERSION = "1.0.4" # major.minor.revision +VERSION = "1.0.5" # major.minor.revision LONG_VERSION = f"{VERSION}"