Skip to content

feat: show re-up opportunity per receipt on unlock page#294

Open
thedavidmeister wants to merge 1 commit into
mainfrom
2026-04-26-reup-display
Open

feat: show re-up opportunity per receipt on unlock page#294
thedavidmeister wants to merge 1 commit into
mainfrom
2026-04-26-reup-display

Conversation

@thedavidmeister

Copy link
Copy Markdown
Contributor

Closes #237. Reimplements #238 on a fresh branch off current main (multi-network).

Summary

  • Adds re-up visibility to the Unlock page: how much additional cyToken each receipt could mint at the current lock price without locking more underlying.
  • New columns (toggleable): Addl {token.name} per 1 {token.underlyingSymbol} and Total addl {token.name}.
  • Grand total card sums re-up across all visible receipts.

Math

  • addlPerUnderlying = max(0, currentLockPrice − tokenId) (both 18-decimal prices)
  • totalsFlr = (balance × 1e18) / tokenId (in token.decimals)
  • reupTotal = (totalsFlr × addlPerUnderlying) / 1e18 (in token.decimals)

currentLockPrice reads $balancesStore.stats[token.name].lockPrice, so values recompute reactively when prices refresh.

Differences from #238

  • Uses formatUnits(value, token.decimals) / formatUnits(value, 18) instead of formatEther, since the multi-network refactor on main means token.decimals may not be 18 (e.g. cyWETH on Arbitrum).
  • Computes currentLockPrice once at the top of the reactive block instead of per-receipt.

Test plan

  • Existing ReceiptsTable.test.ts still passes
  • Full vitest suite (279 tests) passes
  • Manually verify on Flare (cysFLR) that toggle hides/shows columns and grand total
  • Manually verify on Arbitrum (cyWETH) that decimals render correctly

🤖 Generated with Claude Code

Closes #237

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
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.

show when a position could be reupped for more cytoken

1 participant