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:
Vendored
+7
@@ -109,6 +109,8 @@ HOT_RELOAD_EXACT = frozenset({
|
||||
"MAX_ACTIVE_HEDGE_PLANS",
|
||||
"HEDGE_PLAN_LIVE_ORDER",
|
||||
"HEDGE_PLAN_OPTION_PRIMARY",
|
||||
"HEDGE_PO_MODE",
|
||||
"HEDGE_CROSS_NOTIONAL_K",
|
||||
"HEDGE_PLAN_OPEN_ORDER",
|
||||
"HEDGE_PLAN_ON_PERP_SL_CLOSE_OPTIONS",
|
||||
"HEDGE_PLAN_ON_PERP_TP_CLOSE_OPTIONS",
|
||||
@@ -177,6 +179,11 @@ SELECT_OPTIONS: dict[str, tuple[tuple[str, str], ...]] = {
|
||||
("true", "以期权为主"),
|
||||
("false", "保险模式"),
|
||||
),
|
||||
"HEDGE_PO_MODE": (
|
||||
("eth", "ETH永期(期权+永续同ETH)"),
|
||||
("btc", "BTC永期(期权+永续同BTC)"),
|
||||
("btc_eth", "跨币(BTC期权+ETH永续)"),
|
||||
),
|
||||
"SIM_DEFAULT_MODE": (
|
||||
("sim", "模拟盘"),
|
||||
("live", "实盘"),
|
||||
|
||||
Vendored
+13
-1
@@ -279,10 +279,20 @@ _HEDGE_COMMON_FIELDS: list[tuple[str, str, str]] = [
|
||||
]
|
||||
|
||||
_HEDGE_PO_FIELDS: list[tuple[str, str, str]] = [
|
||||
(
|
||||
"HEDGE_PO_MODE",
|
||||
"永期实例模式",
|
||||
"eth/btc/btc_eth;一实例一种模式对应一个子账户;模拟与实盘同路径;改后须重启",
|
||||
),
|
||||
(
|
||||
"HEDGE_CROSS_NOTIONAL_K",
|
||||
"跨币永续名义系数",
|
||||
"仅 btc_eth;默认 0.5=永续名义为期权名义一半;改后须重启",
|
||||
),
|
||||
(
|
||||
"HEDGE_PLAN_OPTION_PRIMARY",
|
||||
"永期模式(以期权为主/保险)",
|
||||
"默认 true=以期权为主;false=保险模式;页面标题前显示标识,不可在页内切换",
|
||||
"实例模式强制以期权为主;一般保持 true",
|
||||
),
|
||||
("HEDGE_PLAN_OPEN_ORDER", "永期开仓顺序", "options_first 或 perp_first"),
|
||||
("HEDGE_PLAN_ON_PERP_SL_CLOSE_OPTIONS", "永期止损后强制平期权", "保护机制,建议保持 true"),
|
||||
@@ -364,6 +374,8 @@ _RUNTIME_ENV_DEFAULTS: dict[str, str] = {
|
||||
"HEDGE_PLAN_OO_BIAS_RATIO": "0.7",
|
||||
"HEDGE_PLAN_BUDGET_BUFFER": "0.95",
|
||||
"HEDGE_PLAN_OPTION_PRIMARY": "true",
|
||||
"HEDGE_PO_MODE": "eth",
|
||||
"HEDGE_CROSS_NOTIONAL_K": "0.5",
|
||||
"HEDGE_PLAN_OPTIONS_MUTUAL_EXCLUSIVE": "true",
|
||||
"HEDGE_PLAN_MANUAL_COMPLETE_ON_PARTIAL": "true",
|
||||
"OKX_OPTIONS_CLOSE_GATE_MODE": "premium",
|
||||
|
||||
Reference in New Issue
Block a user