Make this repo hedge-only: skip standalone options UI by default.
Nav/env only expose 永期/期期; set STANDALONE_OPTIONS_UI=true for emergency opt-in. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -6869,9 +6869,13 @@ def render_main_page(page="trade", embed_mode=None):
|
||||
from lib.instance.instance_display_prefs_lib import display_prefs_template_context
|
||||
|
||||
_display_ctx = display_prefs_template_context(get_db)
|
||||
from lib.hedge_plan.okx_trade_mode_lib import get_okx_trade_mode
|
||||
from lib.hedge_plan.okx_trade_mode_lib import (
|
||||
get_okx_trade_mode,
|
||||
standalone_options_ui_enabled,
|
||||
)
|
||||
|
||||
_okx_trade_mode = get_okx_trade_mode()
|
||||
_standalone_options_ui = standalone_options_ui_enabled()
|
||||
_hedge_mode_on = _okx_trade_mode in ("perp_options", "options_options")
|
||||
_show_perp_funds = show_perp_funds_enabled(exchange_key="okx")
|
||||
template_ctx = dict(
|
||||
@@ -6969,9 +6973,9 @@ def render_main_page(page="trade", embed_mode=None):
|
||||
exchange_display=EXCHANGE_DISPLAY_NAME,
|
||||
options_enabled=OKX_OPTIONS_ENABLED,
|
||||
show_perp_funds=_show_perp_funds or (options_margin_mode == "coin"),
|
||||
options_nav_visible=True,
|
||||
options_nav_visible=_standalone_options_ui and _okx_trade_mode == "options",
|
||||
okx_trade_mode=_okx_trade_mode,
|
||||
options_open_allowed=_okx_trade_mode == "options",
|
||||
options_open_allowed=_standalone_options_ui and _okx_trade_mode == "options",
|
||||
hedge_plan_enabled=_hedge_mode_on,
|
||||
hedge_plan_nav_visible=_hedge_mode_on,
|
||||
hedge_plan_show_perp_options=_okx_trade_mode == "perp_options",
|
||||
@@ -9937,13 +9941,23 @@ from lib.sim.register import install_sim_trading
|
||||
|
||||
install_sim_trading(app, _REPO_ROOT, app_module=sys.modules[__name__])
|
||||
|
||||
from lib.options.options_register import install_options_trading
|
||||
# 本仓默认仅对冲:不装单独期权页/复盘/独立盯盘(执行层由 hedge 共用 okx_options_lib).
|
||||
# 紧急需要单独期权 UI 时设 STANDALONE_OPTIONS_UI=true(不推荐;专用期权仓更完整).
|
||||
from lib.hedge_plan.okx_trade_mode_lib import standalone_options_ui_enabled as _standalone_opt_ui
|
||||
|
||||
install_options_trading(app, _REPO_ROOT, app_module=sys.modules[__name__])
|
||||
if _standalone_opt_ui():
|
||||
from lib.options.options_register import install_options_trading
|
||||
|
||||
from lib.options.options_review_register import install_options_review
|
||||
install_options_trading(app, _REPO_ROOT, app_module=sys.modules[__name__])
|
||||
|
||||
install_options_review(app, _REPO_ROOT, app_module=sys.modules[__name__])
|
||||
from lib.options.options_review_register import install_options_review
|
||||
|
||||
install_options_review(app, _REPO_ROOT, app_module=sys.modules[__name__])
|
||||
else:
|
||||
print(
|
||||
"[boot] STANDALONE_OPTIONS_UI=false → skip options/review UI (hedge-only)",
|
||||
flush=True,
|
||||
)
|
||||
|
||||
from lib.hedge_plan.hedge_plan_register import install_hedge_plan
|
||||
|
||||
|
||||
Reference in New Issue
Block a user