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
+3
View File
@@ -90,6 +90,9 @@ def init_hedge_plan_tables(conn: sqlite3.Connection) -> None:
# 出场:profit=盈利金额(扣双边费);target=目标位点数
_ensure_column(conn, "hedge_plans", "exit_mode", "TEXT")
_ensure_column(conn, "hedge_plans", "profit_target_usdt", "REAL")
# 永期实例模式:eth|btc|btc_eth;跨币时 underlying=期权标的,perp_underlying=永续标的
_ensure_column(conn, "hedge_plans", "po_mode", "TEXT")
_ensure_column(conn, "hedge_plans", "perp_underlying", "TEXT")
_ensure_column(conn, "hedge_plan_legs", "ct_mult", "REAL")