Align options realtime PnL with bid-net and show totals in stats.
Header float PnL now uses bid recycle minus premium like position cards. Stats adds realized/open/total net PnL. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -14,7 +14,13 @@ class OptionsHubLibTests(TestCase):
|
||||
@patch("lib.options.options_positions_lib.build_display_option_positions")
|
||||
def test_build_options_hub_snapshot_positions(self, mock_positions, _mock_stats):
|
||||
mock_positions.return_value = [
|
||||
{"inst_id": "ETH-USD_UM-260703-1800-C", "pos": 2, "upl": 1.5, "mark_px": 0.1}
|
||||
{
|
||||
"inst_id": "ETH-USD_UM-260703-1800-C",
|
||||
"pos": 2,
|
||||
"upl": 9.9,
|
||||
"mark_px": 0.1,
|
||||
"close_preview": {"estimated_pnl": 1.5},
|
||||
}
|
||||
]
|
||||
conn = MagicMock()
|
||||
conn.__enter__ = MagicMock(return_value=conn)
|
||||
|
||||
Reference in New Issue
Block a user