Unify hub dashboard positions into one card with exchange links.
Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -1100,6 +1100,11 @@ def format_dashboard_account_detail(ac: dict) -> dict[str, Any]:
|
||||
contracts = p.get("size")
|
||||
upnl = _position_float_pnl(p)
|
||||
source = resolve_position_monitor_source(p, hub_mon)
|
||||
entry = _safe_float(p.get("entry_price"))
|
||||
mark = _safe_float(p.get("mark_price"))
|
||||
notional = _safe_float(p.get("notional_usdt"))
|
||||
if notional is None:
|
||||
notional = _safe_float(p.get("notional"))
|
||||
position_lines.append(
|
||||
{
|
||||
"kind": "position",
|
||||
@@ -1107,6 +1112,11 @@ def format_dashboard_account_detail(ac: dict) -> dict[str, Any]:
|
||||
"symbol": sym,
|
||||
"side": side,
|
||||
"contracts": contracts,
|
||||
"entry_price": entry,
|
||||
"entry_price_fmt": p.get("entry_price_fmt"),
|
||||
"mark_price": mark,
|
||||
"mark_price_fmt": p.get("mark_price_fmt"),
|
||||
"notional_usdt": notional,
|
||||
"text": f"{sym} {side}",
|
||||
"pnl": round(upnl, 4),
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user