Repository navigation
feat(portfolio): chart value with and without staking - #875
Open
adamsoffer wants to merge 2 commits into
Open
adamsoffer wants to merge 2 commits into
adamsoffer wants to merge 2 commits into
Conversation
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>
# Conflicts: # lib/subgraph/portfolio.ts
Contributor
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
This branch was successfully deployed
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.
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
nextin and this will targetnext.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.
Late claimer
0x427d…55b6, Value → All, hovering Jan 1, 2025.How it's counted
transferBondbetween 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.Other changes
lib/prices/client.ts).Testing
lib/portfolio/value.test.ts); 300 tests pass in total.0x427d…55b6.🤖 Generated with Claude Code