> ## Documentation Index
> Fetch the complete documentation index at: https://injectivelabs-docs-ai-sdk.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# Portfolio

Example code snippets to query the indexer for portfolio module related data.

## Using gRPC

### Fetch portfolio based on injective address, such as bank balances and subaccount balances

```ts lines highlight={1} theme={null}
import { IndexerGrpcPortfolioApi } from "@injectivelabs/sdk-ts/client/indexer";
import { getNetworkEndpoints, Network } from "@injectivelabs/networks";

const endpoints = getNetworkEndpoints(Network.Testnet);
const indexerGrpcPortfolioApi = new IndexerGrpcPortfolioApi(endpoints.indexer);

const injectiveAddress = "inj...";

const portfolio = await indexerGrpcPortfolioApi.fetchAccountPortfolioBalances(
  injectiveAddress
);

console.log(portfolio);
```
