Show options position source (纯期权/永期/期期) on holdings cards.
Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -763,6 +763,17 @@ def register_options_routes(app: Flask, cfg: dict[str, Any]) -> None:
|
||||
hedge_target = hedge_target_map.get(inst)
|
||||
if hedge_target:
|
||||
row["hedge_plan_target"] = hedge_target
|
||||
try:
|
||||
from lib.instance.instance_dashboard_lib import _resolve_options_source
|
||||
|
||||
source_key, source_label, source_plan_id = _resolve_options_source(conn, inst)
|
||||
row["source"] = source_key
|
||||
row["source_label"] = source_label
|
||||
row["source_plan_id"] = source_plan_id
|
||||
except Exception:
|
||||
row.setdefault("source", "option")
|
||||
row.setdefault("source_label", "纯期权")
|
||||
row.setdefault("source_plan_id", None)
|
||||
rows.append(row)
|
||||
finally:
|
||||
conn.close()
|
||||
|
||||
Reference in New Issue
Block a user