Add HEDGE_PO_MODE instance modes with shared sim/live path.

Lock one mode per instance/subaccount, cross-asset BTC option/ETH perp sizing, combo-U exit, and ship docs/tests/audit.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
dekun
2026-10-14 20:05:25 +08:00
parent ab7a2309ad
commit 5d161b4220
18 changed files with 1215 additions and 115 deletions
+5
View File
@@ -164,6 +164,11 @@ HEDGE_PLAN_SHOW_OPTIONS_OPTIONS=true
HEDGE_PLAN_LIVE_ORDER=false
# 永期子模式:true=以期权为主;false=保险模式(页面标题前标识,不可页内切换)
HEDGE_PLAN_OPTION_PRIMARY=true
# 永期实例模式(一实例一种;对应一个子账户;模拟/实盘同路径;改后须重启 PM2)
# eth=ETH期权+ETH永续 | btc=BTC期权+BTC永续 | btc_eth=BTC期权+ETH永续(名义×K)
HEDGE_PO_MODE=eth
# 仅 btc_eth:永续名义 = 期权名义 × K(默认 0.5);比例=1/K
HEDGE_CROSS_NOTIONAL_K=0.5
HEDGE_PLAN_OPEN_ORDER=options_first
HEDGE_PLAN_ON_PERP_SL_CLOSE_OPTIONS=true
HEDGE_PLAN_ON_PERP_TP_CLOSE_OPTIONS=false