Add Merkl yield boost claiming to savings screen - #2592
Merged
Merged
Conversation
Implements the Yield boost card from Figma 26134:23293 with its Claim
button, and puts the card back on the funded savings vault screen (the
redesign had dropped it), under the balance card.
- The boost is paid by Merkl campaigns (one per vault, all WFUSE on
Fuse). lib/merklYieldBoost.ts reads the WFUSE leaf from
/v4/users/{address}/rewards, scopes "Total Earned" to the campaign ids
in EXPO_PUBLIC_MERKL_YIELD_BOOST_CAMPAIGN_IDS, and builds the claim.
It doesn't import @merkl/api, so it can be tested without it.
- Claim is one user operation: Distributor.claim with the cumulative
amount, then WFUSE.withdraw of exactly what the claim pays, measured
against the Distributor's own claimed record so a stale index can't
revert the batch. Proofs are re-read (bypassing Merkl's cache) right
before signing, and the query is refreshed the same way afterwards.
- Total Earned is the boost campaigns' credited amount plus pending, in
USD at the app's FUSE price (Merkl's quote as a fallback).
- The card stays visible with a disabled "—" boost for a user who lost
their tier but still has something to claim.
- The rewards yield-boost sheet now describes the FUSE boost and its
balance cap ("on your first $10,000") when the backend sends
yieldBoostBalanceCap, and keeps the old copy when it doesn't.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01EupadZ9qYL5nDLM6dDtu5n
|
The latest updates on your projects. Learn more about Vercel for GitHub. 2 Skipped Deployments
|
Code reviewNo issues found. Checked for bugs and CLAUDE.md compliance. |
MusabShakeel576
deleted the
claude/merkl-campaign-implementation-nogeis
branch
September 27, 2026 12:55
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.
Summary
Implements claiming of Merkl yield-boost rewards (WFUSE on Fuse) directly from the savings screen. Users can now view their accumulated boost earnings and claim them in a single transaction that unwraps WFUSE to native FUSE.
Key Changes
New Merkl yield-boost module (
lib/merklYieldBoost.ts):/v4/users/{address}/rewards)React hook (
hooks/useYieldBoostRewards.ts):useYieldBoostRewards: Queries boost rewards with 60s stale time to balance freshness and rate limitsuseClaimYieldBoost: Mutation that reads fresh proofs and onchain claimed state, executes the claim batch, and updates cacheUI updates (
components/Savings/NewSavings/SavingsYieldBoostCard.tsx):Configuration (
lib/config.ts,.env.example):EXPO_PUBLIC_MERKL_YIELD_BOOST_CAMPAIGN_IDSto scope earned rewards to specific campaignsType updates (
lib/types.ts,YieldBoostSheet.types.ts):yieldBoostBalanceCapto track the savings balance cap per tier (Prime $10K, Ultra $25K)Comprehensive tests (
lib/__tests__/merklYieldBoost.test.ts,components/Savings/NewSavings/__tests__/SavingsYieldBoostCard.test.tsx):Implementation Details
claimedrecord to calculate exact payouthttps://claude.ai/code/session_01EupadZ9qYL5nDLM6dDtu5n
Need help on this PR? Tag
@codesmith-botwith what you need. Autofix is disabled.