Rewards
Endpoints
Rewards API
https://rewards.morpho.org/docs
All Rewards for a User
This endpoint returns all rewards at the current timestamp on all chains for one user.
GET /v1/users/[Address]/rewardsExample:
https://rewards.morpho.org/v1/users/0x0ec553110e53122d1226646670a8475D4C8E6F04/rewardsHere 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]/distributionsExample:
https://rewards.morpho.org/v1/users/0x0ec553110e53122d1226646670a8475D4C8E6F04/distributionsThe "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/programsExample:
https://rewards.morpho.org/v1/programsState 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/statsMorpho API
Morpho markets rewards
{
markets(orderBy: SupplyAssetsUsd, orderDirection: Desc) {
items {
uniqueKey
state {
rewards {
supplyApr
borrowApr
asset {
address
chain {
id
}
}
}
}
}
}
}Morpho Vaults rewards received through Vault programs
{
vaults(where: { chainId_in: [8453] }) {
items {
state {
rewards {
asset {
address
chain {
id
}
}
yearlySupplyTokens
supplyApr
}
}
}
}
}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
chain {
id
}
}
supplyApr
}
}
}
}
}
}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
chain {
id
}
}
supplyApr
}
allocation {
market {
uniqueKey
state {
rewards {
supplyApr
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.
