Rates and Incentives
Markets Information appears on the Morpho Interface. As displayed in the following pictures, a market on Morpho has:
- a supply APY (Annual Percentage Yield),
- a borrow APY,
- potential rewards (hover on the Borrow APY number to display the rewards tooltip).
Let's see how to retrieve those information.
Rates
At the smart contract level, the Interest Rate model (IRM) provides the borrowRate
for each market.
The borrowRate
is the rate at which borrowers pay interest on the borrowed amount. The supplyRate
is the rate at which lenders earn interest on the supplied amount.
As interests are compounded, users are more interested in the Annual Percentage Yield (APY) for both borrowing and supplying. The APY takes into account the compounding interest to provide a standardized measure of yields over a one-year period.
The logic explaining how to go from the borrowRate
to the borrowApy
(and thus supplyApy
) is explained in the calculation section of the Interest Rate Model.
Below are some guides to retrieve those rates.
Smart Contract
To manually retrieve the borrowRate
for a market, you can use the borrowRateView
function of the IRM contract. This section guides you through the process of obtaining the necessary parameters and executing the function call.
Jump into the Addresses section to get the contract addresses.
- Querying the Morpho Contract
First, obtain the marketParams
by querying the idToMarketParams
function. For example, for the wstETH/WETH (94.5%) market, use the following ID: 0xc54d7acf14de29e0e5527cabd7a576506870346a78a11a6762e2cca66322ec41.
Next, acquire the market
values by querying the market
function.
- Querying the AdaptiveCurveIRM Contract
Use the retrieved marketParams
and market
in the following format to query the contract:
Input:
marketParams
(tuple)
["0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2","0x7f39C581F595B53c5cb19bD0b3f8dA6c935E2Ca0","0x2a01EB9496094dA03c4E364Def50f5aD1280AD72","0x870aC11D48B15DB9a138Cf899d20F13F79Ba00BC","945000000000000000"]
market
(tuple)
["10004929554680902814569", "9991371195121664602574716119", "8810921364321507255452", "8796441127786542454899358360","1707318023",0]
API
One can get the supply and borrow APYs directly (no need to do the extra computation from borrowRate
to borrowAPY
as it is already done) for each market by using the Morpho API.
The data from the API are the same as the one displayed in the Morpho Interface.
Incentives
As explained in the incentives section, some Morpho markets might have incentives to attract more liquidity. These incentives are typically in the form of a token reward, transferable, or not.
Below is a guide to track the incentives of a given market.
To get the net APY as displayed in the Morpho Interface, one needs to understand the following.
Why Rewards APR?
The distinction between APY and APR is that APY takes into account the effect of compounding interest, while APR does not. In the case of rewards, the APR is the most relevant metric to consider, as rewards are not reinvested in users positions.
Smart Contract
An entire tutorial is available here to track emissions of a specific ERC20 token within a rewards program operated on Morpho.
API
One can jump in this api section to get more information about rewards:
-
Query Morpho markets rewards including the
supplyApr
andborrowApr
for each market.The
supplyApr
andborrowApr
are the Annual Percentage Rates (APR) for supplying and borrowing respectively. This is extra incentives that one should add alongside the native ratessupplyApy
andborrowApy
to get the total incentives.- For suppliers:
netMarketApy
of a market =supplyApy
of a market +supplyApr
of incentives. - For Borrowers:
netMarketApy
of a market =borrowApy
of a market -borrowApr
of incentives.
- For suppliers: