Integrate Rewards for Borrow Products
Borrowers on Morpho Markets can earn rewards that offset borrowing costs or even generate net positive yields. Integrating rewards display and claiming is essential for showing users their true cost of borrowing.
What's Unique for Borrow Products
When building borrow products, understand that borrowers earn rewards for borrowing an asset from a market
Critical integration requirement:Net Borrow APY = Borrow APY - Borrow Rewards APR
It is also possible to incentivize a simple collateral deposit (without the borrow action required).
When rewards exceed costs, net APY becomes negative (profitable borrowing).
Integration Steps
Follow the centralized rewards tutorials with borrow-specific considerations:
Step 1: Fetch Market Rewards Data
Follow: Fetch Rewards Data
Borrow-specific notes:- Query
state.rewards
on market object - Look for
borrowApr
(rewards for borrowing) - No weighted averaging needed (unlike vaults)
Step 2: Display Rewards in Your UI
Follow: Integrate Rewards Display
Borrow-specific notes:- Show net cost prominently (borrow cost - all rewards)
- Highlight when borrowing becomes profitable (negative net APY)
- Break down: borrow cost, borrow rewards
- List reward tokens with their respective APRs
- Calculate per-position rewards based on user amounts
Step 3: Enable Reward Claiming
Follow: Claim Rewards
Important: The claiming process is identical for all Morpho users (borrowers, vault depositors, 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
Task | Main Tutorial | Borrow-Specific Consideration |
---|---|---|
Understanding rewards | Reward Campaigns | Understand dual eligibility |
Distribution system | Distribution System | Same Merkl/URD for all users |
Fetch rewards | Fetch Rewards Data | Query single location, no aggregation |
Display rewards | Integrate Display | Show net cost after rewards |
Claim rewards | Claim Rewards | Same process for all users |
Need Help?
- Conceptual questions: Rewards for Borrowers Concept
- Main rewards guide: Rewards Integration Guide
- Technical support: help.morpho.org
- Example code: morpho-merkl-recipe