Harden env save against empty numerics; default coin margin and hedge off.

Reject blank float/int/select on save and parse env with safe helpers so options config edits cannot crash into 502; default OKX_TRADE_MODE=options and OKX_OPTIONS_MARGIN_MODE=coin.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
dekun
2026-08-21 18:04:19 +08:00
parent d1e6d841c9
commit 6215d0975d
6 changed files with 129 additions and 62 deletions
+2 -2
View File
@@ -156,8 +156,8 @@ OKX_OPTIONS_OPEN_FILL_TIMEOUT_SEC=12
# =============================================================================
# 以下三项已由 OKX_TRADE_MODE 取代,保留兼容旧部署(未配置 TRADE_MODE 时仍可读)
HEDGE_PLAN_ENABLED=false
HEDGE_PLAN_SHOW_PERP_OPTIONS=true
HEDGE_PLAN_SHOW_OPTIONS_OPTIONS=true
HEDGE_PLAN_SHOW_PERP_OPTIONS=false
HEDGE_PLAN_SHOW_OPTIONS_OPTIONS=false
HEDGE_PLAN_LIVE_ORDER=false
# 永期子模式:true=以期权为主;false=保险模式(页面标题前标识,不可页内切换)
HEDGE_PLAN_OPTION_PRIMARY=true