Skip to content

PnL Slice 2: Unrealised + Total tiles with missing-spot handling#26

Merged
heyitsStylez merged 2 commits into
mainfrom
pnl-slice2-unrealised-total
May 6, 2026
Merged

PnL Slice 2: Unrealised + Total tiles with missing-spot handling#26
heyitsStylez merged 2 commits into
mainfrom
pnl-slice2-unrealised-total

Conversation

@heyitsStylez
Copy link
Copy Markdown
Owner

@heyitsStylez heyitsStylez commented May 5, 2026

Summary

  • Extend computePnl(trades, assetFilter, livePrices) with Unrealised (mark-to-market on open lots vs raw costBasis), Total (Realised + Unrealised), and missingSpotAssets.
  • Render Unrealised + Total tiles on Premium P&L Total tab with hover tooltips; respects sFilter; missing spot shows dash + "spot unavailable for {asset}" sub-line, partial coverage sums available assets and lists the rest.
  • Update CONTEXT.md (Unrealised + Total entries) and CLAUDE.md file map.

Closes #14.

Test plan

  • npm test — 47 tests pass (7 new unit, 5 new integration)
  • python3 build.py --check — JS syntax OK
  • Manual: open Premium P&L Total tab, verify Unrealised + Total tiles render, hover tooltips show, asset filter scopes, force livePrices = {} to confirm spot-unavailable fallback

🤖 Generated with Claude Code

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>
@vercel
Copy link
Copy Markdown

vercel Bot commented May 5, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
hyperwheel Ready Ready Preview, Comment May 5, 2026 11:57pm

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>
@heyitsStylez heyitsStylez merged commit 9e37591 into main May 6, 2026
4 checks passed
@heyitsStylez heyitsStylez deleted the pnl-slice2-unrealised-total branch May 6, 2026 00:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Slice 2: Unrealised + Total P&L tiles with missing-spot handling

1 participant