feat快照上报期权标的白名单,供中控条件单按币种过滤。

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
dekun
2026-10-13 19:18:52 +08:00
parent 1835a79698
commit 48f544b1f5
+12
View File
@@ -153,6 +153,16 @@ def _enrich_hub_protocol(snap: dict[str, Any], *, app_module: Any) -> dict[str,
} }
) )
_allowed = out.get("options_allowed_underlys")
if not isinstance(_allowed, list) or not _allowed:
_u0 = str(out.get("options_underly") or "ETH").strip().upper() or "ETH"
_allowed = [_u0] if _u0 in ("ETH", "BTC") else ["ETH", "BTC"]
else:
_allowed = [
str(x).strip().upper()
for x in _allowed
if str(x).strip().upper() in ("ETH", "BTC")
] or ["ETH", "BTC"]
out["instance"] = { out["instance"] = {
"label": label, "label": label,
"mode": mode, "mode": mode,
@@ -160,7 +170,9 @@ def _enrich_hub_protocol(snap: dict[str, Any], *, app_module: Any) -> dict[str,
"account_label": out.get("account_label") or "", "account_label": out.get("account_label") or "",
"margin_mode": out.get("options_margin_mode") or "coin", "margin_mode": out.get("options_margin_mode") or "coin",
"underly": out.get("options_underly") or "ETH", "underly": out.get("options_underly") or "ETH",
"allowed_underlys": _allowed,
} }
out["options_allowed_underlys"] = _allowed
funding_usdt = out.get("funding_usdt") funding_usdt = out.get("funding_usdt")
trading_usdt = out.get("trading_usdt") trading_usdt = out.get("trading_usdt")
funding_usdc = out.get("funding_usdc") funding_usdc = out.get("funding_usdc")