Deduct round-trip taker fees from estimated perp PnL.
Unify hub/instance TP profit, calc_pnl, and push/accounting to net of 0.05% per side; leave exchange floating PnL unchanged. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -43,4 +43,5 @@ def test_infer_initial_position_from_live():
|
||||
|
||||
|
||||
def test_reward_at_tp_long():
|
||||
assert roll_ui.reward_at_tp_usdt("long", 100.0, 110.0, 2.0) == 20.0
|
||||
# 毛利 20, 双边费 (200+220)*0.0005=0.21 → 净 19.79
|
||||
assert abs(roll_ui.reward_at_tp_usdt("long", 100.0, 110.0, 2.0) - 19.79) < 1e-6
|
||||
|
||||
Reference in New Issue
Block a user