Skip to content

feat(portfolio): chart value with and without staking - #875

Open
adamsoffer wants to merge 2 commits into
claimed-delegator-historyfrom
portfolio-value-chart
Open

adamsoffer wants to merge 2 commits into
claimed-delegator-historyfrom
portfolio-value-chart

Conversation

@adamsoffer

@adamsoffer adamsoffer commented Nov 17, 2026 •

Copy link
Copy Markdown
Collaborator

Note

Stacked on #867 (pre-claim history for LIP-73 late claimers). Review only this PR's own changes; once #867 merges, I'll merge next in and this will target next.

What

A new Value tab on the portfolio chart. It shows what the portfolio is worth in USD with its staking earnings, next to what the same LPT deposited would be worth had it earned nothing, both at each day's prices. A caption under the chart sums it up, e.g. "Staking has added $6,965 (389.9%) compared with not staking, at today's prices."

Suggested by Sparta on the forum.

Value tab on the full history of late claimer 0x427d…55b6, with the tooltip open on Jan 1, 2025

Late claimer 0x427d…55b6, Value → All, hovering Jan 1, 2025.

How it's counted

  • Deposits and withdrawals come from the existing per-round series: any stake change beyond that round's rewards.
  • LPT taken out and ETH fees count as if kept. A later price crash still shows, and taking profit doesn't erase what was earned. A deposit after a withdrawal counts as that LPT coming back first, not new money.
  • Moves between your own wallets (transferBond between two wallets in the same portfolio) are neither a deposit nor a withdrawal. This needs one extra query, made only for portfolios of 2+ wallets.
  • Late LIP-73 claimers (via fix(portfolio): count rewards earned before an LIP-73 claim #867) start at their orchestrator's migration, so the claim itself doesn't read as a deposit.

Other changes

  • Historical prices load only when the Value tab is picked, through a shared helper moved out of the CSV export (lib/prices/client.ts).
  • The tooltip shows the LPT price and the LPT (and ETH) amounts behind each value. Notes sit on their own line so it fits at phone width.

Testing

  • 17 new unit tests for the flow and value math (lib/portfolio/value.test.ts); 300 tests pass in total.
  • Checked in the browser on single wallets, a multi-wallet portfolio, an orchestrator with large withdrawals, and late claimer 0x427d…55b6.
  • The first uncached price load for a long history takes about 40s; after that it's cached.

🤖 Generated with Claude Code

adamsoffer and others added 2 commits November 12, 2026 19:25
A "Value" metric on the portfolio chart: what the portfolio is worth in
USD with its staking earnings, next to what the same LPT deposited would
be worth had it earned nothing, both at each day's prices.

- Deposits and withdrawals come from the existing per-round series
  (stake change beyond rewards). LPT taken out and ETH fees count as if
  kept, so a later price crash shows and profit-taking doesn't erase
  what was earned; a deposit after a withdrawal is that LPT coming back.
- transferBond between two wallets of the same portfolio is neither a
  deposit nor a withdrawal (one extra query, only for 2+ wallets).
- Historical prices load only when the metric is picked, through a
  shared helper moved out of the CSV export.
- The tooltip shows the LPT price and the LPT (and ETH) behind each value.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@vercel

vercel Bot commented Nov 17, 2026 •

Copy link
Copy Markdown
Contributor

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

Project Deployment Actions Updated
explorer-arbitrum-one Ready Ready Preview Nov 17, 2026 3:55pm UTC

Request Review

This branch was successfully deployed

1 active deployment
Preview — 620723fa Deployed Nov 17, 2026 by vercel[bot]
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.

1 participant