Fix monitor board crash: avoid shadowing options_open_position_count helper.

Rename the imported counter function so aggregate_monitor_board_totals no longer overwrites it with an int accumulator.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
dekun
2026-07-07 13:09:39 +08:00
parent 3163912266
commit 4a3afdfb48
2 changed files with 25 additions and 2 deletions
+5 -2
View File
@@ -3,7 +3,10 @@ from __future__ import annotations
from typing import Any
from lib.hub.hub_options_funds_lib import options_float_pnl_usdt, options_open_position_count
from lib.hub.hub_options_funds_lib import (
options_float_pnl_usdt,
options_open_position_count as count_options_positions,
)
def _coerce_float(value: Any) -> float | None:
@@ -83,7 +86,7 @@ def aggregate_monitor_board_totals(
float_pnl_u += sum(position_unrealized_pnl(p) for p in open_pos)
opt_snap = row.get("options") if "options" in (row.get("capabilities") or []) else None
opt_count = options_open_position_count(opt_snap)
opt_count = count_options_positions(opt_snap)
options_open_position_count += opt_count
open_position_count += opt_count
opt_upl = options_float_pnl_usdt(opt_snap)