Explorer

Get Portfolio

Learn how to retrieve a user's portfolio using the Okto SDK.

The getPortfolio function retrieves the user's complete portfolio, including token holdings across all supported chains.

Method Overview

MethodDescription
async getPortfolioGet user's portfolio data

Get Portfolio

async getPortfolio(oktoClient: OktoClient) retrieves the user's portfolio data including token holdings and their values.

Parameters

ParameterTypeDescription
oktoClientOktoClientInstance of OktoClient obtained from useOkto hook

Response

Success Response

Field NameTypeDescription
portfolioPromise<UserPortfolioData>User's portfolio data

Example

Note

In case of errors, debug the error using the error code and refer to the SDK errors and warnings documentation for more details.

On this page