Skip to content

Add helper for displaying total portfolio value across all held keys#393

Merged
Chucks1093 merged 2 commits into
accesslayerorg:mainfrom
sochima2:main
May 31, 2026
Merged

Add helper for displaying total portfolio value across all held keys#393
Chucks1093 merged 2 commits into
accesslayerorg:mainfrom
sochima2:main

Conversation

@sochima2
Copy link
Copy Markdown
Contributor

Summary

Description
Adds a new helper calculatePortfolioValue with formatPortfolioValueDisplay and getPortfolioValueHelperText under src/utils/portfolioValue.utils.ts that aggregates held key positions and returns ready | loading | unavailable status along with counts and total stroops.
Integrates the helper into the marketplace (src/pages/LandingPage.tsx) via heldKeyPositions/portfolioValue memos and renders a new "Holdings overview" card that shows the formatted total, per-position price states, and an accessible loading/unavailable indicator.
Handles edge cases: zero holdings resolve to a zero total, any isPriceLoading yields a loading state, and missing or stale prices result in an unavailable state so partial totals are never shown as final.
Adds unit tests covering summed totals, zero holdings, loading state, missing price data, and stale price data at src/utils/tests/portfolioValue.utils.test.ts.

Testing

Testing
Ran unit tests with pnpm exec vitest run src/utils/tests/portfolioValue.utils.test.ts and all new tests passed (5 passed).
Performed type checking with pnpm exec tsc -b which completed successfully.
Ran lint via pnpm lint which completed with no new errors.
Built the app with pnpm build; the production build succeeded (build warnings about chunk size / injected comments are unchanged existing warnings).

  • pnpm lint
  • pnpm build

Checklist

  • Linked issue or backlog item
  • Scope is limited to the stated change
  • Updated docs if behavior or setup changed
  • Added screenshots for UI changes when relevant

close #376

@drips-wave
Copy link
Copy Markdown

drips-wave Bot commented May 31, 2026

@sochima2 Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits.

You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀

Learn more about application limits

@Chucks1093 Chucks1093 merged commit 97b5a7b into accesslayerorg:main May 31, 2026
1 check passed
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.

Add helper for displaying total portfolio value across all held keys

2 participants