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 and Kamino vaults, the values are indexed by the provider 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. Providers aggregate per chain, so chainId is required. Morpho Vault V1 positions are not covered. The response combines positions from every provider on the chain, which depends on the wallet account’s chain family: an EVM wallet account returns Morpho and Aave positions, and a Solana wallet account returns Kamino positions. Providers differ in what they report for a position:
  • Morpho reports PNL and a time-weighted return, so pnl, pnlUsd, and roe are all set.
  • Kamino reports PNL but no time-weighted return, so pnl and pnlUsd are set and roe is always null.
  • Aave reports no cost basis, so pnl, pnlUsd, and roe are null. The entry still carries assets and assetsUsd.
Positions without PNL add to totalAssetsUsd and add nothing to totalPnlUsd, so totalPnlUsd covers only positions from providers that report it. 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.
Pass a chainId from the same chain family as walletAccount. An EVM wallet account takes an EVM chain ID, and a Solana wallet account takes the Solana network ID. A mismatch, or a chain that has no earnings data, is rejected with an HTTP 400 error. Solana earnings are available on mainnet only.

Usage

Parameters

Returns

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

Examples

List per-vault earnings

Read a Solana wallet’s 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 26, 2026