diff --git a/.gitignore b/.gitignore index 33620176..9d7dcf48 100644 --- a/.gitignore +++ b/.gitignore @@ -134,4 +134,7 @@ dmypy.json # Optimize studies and strategies quants_lab/optimizations/* -quants_lab/strategy/experiments/* \ No newline at end of file +quants_lab/strategy/experiments/* + +# Master bot template user-added configs +hummingbot_files/templates/master_bot_conf/conf/* \ No newline at end of file diff --git a/hummingbot_files/templates/master_bot_conf/conf/conf_fee_overrides.yml b/hummingbot_files/templates/master_bot_conf/conf/conf_fee_overrides.yml index 76512b13..3345de57 100644 --- a/hummingbot_files/templates/master_bot_conf/conf/conf_fee_overrides.yml +++ b/hummingbot_files/templates/master_bot_conf/conf/conf_fee_overrides.yml @@ -302,3 +302,15 @@ polkadex_taker_percent_fee: polkadex_buy_percent_fee_deducted_from_returns: polkadex_maker_fixed_fees: polkadex_taker_fixed_fees: +vertex_percent_fee_token: +vertex_maker_percent_fee: +vertex_taker_percent_fee: +vertex_buy_percent_fee_deducted_from_returns: +vertex_maker_fixed_fees: +vertex_taker_fixed_fees: +vertex_testnet_percent_fee_token: +vertex_testnet_maker_percent_fee: +vertex_testnet_taker_percent_fee: +vertex_testnet_buy_percent_fee_deducted_from_returns: +vertex_testnet_maker_fixed_fees: +vertex_testnet_taker_fixed_fees: diff --git a/main.py b/main.py index 2b20286d..8b8ac10c 100644 --- a/main.py +++ b/main.py @@ -9,9 +9,9 @@ [ Page("main.py", "Hummingbot Dashboard", "📊"), Section("Bot Orchestration", "🐙"), - Page("pages/master_conf/app.py", "Master Conf", "🗝️"), - Page("pages/bot_orchestration/app.py", "Bots Manager", "🦅"), - Page("pages/file_manager/app.py", "File Manager", "🗂"), + Page("pages/master_conf/app.py", "Credentials", "🗝️"), + Page("pages/bot_orchestration/app.py", "Instances", "🦅"), + Page("pages/file_manager/app.py", "Strategy Configs", "🗂"), Section("Backtest Manager", "⚙️"), Page("pages/candles_downloader/app.py", "Get Data", "💾"), Page("pages/backtest_manager/create.py", "Create", "⚔️"), diff --git a/pages/master_conf/app.py b/pages/master_conf/app.py index 76849813..c584772f 100644 --- a/pages/master_conf/app.py +++ b/pages/master_conf/app.py @@ -19,7 +19,7 @@ board = Dashboard() mc_board = SimpleNamespace( dashboard=board, - launch_master_bot=LaunchMasterBotCard(board, 0, 0, 12, 1), + launch_master_bot=LaunchMasterBotCard(board, 0, 0, 12, 2), file_explorer=MasterConfFileExplorer(board, 0, 4, 3, 7), editor=Editor(board, 4, 4, 9, 7), ) diff --git a/ui_components/bot_performance_card.py b/ui_components/bot_performance_card.py index 6b936021..e077c189 100644 --- a/ui_components/bot_performance_card.py +++ b/ui_components/bot_performance_card.py @@ -89,7 +89,7 @@ def __call__(self, bot_config: dict): mui.icon.DeleteForever() mui.Typography("Stop Instance") with mui.Grid(item=True, xs=6): - mui.TextField(disabled=True, - label="Attach to bot instance", + mui.TextField(InputProps={"readOnly": True}, + label="Attach to instance", value="docker attach " + bot_name, sx={"width": "100%"}) diff --git a/ui_components/editor.py b/ui_components/editor.py index 5e825ede..538560ae 100644 --- a/ui_components/editor.py +++ b/ui_components/editor.py @@ -60,7 +60,7 @@ def __call__(self): with mui.Grid(container=True, spacing=4, sx={"display": "flex", "alignItems": "center"}): with mui.Grid(item=True, xs=10, sx={"display": "flex", "alignItems": "center"}): mui.icon.Terminal() - mui.Typography("Editor") + mui.Typography("Editor", variant="h6", sx={"marginLeft": 1}) with mui.Tabs(value=self._index, onChange=self._change_tab, scrollButtons=True, variant="scrollable", sx={"flex": 1}): for label in self._tabs.keys(): diff --git a/ui_components/file_explorer_base.py b/ui_components/file_explorer_base.py index 066b5ced..22d1b85b 100644 --- a/ui_components/file_explorer_base.py +++ b/ui_components/file_explorer_base.py @@ -53,7 +53,7 @@ def __call__(self): with mui.Grid(container=True, spacing=4, sx={"display": "flex", "alignItems": "center"}): with mui.Grid(item=True, xs=6, sx={"display": "flex", "alignItems": "center"}): mui.icon.Folder() - mui.Typography("File Explorer") + mui.Typography("File Explorer", variant="h6", sx={"marginLeft": 1}) with mui.Grid(item=True, xs=6, sx={"display": "flex", "justifyContent": "flex-end"}): mui.IconButton(mui.icon.Delete, onClick=self.delete_file, sx={"mx": 1}) mui.IconButton(mui.icon.Edit, onClick=self.add_file_to_tab, sx={"mx": 1}) diff --git a/ui_components/launch_bot_card.py b/ui_components/launch_bot_card.py index 27af8a27..34d42dde 100644 --- a/ui_components/launch_bot_card.py +++ b/ui_components/launch_bot_card.py @@ -34,7 +34,7 @@ def launch_new_bot(self): base_conf_folder=f"{constants.HUMMINGBOT_TEMPLATES}/{self._base_bot_config}/.", target_conf_folder=f"{constants.BOTS_FOLDER}/{bot_name}/.", image=self._image_name) - with st.spinner('Starting Master Bot Conf... This process may take a few seconds'): + with st.spinner('Starting Master Configs instance... This process may take a few seconds'): time.sleep(3) else: st.warning("You need to define the bot name and image in order to create one.") @@ -49,44 +49,47 @@ def __call__(self): sx={"display": "flex", "flexDirection": "column", "borderRadius": 3, "overflow": "hidden"}, elevation=1): with self.title_bar(padding="10px 15px 10px 15px", dark_switcher=False): - mui.Typography("🚀 Create Instance", variant="h4") + mui.Typography("🚀 Create Instance", variant="h5") + with mui.Grid(container=True, spacing=2, sx={"padding": "10px 15px 10px 15px"}): - if not is_master_password_set: - with mui.Grid(item=True, xs=8): - base_warning = "You need to set a master password in order to use the dashboard." - if self.is_master_bot_running: - mui.Alert(f"{base_warning} Master Bot Conf is running, run in a terminal docker attach " - f"hummingbot-master_bot_conf and set the master password.", severity="success") - else: - mui.Alert(f"{base_warning} Master Bot Conf is not running, press start, attach the instance" - f" in your terminal and introduce the password to continue.", severity="error") - else: - with mui.Grid(item=True, xs=5): - mui.TextField(label="Bot Name", variant="outlined", onChange=lazy(self._set_bot_name), - sx={"width": "100%"}) - with mui.Grid(item=True, xs=5): - mui.TextField(label="Docker Image", defaultValue="hummingbot/hummingbot:latest", - variant="outlined", onChange=lazy(self._set_image_name), - sx={"width": "100%"}) + with mui.Grid(item=True, xs=8): + if not is_master_password_set: + base_warning = "You need to set a master password in order to use the dashboard." + if self.is_master_bot_running: + mui.Alert(f"{base_warning} The Master Configs instance is running." + f" Attach to it in Terminal to set the master password.", severity="success") + else: + mui.Alert(f"{base_warning} Master Configs instance isn't running. Start it and" + f" set the master password to continue.", severity="error") + else: + mui.Alert("The new instance will contain the credentials configured in the following base instance:", + severity="info") + with mui.Grid(item=True, xs=4): + master_configs = [conf.split("/")[-2] for conf in + get_directories_from_directory(constants.HUMMINGBOT_TEMPLATES) if + "bot_conf" in conf] + with mui.FormControl(variant="standard", sx={"width": "100%"}): + mui.FormHelperText("Base Configs") + with mui.Select(label="Base Configs", defaultValue=master_configs[0], + variant="standard", onChange=lazy(self._set_base_bot_config)): + for master_config in master_configs: + mui.MenuItem(master_config, value=master_config) + with mui.Grid(item=True, xs=4): + mui.TextField(label="Instance Name", variant="outlined", onChange=lazy(self._set_bot_name), + sx={"width": "100%"}) + with mui.Grid(item=True, xs=4): + mui.TextField(label="Hummingbot Image", + defaultValue="hummingbot/hummingbot:latest", + variant="outlined", + placeholder="hummingbot-[name]", + onChange=lazy(self._set_image_name), + sx={"width": "100%"}) - with mui.Grid(item=True, xs=2): + with mui.Grid(item=True, xs=4): with mui.Button(onClick=self.launch_new_bot, variant="outlined", color="success", sx={"width": "100%", "height": "100%"}): mui.icon.AddCircleOutline() mui.Typography("Create") - with mui.Grid(item=True, xs=8): - mui.Alert("The bot will contain the credentials configured in the following Base Bot Configuration.", - severity="info") - with mui.Grid(item=True, xs=4): - master_configs = [conf.split("/")[-2] for conf in - get_directories_from_directory(constants.HUMMINGBOT_TEMPLATES) if - "bot_conf" in conf] - with mui.FormControl(variant="standard", sx={"width": "100%"}): - mui.FormHelperText("Base Bot Config") - with mui.Select(label="Base Bot Config", defaultValue=master_configs[0], - variant="standard", onChange=lazy(self._set_base_bot_config)): - for master_config in master_configs: - mui.MenuItem(master_config, value=master_config) diff --git a/ui_components/launch_broker_card.py b/ui_components/launch_broker_card.py index b6a24a4b..c842583a 100644 --- a/ui_components/launch_broker_card.py +++ b/ui_components/launch_broker_card.py @@ -17,11 +17,11 @@ def __init__(self, *args, **kwargs): def manage_broker_container(self): if self.is_broker_running: DockerManager().stop_container("hummingbot-broker") - with st.spinner('Stopping Hummingbot Broker... you will not going to be able to manage bots anymore.'): + with st.spinner('Stopping Hummingbot Broker... This process may take a few seconds...'): time.sleep(5) else: DockerManager().create_broker() - with st.spinner('Starting Hummingbot Broker... This process may take a few seconds'): + with st.spinner('Starting Hummingbot Broker... This process may take a few seconds...'): time.sleep(20) def __call__(self): @@ -31,13 +31,13 @@ def __call__(self): sx={"display": "flex", "flexDirection": "column", "borderRadius": 3, "overflow": "hidden"}, elevation=1): with self.title_bar(padding="10px 15px 10px 15px", dark_switcher=False): - mui.Typography("🐙 Manage Broker", variant="h4") + mui.Typography("🐙 Manage Broker", variant="h5") with mui.Grid(container=True, spacing=2, sx={"padding": "10px 15px 10px 15px"}): with mui.Grid(item=True, xs=8): if self.is_broker_running: - mui.Alert("Hummingbot Broker is running, you can control your bots now!", severity="success") + mui.Alert("Hummingbot Broker is running - control your bots now!", severity="success") else: - mui.Alert("Humminngbot Broker is not running, start it to start controlling your bots.", + mui.Alert("Hummingbot Broker is not running - start it to control your bots.", severity="error") with mui.Grid(item=True, xs=4): diff --git a/ui_components/launch_master_bot_card.py b/ui_components/launch_master_bot_card.py index 73bd1be8..6b6d1e58 100644 --- a/ui_components/launch_master_bot_card.py +++ b/ui_components/launch_master_bot_card.py @@ -17,14 +17,14 @@ def __init__(self, *args, **kwargs): def manage_master_bot_container(self): if self.is_master_bot_running: DockerManager().stop_container("hummingbot-master_bot_conf") - with st.spinner('Stopping Master Bot Conf... you will not going to be able to add more credentials.'): + with st.spinner('Stopping Master Configs instance... This process may take a few seconds.'): time.sleep(5) else: DockerManager().create_hummingbot_instance(instance_name="hummingbot-master_bot_conf", base_conf_folder="hummingbot_files/templates/master_bot_conf/.", target_conf_folder="hummingbot_files/templates/master_bot_conf/." ) - with st.spinner('Starting Master Bot Conf... This process may take a few seconds'): + with st.spinner('Starting Master Configs instance... This process may take a few seconds.'): time.sleep(3) def __call__(self): @@ -37,26 +37,35 @@ def __call__(self): sx={"display": "flex", "flexDirection": "column", "borderRadius": 3, "overflow": "hidden"}, elevation=1): with self.title_bar(padding="10px 15px 10px 15px", dark_switcher=False): - mui.icon.OndemandVideo() - mui.Typography("🔑 Master Bot Config") + mui.icon.Key() + mui.Typography("Master Configs", variant="h6", sx={"marginLeft": 1}) + with mui.Grid(container=True, spacing=2, sx={"padding": "10px 15px 10px 15px"}): - with mui.Grid(item=True, xs=8): + with mui.Grid(item=True, xs=12): if not is_master_password_set: base_warning = "You need to set a master password in order to use the dashboard." if self.is_master_bot_running: - mui.Alert(f"{base_warning} Master Bot Conf is running, run in a terminal docker attach " - f"hummingbot-master_bot_conf and set the master password.", severity="success") + mui.Alert(f"{base_warning} The Master Configs instance is running." + f" Attach to it in Terminal to set the master password.", severity="success") else: - mui.Alert(f"{base_warning} Master Bot Conf is not running, press start, attach the instance" - f" in your terminal and introduce the password to continue.", severity="error") + mui.Alert(f"{base_warning} Master Configs instance isn't running. Start it and" + f" set the master password to continue.", severity="error") else: if self.is_master_bot_running: - mui.Alert("Master Bot Conf is running, you can add more credentials. Run in a terminal " - "docker attach hummingbot-master_bot_conf", severity="success") + mui.Alert("The Master Configs instance is running." + " Attach to it in Terminal to add credentials.", + severity="success", + sx={"margin": 2}) else: - mui.Alert("Master Bot Conf is not running, press start to add more credentials.", - severity="error") + mui.Alert("Master Configs instance isn't running. Start it to add credentials.", + severity="error") + with mui.Grid(item=True, xs=8): + if self.is_master_bot_running: + mui.TextField(InputProps={"readOnly": True}, + label="Attach to Master Configs instance", + value="docker attach hummingbot-master_bot_conf", + sx={"width": "100%"}) with mui.Grid(item=True, xs=4): button_text = "Stop" if self.is_master_bot_running else "Start" color = "error" if self.is_master_bot_running else "success" @@ -66,6 +75,4 @@ def __call__(self): variant="outlined", sx={"width": "100%", "height": "100%"}): icon() - mui.Typography(button_text) - - + mui.Typography(button_text) \ No newline at end of file