Skip to main content
Get onchain earnings for a wallet — total earnings by token and a per-chain breakdown. The response includes gross totals and net-of-fee totals. Net fields apply the Zyfi performance fee (10%) to current earnings only:
Lifetime and unrealized are never multiplied by the keep-rate. Equivalent form: totalWithFee = total − current × 0.1. Never display total × 0.9.
Show totalEarningsByTokenWithFee / totalEarningsByChainWithFee as the primary numbers in your product UI (parity with the Zyfai app). Gross fields remain available for debugging or advanced transparency.

Signature

Parameters

Returns

Onchain earnings data with gross and net-of-fee totals by token and by chain.

Return Type

All earnings values are decimal strings (e.g. "421.315354"), not numbers. Parse them with parseFloat() or a BigNumber library when doing arithmetic.

Fee model (short)

Example

Refresh flow

If GET returns no V2 snapshot, call calculateOnchainEarnings first, then retry:

Notes

  • Input is the smart wallet address — resolve from EOA via getSmartWalletAddress / getSmartWalletByEOA
  • For portfolio balances net of the same pending fee, see getPortfolio
  • Prefer calculateOnchainEarnings to refresh before reading if data is missing or stale