Skip to main content

getYieldEarnings

Gets a wallet’s Earn earnings across every vault it holds on one chain: aggregate USD totals plus a per-vault breakdown. For Morpho vaults, the values are indexed by Morpho rather than read on-chain, so they trail the chain head by a short delay. getYieldPosition stays the source of truth for what a position is worth right now; use this function for earnings and PNL. Morpho aggregates per chain, so chainId is required and Vault V1 positions are not covered. The response combines positions from every provider on the chain. Not every provider reports a cost basis for a position. For a vault whose provider does not, the entry in vaults still carries assets and assetsUsd, but pnl, pnlUsd, and roe are null. Those positions add to totalAssetsUsd and add nothing to totalPnlUsd, so totalPnlUsd covers only positions from providers that report a cost basis. Aggregate totals come back in USD only, because per-vault earnings are denominated in different underlying assets and are not additive. A vault with no USD price is skipped from the totals, not counted as zero. Positions in vaults the environment does not offer are still included, with vaultId set to null for those entries.
This function covers Morpho and Aave positions on EVM chains. It requires an EVM wallet account, so a Solana wallet account is rejected with an HTTP 400 error, and positions in Solana vaults are not included in any result. To show a wallet’s balance in a Solana vault, use getYieldPosition.

Usage

Parameters

Returns

Promise<YieldEarnings> - The wallet’s aggregate USD totals and per-vault earnings. Each entry in vaults:

Examples

List per-vault earnings

React

useGetYieldEarnings is a query hook that stays disabled until walletAccount is defined, safe to render before a wallet is connected.
Last modified on October 20, 2026