单笔期权默认改为币本位;未配置时按coin处理

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
dekun
2026-08-20 14:05:44 +08:00
parent 6c49c7d51c
commit 4fb3be35ef
14 changed files with 34 additions and 25 deletions
+2 -2
View File
@@ -113,8 +113,8 @@ OKX_OPTIONS_ENABLED=false
# OKX_OPTIONS_API_SECRET=
# OKX_OPTIONS_API_PASSPHRASE=
OKX_OPTIONS_ACCOUNT_LABEL=账户·期权
# 单笔期权本位: usdc(默认,权利金USDC) | coin(币本位+USDT买币桥;对冲仍仅USDC)
OKX_OPTIONS_MARGIN_MODE=usdc
# 单笔期权本位: coin(默认,币本位+USDT买币桥) | usdc(权利金USDC;对冲仍仅USDC)
OKX_OPTIONS_MARGIN_MODE=coin
OKX_OPTIONS_TRADE_BUDGET_USDC=10
OKX_OPTIONS_BUDGET_BUFFER=0.95
# 币本位:按交易户USDT×缓冲复利;上限开关默认关(靠人工转走)
+6 -6
View File
@@ -6630,7 +6630,7 @@ def render_main_page(page="trade", embed_mode=None):
options_funding_eth = None
options_trading_eth = None
options_trading_btc = None
options_margin_mode = "usdc"
options_margin_mode = "coin"
options_underly = "ETH"
if (
OKX_OPTIONS_ENABLED
@@ -6648,7 +6648,7 @@ def render_main_page(page="trade", embed_mode=None):
options_funding_eth = _op.get("funding_eth")
options_trading_eth = _op.get("trading_eth")
options_trading_btc = _op.get("trading_btc")
options_margin_mode = _op.get("options_margin_mode") or "usdc"
options_margin_mode = _op.get("options_margin_mode") or "coin"
options_underly = _op.get("options_underly") or "ETH"
except Exception:
options_trading_usdc = None
@@ -6658,7 +6658,7 @@ def render_main_page(page="trade", embed_mode=None):
options_funding_eth = None
options_trading_eth = None
options_trading_btc = None
options_margin_mode = "usdc"
options_margin_mode = "coin"
options_underly = "ETH"
recommended_capital = get_recommended_capital(current_capital)
key_list = (
@@ -7077,7 +7077,7 @@ def api_account_snapshot():
options_funding_eth = None
options_trading_eth = None
options_trading_btc = None
options_margin_mode = "usdc"
options_margin_mode = "coin"
options_underly = "ETH"
if OKX_OPTIONS_ENABLED and exchange_options.apiKey:
try:
@@ -7091,7 +7091,7 @@ def api_account_snapshot():
options_funding_eth = _op.get("funding_eth")
options_trading_eth = _op.get("trading_eth")
options_trading_btc = _op.get("trading_btc")
options_margin_mode = _op.get("options_margin_mode") or "usdc"
options_margin_mode = _op.get("options_margin_mode") or "coin"
options_underly = _op.get("options_underly") or "ETH"
except Exception:
options_trading_usdc = None
@@ -7101,7 +7101,7 @@ def api_account_snapshot():
options_funding_eth = None
options_trading_eth = None
options_trading_btc = None
options_margin_mode = "usdc"
options_margin_mode = "coin"
options_underly = "ETH"
recommended_capital = get_recommended_capital(current_capital)
from lib.strategy.strategy_trade_labels import count_position_limit_active_monitors