Skip to content

Commit eab035b

Browse files
Hiksangclaude
andcommitted
fix: spot-perp netPnl now includes spot PnL (was perp-only)
netPnl was only counting perp unrealizedPnl, ignoring spot price change. For delta-neutral positions this inflated PnL by the perp leg's gain. Now correctly: spotPnL + perpPnL + funding - fees. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent c1d8e64 commit eab035b

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

src/commands/arb/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -475,7 +475,7 @@ export function registerArbManageCommands(
475475
holdDurationMs,
476476
estimatedFundingIncome,
477477
estimatedFees: totalFees,
478-
netPnl: shortPos.unrealizedPnl + estimatedFundingIncome - totalFees,
478+
netPnl: (spotValueUsd - shortPos.entryPrice * spotAmount) + shortPos.unrealizedPnl + estimatedFundingIncome - totalFees,
479479
dailyFundingEstimate,
480480
});
481481
}

0 commit comments

Comments
 (0)