mirror of
https://github.com/d0zingcat/deploy.git
synced 2026-06-07 15:10:55 +00:00
(feat) update pages
This commit is contained in:
@@ -130,5 +130,12 @@ with c3:
|
||||
|
||||
if upload_config_to_backend:
|
||||
backend_api_client = get_backend_api_client()
|
||||
backend_api_client.add_controller_config(config)
|
||||
st.success("Config uploaded successfully!")
|
||||
try:
|
||||
config_name = config.get("id", id.lower())
|
||||
backend_api_client.controllers.create_or_update_controller_config(
|
||||
config_name=config_name,
|
||||
config=config
|
||||
)
|
||||
st.success("Config uploaded successfully!")
|
||||
except Exception as e:
|
||||
st.error(f"Failed to upload config: {e}")
|
||||
|
||||
@@ -1,46 +0,0 @@
|
||||
import streamlit as st
|
||||
|
||||
|
||||
def user_inputs():
|
||||
c1, c2, c3, c4, c5 = st.columns([1, 1, 1, 1, 1])
|
||||
with c1:
|
||||
maker_connector = st.text_input("Maker Connector", value="kucoin")
|
||||
maker_trading_pair = st.text_input("Maker Trading Pair", value="LBR-USDT")
|
||||
with c2:
|
||||
taker_connector = st.text_input("Taker Connector", value="okx")
|
||||
taker_trading_pair = st.text_input("Taker Trading Pair", value="LBR-USDT")
|
||||
with c3:
|
||||
min_profitability = st.number_input("Min Profitability (%)", value=0.2, step=0.01) / 100
|
||||
max_profitability = st.number_input("Max Profitability (%)", value=1.0, step=0.01) / 100
|
||||
with c4:
|
||||
buy_maker_levels = st.number_input("Buy Maker Levels", value=1, step=1)
|
||||
buy_targets_amounts = []
|
||||
c41, c42 = st.columns([1, 1])
|
||||
for i in range(buy_maker_levels):
|
||||
with c41:
|
||||
target_profitability = st.number_input(f"Target Profitability {i + 1} B% ", value=0.3, step=0.01)
|
||||
with c42:
|
||||
amount = st.number_input(f"Amount {i + 1}B Quote", value=10, step=1)
|
||||
buy_targets_amounts.append([target_profitability / 100, amount])
|
||||
with c5:
|
||||
sell_maker_levels = st.number_input("Sell Maker Levels", value=1, step=1)
|
||||
sell_targets_amounts = []
|
||||
c51, c52 = st.columns([1, 1])
|
||||
for i in range(sell_maker_levels):
|
||||
with c51:
|
||||
target_profitability = st.number_input(f"Target Profitability {i + 1}S %", value=0.3, step=0.001)
|
||||
with c52:
|
||||
amount = st.number_input(f"Amount {i + 1} S Quote", value=10, step=1)
|
||||
sell_targets_amounts.append([target_profitability / 100, amount])
|
||||
return {
|
||||
"controller_name": "xemm_multiple_levels",
|
||||
"controller_type": "generic",
|
||||
"maker_connector": maker_connector,
|
||||
"maker_trading_pair": maker_trading_pair,
|
||||
"taker_connector": taker_connector,
|
||||
"taker_trading_pair": taker_trading_pair,
|
||||
"min_profitability": min_profitability,
|
||||
"max_profitability": max_profitability,
|
||||
"buy_levels_targets_amount": buy_targets_amounts,
|
||||
"sell_levels_targets_amount": sell_targets_amounts
|
||||
}
|
||||
Reference in New Issue
Block a user