fix: sync live TP/SL to position cards after entrust changes

Use exchange TP/SL for display and DB sync on price_snapshot polls, refresh instance UI cells on each tick, and merge live values into hub monitor board.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
dekun
2026-06-09 11:06:27 +08:00
parent 7cb55f6557
commit f7d94f67d7
12 changed files with 291 additions and 89 deletions
+9
View File
@@ -1269,6 +1269,15 @@ def _merge_flask_order_price_fields(hub_mon: dict | None, snap: dict | None) ->
o["rr_ratio"] = op["rr_ratio"]
if "sl_breakeven_secured" in op:
o["sl_breakeven_secured"] = bool(op["sl_breakeven_secured"])
for key in (
"stop_loss",
"take_profit",
"stop_loss_display",
"take_profit_display",
"display_rr_ratio",
):
if key in op and op[key] not in (None, ""):
o[key] = op[key]
def _merge_flask_position_breakeven(agent_row: dict, snap: dict | None, hub_mon: dict | None) -> None: