Skip to content

Integrate Rewards for Earn Products

Vault depositors on Morpho can earn rewards beyond base lending yield. Integrating rewards display and claiming is essential for providing competitive APY and maximizing user returns.

What's Unique for Earn Products

When building earn products, understand that vault depositors earn rewards from two sources:

  1. Direct Vault Campaigns: Rewards distributed directly to vault depositors
  2. Forwarded Market Campaigns: Rewards from underlying markets where the vault allocates liquidity
Critical integration requirement:
Net APY = Vault Native APY + Vault Campaign Rewards APR + Forwarded Market Rewards APR

Integration Steps

Follow the centralized rewards tutorials with vault-specific considerations:

Step 1: Fetch Vault Rewards Data

Follow: Fetch Rewards Data

Vault-specific notes:
  • Query both state.rewards and state.allocation[].market.state.rewards
  • Calculate weighted average for market rewards based on allocation
  • Use supplyAssetsUsd to determine weights
  • Alternatively, use netApy convenience field for simple total APY

Step 2: Display Rewards in Your UI

Follow: Integrate Rewards Display

Vault-specific notes:
  • Prominently display Net APY (native + all rewards)
  • Show breakdown: base yield vs. rewards
  • List reward tokens with their respective APRs
  • Optionally show which markets contribute to forwarded rewards

Step 3: Enable Reward Claiming

Follow: Claim Rewards

Important: The claiming process is identical for all Morpho users (vault depositors, borrowers, market suppliers). Both Merkl and URD use the same claiming flow regardless of how rewards were earned.

Complete Integration Example

For a full working reference implementation:

See: Complete Rewards Integration Guide

This guide includes production-ready code using the morpho-merkl-recipe.

Quick Reference

TaskMain TutorialVault-Specific Consideration
Understanding rewardsReward CampaignsUnderstand forwarding mechanism
Distribution systemDistribution SystemsSame Merkl/URD for all users
Fetch rewardsFetch Rewards DataQuery two API locations, manual aggregation
Display rewardsIntegrate DisplayShow total APY breakdown
Claim rewardsClaim RewardsSame process for all users

Need Help?