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:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user