Skip to content

Support self-appreciating vote-lock vaults (vlRSR) - #1072

Merged
lcamargof merged 2 commits into
masterfrom
feature/vlrsr-self-appreciating-vaults
Jul 31, 2026
Merged

Support self-appreciating vote-lock vaults (vlRSR)#1072
lcamargof merged 2 commits into
masterfrom
feature/vlrsr-self-appreciating-vaults

Conversation

@lcamargof

Copy link
Copy Markdown
Collaborator

Summary

vlRSR on BSC is the first self-appreciating vote-lock vault: DTF fee rewards are converted to RSR by the vault's tokenJar and stream back in, so the share/asset exchange rate grows over time (~1.019 today) instead of rewards being claimed manually. Register assumed 1:1 shares/assets and claimable rewards on every vote-lock surface.

Changes

Vote-lock drawer

  • Unlock is now share-denominated for every vault: input/balance = vlRSR share balance, quote via previewRedeem, tx = redeem(shares, account, account) (previews are exact for legacy 1:1 vaults too, so one code path). Fixes the pre-existing mislabel where the unlock input was asset-denominated but labeled with the share symbol.
  • Lock tab shows the real previewDeposit shares-out quote.
  • Quotes are debounced (300ms), refresh every 15s while the drawer is open, keep the previous value dimmed while requoting, and animate in place on refresh (full decimal precision preserved). Exchange-rate line under both tabs.

Governance page

  • SELF_APPRECIATING_VOTE_LOCK_VAULTS catalog in constants replaces the hardcoded in-component set; "Automatic" claiming no longer requires other governed DTFs.
  • Card shows the live exchange rate (works disconnected) and the connected account's redeemable underlying.

Portfolio

  • Flagged rows show live redeemable (maxWithdraw) + rate via RPC with API fallback on error; a successful zero read is trusted (no phantom positions after full redeem).

Earn

  • TVL and Your lock corrected to underlying terms on both the index vote-lock and yield stRSR tables (stRSR mirrors the reserve-api rsrEquivalent math).
  • Self-appreciating vaults display daily-compounded APY (~167%) instead of the API's simple APR; legacy vaults keep APR. Same treatment on the overview lock CTA and portfolio APY column.

Misc

  • vlRSR token logo; animated number component (rAF tween, tabular-nums); es/ko/zh translations for new strings (plus a few pre-existing gaps).
  • SDK pinned to 0.5.1 (prepareVoteLockRedeem, VoteLockState.shareBalance/exchangeRate, vote-lock preview hooks).

Testing

  • New e2e flow vote-lock-drawer.spec.ts: decodes the submitted redeem calldata against the bsc/photon fixture at a real 1.0188 rate; lock-quote display assertion.
  • Central e2e mocks seed identity-rate vault reads so every existing spec stays green.
  • Full gate on the published SDK: typecheck, 847 unit, 72 e2e-helper, 58 smoke.
  • Live BSC visual checks light+dark: drawer quotes both tabs, governance card, earn TVL matching on-chain totalAssets.

Notes

  • Companion PRs: Support self-appreciating vote-lock vaults (vlRSR) dtf-interface#29 (SDK 0.5.1, published), reserve-protocol/reserve-api#236 (rate-corrected /dtf/daos + portfolio; deploy with daos CDN purge before or with this).
  • The locale diff carries some unrelated catch-up churn from the recent odos/CMC20 removals (obsolete-string reshuffling).
  • Per-user "earned" (cost basis) intentionally not shown anywhere — requires subgraph Deposit/Withdraw indexing (follow-up).

vlRSR converts DTF fee rewards to RSR via its tokenJar and streams them
back into the vault, so the share/asset exchange rate grows over time.
Register assumed 1:1 shares/assets and manual reward claims everywhere.

- Vote-lock drawer: unlock is now share-denominated via redeem(shares)
  for all vaults; lock/unlock tabs show live previewDeposit/previewRedeem
  quotes (debounced, auto-refreshing, animated) plus an exchange-rate line
- Governance card: catalog-driven Automatic claiming (decoupled from
  governed-DTF count), exchange rate + redeemable display, compounded APY
- Portfolio: live redeemable (maxWithdraw) + rate for flagged vaults with
  API fallback; APY compounded for self-appreciating vaults
