Skip to main content

getYieldPerformance

Gets a wallet’s earnings in a single Earn vault: how much the position has earned (netEarningsAssets) and its return on capital (returnOnCapital). The values are indexed by the vault’s 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. returnOnCapital is a time-weighted, non-annualized decimal (for example 0.00413 means a 0.41% return). It comes back null when the provider has too little history on the position to compute one, and always for Kamino vaults, which report no time-weighted return.
This function currently supports vaults from these providers: Morpho and Kamino. For a vault from any other provider, such as an Aave vault, the call rejects because the API responds with an HTTP 400 error. Check the vault’s provider from getYieldDetails before calling it, and use the assets value from getYieldPosition to show the position’s balance.
netEarningsAssets comes back as a raw string (e.g. "854395278"), not a human-readable number, so values above 2^53 stay exact. It is negative when the position is at a loss (e.g. "-2500000"). Divide by the vault’s assetDecimals, from getYieldDetails, before displaying it, the same way you’d format a position’s assets. See the example below.

Usage

Parameters

Returns

Promise<YieldVaultPositionPerformance> - The position’s net earnings and return on capital.

Examples

Format earnings for display

React

useGetYieldPerformance 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