Skip to content

Handle missing LP redeemed amounts - #105

Open
vku2018 wants to merge 1 commit into
Nodus-protocol:mainfrom
vku2018:grantfox-53-lp-position-fallbacks
Open

Handle missing LP redeemed amounts#105
vku2018 wants to merge 1 commit into
Nodus-protocol:mainfrom
vku2018:grantfox-53-lp-position-fallbacks

Conversation

@vku2018

@vku2018 vku2018 commented Jul 3, 2026

Copy link
Copy Markdown
Contributor

Summary

  • make LP redeemed amount formatting tolerate null, undefined, and invalid raw values
  • allow LPPosition data to omit redeemed amounts and token symbols without rendering undefined or NaN
  • fall back to stable TOKEN_0 / TOKEN_1 labels when token symbols are missing
  • add component coverage for partial LP data and formatter coverage for nullish raw amounts

Why

Partial LP API responses can omit redeemed amounts or token labels. The previous rendering path sent those values directly into display helpers, which could expose broken UI text or throw from token rendering. This keeps the LP card stable when data is incomplete.

Closes #53.

Validation

  • npm run test -- __tests__/components/LPPosition.test.tsx __tests__/lib/format.test.ts
  • npm test -- --runInBand (28 tests passed)
  • npm run lint -- components/LPPosition.tsx lib/format.ts __tests__/components/LPPosition.test.tsx __tests__/lib/format.test.ts
  • npm run typecheck
  • git diff --check

@vku2018
vku2018 requested a review from Jaydbrown as a code owner July 3, 2026 18:32
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.

2 participants