Add hub TP profit field, 2-decimal options PnL, and exchange mark price display.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
dekun
2026-07-08 17:22:26 +08:00
parent e3e53ff7f5
commit 279648de56
8 changed files with 58 additions and 7 deletions
+12
View File
@@ -1989,6 +1989,7 @@ _ORDER_PRICE_MERGE_KEYS = (
"display_rr_ratio",
"latest_risk_amount",
"contracts",
"reward_at_tp_usdt",
"exchange_initial_margin",
"plan_margin",
"time_close_enabled",
@@ -2120,6 +2121,17 @@ def _merge_flask_position_breakeven(agent_row: dict, snap: dict | None, hub_mon:
break
if isinstance(matched, dict):
_apply_order_price_op_fields(p, matched)
disp = matched.get("exchange_mark_price_display")
if disp is not None and str(disp).strip() not in ("", "-"):
p["mark_price_fmt"] = str(disp)
mp = matched.get("exchange_mark_price")
if mp is not None:
try:
mpf = float(mp)
if mpf > 0:
p["mark_price"] = mpf
except (TypeError, ValueError):
pass
def _agent_position_has_mark(p: dict) -> bool: