fix(hub): live market PnL and Gate drag SL place
Parse Gate unrealised_pnl in agent; refresh hub market floating PnL from board and trends; clamp Gate TP/SL triggers before place. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -1377,6 +1377,10 @@
|
||||
});
|
||||
});
|
||||
const upnl = resolveTrendFloatingPnl(pos, trendPlan);
|
||||
const planMargin =
|
||||
trendPlan && trendPlan.plan_margin_capital != null
|
||||
? num(trendPlan.plan_margin_capital)
|
||||
: null;
|
||||
return {
|
||||
exchange_id: exchangeId || null,
|
||||
symbol: (pos.symbol || "").trim(),
|
||||
@@ -1389,6 +1393,7 @@
|
||||
contracts: num(pos.contracts),
|
||||
unrealized_pnl: upnl != null ? Number(upnl) : null,
|
||||
notional_usdt: num(pos.notional_usdt),
|
||||
plan_margin: planMargin,
|
||||
orders: orders,
|
||||
};
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user