Are you an LLM? Read llms.txt for a summary of the docs, or llms-full.txt for the full context.
Skip to content

Rewards

Endpoints

You can read more about Rewards integration in your product in the dedicated section here.

For Merkl API usage with user rewards, see Fetch Rewards Data.

Legacy Rewards API (Deprecated)

Morpho Vault V2

For rewards data, the Morpho API retrieves information from the Merkl API.

query VaultV2Rewards($address: String!, $chainId: Int!) {
  vaultV2ByAddress(address: $address, chainId: $chainId) {
    address
    rewards {
      supplyApr
      asset {
        address
        symbol
        priceUsd
      }
    }
  }
}
Variables example:
{
  "address": "0xb576765fB15505433aF24FEe2c0325895C559FB2",
  "chainId": 1
}

Morpho Vault V2 rewards are pre-aggregated by the API. The rewards field already includes all reward sources across all adapters. See Fetch Rewards Data for a complete walkthrough.

Morpho Vault V1

Rewards received through Vault programs

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

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
          }
        }
      }
    }
  }
}

Complete Vault Rewards

To retrieve the rewards that a Morpho Vault V1 inherits, you have to check both the vault-level rewards and the rewards inherited from 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
    }
  }
}
Variables example:
{
  "address": "0x9aB2d181E4b87ba57D5eD564D3eF652C4E710707",
  "chainId": 8453
}

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

Morpho Markets

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

For any questions on how to integrate the data, feel free to message Morpho via the chatbox on help.morpho.org.