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

# Get wallet holdings

> Get a wallet's token balances and native coin balance on one chain, valued in USD, filtered and sorted by value.

Returns the ERC-20 tokens and the native coin (for example ETH) held by a wallet on one chain. Each holding is valued in USD and given its share of the wallet's total. Spam tokens and tokens with little liquidity are hidden by default.

## How the result is built

1. **Token balances.** The wallet's non-zero token balances are loaded from indexed data, highest-liquidity tokens first. At most **5,000** token balances are considered; for a wallet with more, the lowest-liquidity ones are ignored.
2. **Native balance.** The native coin balance is read live from a node and cached for **5 seconds**, so repeated calls within 5 seconds return the same native balance. If the node can't be reached, the request fails with `503`.
3. **Filters**, applied to tokens only, never to the native coin:

   * With `filterSpam=true`, tokens flagged as spam are hidden and counted in `hidden.spam`.
   * Remaining tokens with liquidity below `minLiquidityUSD` are hidden and counted in `hidden.belowMinLiquidity`. Tokens with no liquidity data count as `0` liquidity, so they only appear with `minLiquidityUSD=0`.

   A token hidden as spam is not counted again as low-liquidity.
4. **Native holding.** Added when the native balance is greater than 0. It always uses the address `0xeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee` and has `native: true`. It is priced at the USD price of the chain's wrapped native token (for example WETH); if the chain has no wrapped native token, its `priceUSD` and `balanceUSD` are `0`.
5. **Totals, then limit.** `totalBalanceUSD`, `holdingsCount` and each `allocation` are computed over **every** holding that passed the filters. Holdings are then sorted by `balanceUSD`, highest first, and only then cut to `limit`. So the totals describe the whole wallet, not just the returned list.

There is no pagination or cursor. Use `limit` (up to 500) to control how many holdings are returned.

## Query parameters

**address** `string` *required*

Wallet address (`0x` + 40 hex). Case-insensitive. 32-byte ids are not accepted.

**chain** `string` *required*

Chain id, as a number (`1`) or with the `evm:` prefix (`evm:1`). A well-formed id for a chain ChainQuery doesn't support returns `400 Unsupported chain`. See [Chains and identifiers](https://sonar-cf3aeac7.mintlify.site/concepts/chains-and-identifiers.md).

**filterSpam** `string` (default: true)

`true` hides tokens flagged as spam; `false` shows them. Only the exact lowercase strings `true` and `false` are accepted.

**minLiquidityUSD** `number` (default: 1000)

Hide tokens whose liquidity in USD is below this value. Must be 0 or more; decimals are allowed. Set `0` to turn off the liquidity filter, so tokens with no liquidity data are shown too. Spam tokens are still hidden unless `filterSpam=false`.

**limit** `integer` (default: 100)

Maximum number of holdings to return, from 1 to 500. Does not affect `totalBalanceUSD` or `holdingsCount`.

## Response

**status** `"success"`

Always `success` for a 2xx response.

**data** `WalletHoldingsOutput`

**WalletHoldingsOutput**

**address** `string`

Wallet address, lowercase.

**chainId** `string`

Chain in `evm:<id>` form, for example `evm:1`.

**totalBalanceUSD** `number`

Sum of `balanceUSD` over all holdings that passed the filters, including those cut by `limit`.

**holdingsCount** `number`

Number of holdings that passed the filters, before `limit` is applied.

**hidden** `object`

Counts of tokens hidden by the filters.

**properties**

**spam** `number`

Tokens hidden as spam. Always `0` with `filterSpam=false`.

**belowMinLiquidity** `number`

Tokens hidden because their liquidity is below `minLiquidityUSD`.

**holdings** `object[]`

Holdings sorted by `balanceUSD`, highest first, at most `limit` items.

**holding**

**token** `object`

The held token.

**properties**

**address** `string`

Token address, lowercase. `0xeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee` for the native coin.

**chainId** `string`

Chain in `evm:<id>` form.

**name** `string`

Token name. `""` when unknown.

**symbol** `string`

Token symbol. `""` when unknown.

**decimals** `number | null`

Token decimals. `null` when unknown.

**logo** `string | null`

Logo URL.

**assetId** `number | null`

