Skip to main content

Rewards

Endpoints

There are 2 endpoints to get information about rewards:

  1. https://rewards.morpho.org
  2. https://blue-api.morpho.org/graphql

Rewards API

All Rewards for a User

This endpoint returns all rewards at the current timestamp on all chains for one user.

GET /v1/users/[Address]/rewards

Example:

https://rewards.morpho.org/v1/users/0x0ec553110e53122d1226646670a8475D4C8E6F04/rewards

Here is part of what the above example returns, specific to a rewards program (the endpoint can return several rewards programs for the same user depending on his eligibility). For each rewards program, you will get:

  • The accruing rewards: "claimable_next"
  • The claimable rewards: "claimable_now"
  • The already claimed rewards: "claimed"
  • The sum of the above: "total"
[...]
{
"user": "0x0ec553110e53122d1226646670a8475D4C8E6F04",
"type": "uniform-reward",
"asset": {
"id": "0x58D97B57BB95320F9a05dC918Aef65434969c2B2-1",
"address": "0x58D97B57BB95320F9a05dC918Aef65434969c2B2",
"chain_id": 1
},
"program_id": "0x5068269e48209fcd731fa6e02c54646871431970ea8eaca4c5b56ba1bc34afad",
"amount": {
"total": "115631364898103632676",
"claimable_now": "22676259927164556632",
"claimable_next": "1688912463745536463",
"claimed": "91266192507193539581"
}
}
[...]

All Distributions for a User

This endpoint returns all distributions on all chains for one user.

GET /v1/users/[Address]/distributions

Example:

https://rewards.morpho.org/v1/users/0x0ec553110e53122d1226646670a8475D4C8E6F04/distributions

The "claimable" amount retrieved for a specific distributor (URD) is what has been pushed onchain at the tree level to the URD making this user eligible to rewards up to this amount since inception. This amount is the sum of claimed and unclaimed rewards for a specific asset on a specific distributor.

This is used to claim rewards at contract level as detailed here.

All Programs

This endpoint returns all programs on all chains.

GET /v1/programs

Example:

https://rewards.morpho.org/v1/programs

State of rewards distribution

This endpoint returns all rewards distribution on all chains. This gives a dynamic state of the rewards distributed on Morpho (claimed and unclaimed) and it is updated every 24 hours at 00:00:00 UTC.

https://rewards.morpho.org/v1/rewards/stats

Morpho API

Morpho markets rewards

{
markets(orderBy:SupplyAssetsUsd, orderDirection:Desc) {
items {
uniqueKey
state {
rewards {
amountPerSuppliedToken
supplyApr
amountPerBorrowedToken
borrowApr
asset {
address
}
}
}
}
}
}

Morpho Vaults rewards received through Vault programs

{
vaults(where: { chainId_in: [8453] }) {
items {
state {
rewards {
asset {
address
}
yearlySupplyTokens
supplyApr
amountPerSuppliedToken
}
}
}
}
}

Morpho Vaults rewards per allocated market

{
marketPositions(
where: { userAddress_in: ["0xEbFA750279dEfa89b8D99bdd145a016F6292757b"] }
) {
items {
supplyAssets
market {
uniqueKey
loanAsset {
name
symbol
}
collateralAsset {
name
symbol
}
lltv
oracleAddress
irmAddress
state {
rewards {
asset {
address
}
supplyApr
amountPerSuppliedToken
}
}
}
}
}
}

Morpho Vaults rewards

To retrieve the rewards that a vault inherit, not only you have to check the rewards of the vault, but also the one inherited form the allocated markets:

  query VaultByAddress($address: String!, $chainId: Int) {
vaultByAddress(address: $address, chainId: $chainId) {
address
state {
rewards {
asset {
address
name
}
amountPerSuppliedToken
supplyApr
}
allocation {
market {
uniqueKey
state {
rewards {
supplyApr
amountPerSuppliedToken
asset {
address
chain {
id
}
}
}
}
}
supplyAssetsUsd
}
}
chain {
id
}
}
}

With the following variables:

{
"address": "0x9aB2d181E4b87ba57D5eD564D3eF652C4E710707",
"chainId": 8453
}

You can then compute the overall Vault rewards following the Morpho Vault rewards computation.

Explanation of Fields

  • amountPerSuppliedToken: The annualized amount of reward tokens earned for each token supplied in the market.
  • amountPerBorrowedToken: The annualized amount of reward tokens earned for each token borrowed in the market.
  • supplyApr: The annual percentage rate for supplying tokens, available if the reward token is priced.
  • borrowApr: The annual percentage rate for borrowing tokens, available if the reward token is priced.

For any questions on how to integrate the data, feel free to message Morpho labs team or ping on the discord.