- Earn: TVL/Your lock corrected to underlying terms (index + yield stRSR
  tables), APY label + daily-compounded rate for vlRSR
- Overview: lock CTA shows compounded APY for self-appreciating vaults
- vlRSR token logo; SELF_APPRECIATING_VOTE_LOCK_VAULTS catalog in constants
- SDK bumped to 0.5.1 (prepareVoteLockRedeem, VoteLockState.shareBalance/
  exchangeRate, vote-lock preview hooks)
- e2e: vote-lock drawer flow spec (redeem calldata), central vault mocks
@coderabbitai

coderabbitai Bot commented Jul 31, 2026

Copy link
Copy Markdown

Review Change Stack

Warning

Review limit reached

@lcamargof, you've reached your PR review limit, so we couldn't start this review.

Next review available in: 56 minutes

Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available.
You're only billed for reviews past your plan's rate limits ($0.25/file).

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews.

How do review limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window.

Please refer docs for additional details.

Review details
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 2cdf6c96-c3ce-41f1-b66d-3bc33f4dea54

📥 Commits

Reviewing files that changed from the base of the PR and between d0427a7 and 845ba48.

⛔ Files ignored due to path filters (2)
  • pnpm-lock.yaml is excluded by !**/pnpm-lock.yaml
  • public/svgs/vlrsr.svg is excluded by !**/*.svg
📒 Files selected for processing (36)
  • docs/plans/vlrsr-self-appreciating-vaults.md
  • docs/wiki/progress.md
  • e2e/TEST_MAP.md
  • e2e/helpers/rpc.ts
  • e2e/helpers/tests/rpc.test.ts
  • e2e/tests/flows/vote-lock-drawer.spec.ts
  • package.json
  • src/components/token-logo/index.tsx
  • src/components/token-logo/tests/token-logo.test.ts
  • src/components/token-logo/vote-lock-token-logo.ts
  • src/components/ui/animated-number.tsx
  • src/components/ui/swap.tsx
  • src/components/vote-lock/atoms.ts
  • src/components/vote-lock/components/submit-lock-button.tsx
  • src/components/vote-lock/components/submit-unlock-button.tsx
  • src/components/vote-lock/components/vault-exchange-rate.tsx
  • src/components/vote-lock/components/vote-lock.tsx
  • src/components/vote-lock/components/vote-unlock.tsx
  • src/components/vote-lock/drawer.tsx
  • src/components/vote-lock/hooks/use-vote-lock-exchange-rate.ts
  • src/components/vote-lock/hooks/use-vote-lock-quotes.ts
  • src/locales/en.po
  • src/locales/es.po
  • src/locales/ko.po
  • src/locales/zh.po
  • src/utils/constants.ts
  • src/views/earn/components/position-balance.tsx
  • src/views/earn/views/index-dtf/components/vote-lock-positions.tsx
  • src/views/earn/views/yield-dtf/components/staking-positions.tsx
  • src/views/index-dtf/governance/CLAUDE.md
  • src/views/index-dtf/governance/components/governance-vote-lock.tsx
  • src/views/index-dtf/overview/components/index-governance-overview.tsx
  • src/views/index-dtf/settings/components/index-settings-governance-token.tsx
  • src/views/portfolio-page/components/transactions.tsx
  • src/views/portfolio-page/components/vote-locked-positions.tsx
  • src/views/portfolio-page/components/voting-power.tsx
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feature/vlrsr-self-appreciating-vaults

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@cloudflare-workers-and-pages

cloudflare-workers-and-pages Bot commented Jul 31, 2026

Copy link
Copy Markdown

Deploying register-app with  Cloudflare Pages  Cloudflare Pages

Latest commit: 845ba48
Status: ✅  Deploy successful!
Preview URL: https://a1a0be88.register-app.pages.dev
Branch Preview URL: https://feature-vlrsr-self-appreciat.register-app.pages.dev

View logs

@jgalat jgalat left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm!

@lcamargof
lcamargof merged commit 88ae635 into master Jul 31, 2026
5 checks passed
@lcamargof
lcamargof deleted the feature/vlrsr-self-appreciating-vaults branch July 31, 2026 21:39
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