PnL Slice 2: Unrealised + Total tiles with missing-spot handling#26
Merged
Conversation
Extends computePnl with the Unrealised path (mark-to-market on open lots against raw costBasis) and exposes Total = Realised + Unrealised. New Premium P&L tiles render alongside Realised, respect the asset filter, and degrade gracefully when spot is missing for some/all open assets. Closes #14. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Native title= only fires after a long browser delay and looks ugly. Tiles with a tip now render an ⓘ glyph next to the label and a styled popover above the card on hover. Native title= retained as a fallback. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This was referenced May 6, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
computePnl(trades, assetFilter, livePrices)with Unrealised (mark-to-market on open lots vs rawcostBasis), Total (Realised + Unrealised), andmissingSpotAssets.sFilter; missing spot shows dash + "spot unavailable for {asset}" sub-line, partial coverage sums available assets and lists the rest.Closes #14.
Test plan
npm test— 47 tests pass (7 new unit, 5 new integration)python3 build.py --check— JS syntax OKlivePrices = {}to confirm spot-unavailable fallback🤖 Generated with Claude Code