Cross-chain asset id, usable with the [asset endpoints](https://sonar-cf3aeac7.mintlify.site/api-reference/asset/get-asset-ohlcv.md). For the native coin, the wrapped native token's asset.

**priceUSD** `number`

USD price. `0` when unknown, including tokens ChainQuery doesn't track prices for.

**liquidityUSD** `number`

Token liquidity in USD. For the native coin, the wrapped native token's liquidity.

**marketCapUSD** `number`

Market cap in USD. `0` when unknown. For the native coin, the wrapped native token's market cap.

**native** `boolean`

`true` for the chain's native coin.

**spam** `boolean`

`true` if the token is flagged as spam. Only visible with `filterSpam=false`.

**balance** `number | null`

Balance adjusted for decimals. `null` when decimals are unknown. This is a float, so very large balances can lose precision; use `balanceRaw` for exact values.

**balanceRaw** `string`

Balance as a raw integer string in base units.

**balanceUSD** `number`

`balance × priceUSD`. `0` when `balance` is `null` or the price is unknown.

**allocation** `number`

Share of `totalBalanceUSD` in percent (0 to 100). `0` when the total is 0.

**blockNumber** `string`

Block number **as a string**. For tokens, the block of the last indexed balance change. For the native coin, the block at which the balance was read.

## Errors

| Status | `code` | When |
| - | - | - |
| 400 | `INVALID_ADDRESS` | `address` is malformed (`address: must be a valid token or wallet address`). |
| 400 | `INVALID_PARAMETERS` | Any other validation failure: bad `chain` format, `filterSpam` not `true`/`false`, negative `minLiquidityUSD`, or `limit` outside 1 to 500. |
| 400 | `INVALID_PARAMETERS` | Well-formed but unsupported chain. Message: `Unsupported chain: evm:<id>`, with no `details`. |
| 503 | `SERVICE_UNAVAILABLE` | The native balance could not be read. Message: `The node is unavailable, try again shortly`. Retry after a short delay. |
| 500 | `INTERNAL_ERROR` | Unexpected server error. |

```bash cURL theme={null}
curl "https://api.example.com/api/v1/wallet/holdings?address=0x8f3a00000000000000000000000000000000c21d&chain=1"
```

```bash cURL (show everything) theme={null}
curl "https://api.example.com/api/v1/wallet/holdings?address=0x8f3a00000000000000000000000000000000c21d&chain=1&filterSpam=false&minLiquidityUSD=0&limit=500"
```

```javascript JavaScript theme={null}
const params = new URLSearchParams({
  address: "0x8f3a00000000000000000000000000000000c21d",
  chain: "1",
  limit: "20",
});

const res = await fetch(`https://api.example.com/api/v1/wallet/holdings?${params}`);
const body = await res.json();
if (res.status === 503) {
  // Native balance read failed; retry shortly
}
if (body.status !== "success") throw new Error(`${body.code}: ${body.message}`);

const { totalBalanceUSD, holdings, hidden } = body.data;
console.log(`Total $${totalBalanceUSD.toFixed(2)} (${hidden.spam} spam hidden)`);
for (const h of holdings) {
  console.log(h.token.symbol, h.balance, `$${h.balanceUSD.toFixed(2)}`, `${h.allocation.toFixed(1)}%`);
}
```

```json 200 theme={null}
{
  "status": "success",
  "data": {
    "address": "0x8f3a00000000000000000000000000000000c21d",
    "chainId": "evm:1",
    "totalBalanceUSD": 16987.014,
    "holdingsCount": 4,
    "hidden": { "spam": 3, "belowMinLiquidity": 12 },
    "holdings": [
      {
        "token": {
          "address": "0xeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee",
          "chainId": "evm:1",
          "name": "Ethereum",
          "symbol": "ETH",
          "decimals": 18,
          "logo": "https://cdn.example.com/tokens/eth.png",
          "assetId": 2534,
          "priceUSD": 3512.07,
          "liquidityUSD": 412000000,
          "marketCapUSD": 8650000000,
          "native": true,
          "spam": false
        },
        "balance": 2.5,
        "balanceRaw": "2500000000000000000",
        "balanceUSD": 8780.175,
        "allocation": 51.68757145899803,
        "blockNumber": "23950412"
      },
      {
        "token": {
          "address": "0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2",
          "chainId": "evm:1",
          "name": "Wrapped Ether",
          "symbol": "WETH",
          "decimals": 18,
          "logo": "https://cdn.example.com/tokens/weth.png",
          "assetId": 2534,
          "priceUSD": 3512.07,
          "liquidityUSD": 412000000,
          "marketCapUSD": 8650000000,
          "native": false,
          "spam": false
        },
        "balance": 1.2,
        "balanceRaw": "1200000000000000000",
        "balanceUSD": 4214.484,
        "allocation": 24.810034300319053,
        "blockNumber": "23950388"
      },
      {
        "token": {
          "address": "0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48",
          "chainId": "evm:1",
          "name": "USD Coin",
          "symbol": "USDC",
          "decimals": 6,
          "logo": "https://cdn.example.com/tokens/usdc.png",
          "assetId": 1,
          "priceUSD": 1,
          "liquidityUSD": 610000000,
          "marketCapUSD": 41200000000,
          "native": false,
          "spam": false
        },
        "balance": 3500.25,
        "balanceRaw": "3500250000",
        "balanceUSD": 3500.25,
        "allocation": 20.60544601894129,
        "blockNumber": "23949102"
      },
      {
        "token": {
          "address": "0x6982508145454ce325ddbe47a25d4ec3d2311933",
          "chainId": "evm:1",
          "name": "Pepe",
          "symbol": "PEPE",
          "decimals": 18,
          "logo": "https://cdn.example.com/tokens/pepe.png",
          "assetId": 8812,
          "priceUSD": 0.0000098421,
          "liquidityUSD": 41250000.12,
          "marketCapUSD": 4140000000,
          "native": false,
          "spam": false
        },
        "balance": 50000000,
        "balanceRaw": "50000000000000000000000000",
        "balanceUSD": 492.105,
        "allocation": 2.8969482217416194,
        "blockNumber": "23931577"
      }
    ]
  }
}
```

```json 503 theme={null}
{
  "status": "error",
  "statusCode": 503,
  "code": "SERVICE_UNAVAILABLE",
  "message": "The node is unavailable, try again shortly"
}
```

```json 400 theme={null}
{
  "status": "error",
  "statusCode": 400,
  "code": "INVALID_PARAMETERS",
  "message": "Unsupported chain: evm:999"
}
```


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.