feat期权标的白名单:可固定只显示 ETH 或 BTC。

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
dekun
2026-10-13 19:09:06 +08:00
parent 8d846794a2
commit 1835a79698
11 changed files with 215 additions and 13 deletions
+18 -3
View File
@@ -3925,6 +3925,19 @@ def render_main_page(page="options", embed_mode=None):
options_trading_btc = None
options_margin_mode = "coin"
options_underly = "ETH"
try:
from lib.options.options_underly_lib import (
parse_options_underlyings,
resolve_default_underly,
)
_options_uly_allowed = parse_options_underlyings()
_options_uly_default = resolve_default_underly(_options_uly_allowed)
options_underly = _options_uly_default
except Exception:
_options_uly_allowed = ["ETH", "BTC"]
_options_uly_default = OKX_OPTIONS_DEFAULT_UNDERLY or "ETH"
options_underly = _options_uly_default
_sim_mode_for_header = False
_exchange_display_for_header = EXCHANGE_DISPLAY_NAME
try:
@@ -3955,7 +3968,8 @@ def render_main_page(page="options", embed_mode=None):
options_trading_eth = _op.get("trading_eth")
options_trading_btc = _op.get("trading_btc")
options_margin_mode = _op.get("options_margin_mode") or "coin"
options_underly = _op.get("options_underly") or "ETH"
# 顶栏展示仍可用交易所包里的 underly;交易默认以白名单解析为准
options_underly = _options_uly_default or _op.get("options_underly") or "ETH"
except Exception:
options_trading_usdc = None
options_funding_usdc = None
@@ -3965,7 +3979,7 @@ def render_main_page(page="options", embed_mode=None):
options_trading_eth = None
options_trading_btc = None
options_margin_mode = "coin"
options_underly = "ETH"
options_underly = _options_uly_default
recommended_capital = get_recommended_capital(capital_for_sizing)
conn = get_db()
key_list = (
@@ -4201,7 +4215,8 @@ def render_main_page(page="options", embed_mode=None):
options_compound_full_cap_usdc=float(
os.getenv("OKX_OPTIONS_COMPOUND_FULL_CAP_USDC") or "300"
),
options_default_underly=OKX_OPTIONS_DEFAULT_UNDERLY,
options_default_underly=_options_uly_default,
options_allowed_underlys=_options_uly_allowed,
options_chain_ask_liq_filter=os.getenv(
"OKX_OPTIONS_CHAIN_ASK_LIQ_FILTER_ENABLED", "true"
).lower()