Skip to main content
Get a detailed and accurate portfolio view for a user, including positions, balances by asset type, and session key status. This method provides more accurate data than getPositions, use it to display portfolio value in your UI. Balances are enriched with net-of-pending-fee fields (balanceWithFee, underlyingAmountWithFee). The pending fee is derived from onchain current earnings × the Zyfi fee rate (10%). Gross fields (balance, underlyingAmount) are unchanged. If earnings cannot be fetched, *WithFee equals the gross value so the response shape stays stable.
Show balanceWithFee / underlyingAmountWithFee 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

Detailed portfolio data including positions and balances by asset type, plus fee-adjusted balance fields.

Return Type

How *WithFee is calculated

  • Fee source: current_earnings_by_chain only (fetched in parallel with the portfolio)
  • Multiple positions on the same chain + token: fee is split proportionally by underlyingAmount
  • Portfolio balances are live; earnings used for the fee may be from a snapshot — small mismatches are possible

Example

Notes

  • This method automatically resolves the smart wallet address from the EOA
  • If no smart wallet exists for the user, returns an empty portfolio
  • Auth is not required for this read path
  • portfolioByAssetType provides balances grouped by token (e.g., USDC, WETH, EURC)
  • portfolioByChain provides the same balance structure grouped by chain, then by asset type
  • Decode hex / wei amounts with the correct decimals (USDC/EURC = 6, WETH = 18, …)
  • For earnings net of fee, see getOnchainEarnings
  • For legacy position data, see getPositions