# User & Assets

## Query User Info

```
GET /api/v1/users/{userId}
```

### Path Parameters

| Parameter | Type   | Description                                                                  |
| --------- | ------ | ---------------------------------------------------------------------------- |
| `userId`  | string | Currently the user's wallet address. Server trims and converts to lowercase. |

### Response `data`

| Field         | Type   | Description                               |
| ------------- | ------ | ----------------------------------------- |
| `userId`      | string | User ID, currently equals wallet address. |
| `userAddress` | string | Wallet address.                           |

***

## Query Asset Portfolio

```
GET /api/v1/users/{userId}/balance
```

### Query Parameters

| Parameter        | Type   | Required | Default       | Description                          |
| ---------------- | ------ | -------- | ------------- | ------------------------------------ |
| `spenderAddress` | string | No       | `0x000...000` | Spender address for allowance query. |

### Response `data`

| Field           | Type   | Description          |
| --------------- | ------ | -------------------- |
| `chainId`       | number | Chain ID.            |
| `productType`   | string | Product type.        |
| `address`       | string | User wallet address. |
| `mUsdBalance`   | string | mUSD balance.        |
| `tokenBalances` | array  | Token balance list.  |

### `tokenBalances` Item

| Field             | Type          | Description                                   |
| ----------------- | ------------- | --------------------------------------------- |
| `address`         | string        | Token address.                                |
| `name`            | string        | Token name.                                   |
| `symbol`          | string        | Token symbol.                                 |
| `stockSymbol`     | string / null | Stock symbol (stock tokens only).             |
| `isStock`         | boolean       | Whether it's a stock token.                   |
| `decimals`        | number        | Token decimals.                               |
| `price`           | number / null | Token price (stock tokens only).              |
| `walletBalance`   | string        | Wallet balance (human-readable).              |
| `walletAllowance` | string        | Wallet allowance to spender (human-readable). |
| `exchangeBalance` | string        | Exchange balance (human-readable).            |
| `logoUrl`         | string        | Logo URL.                                     |

***

## Query Positions

```
GET /api/v1/users/{userId}/positions
```

Same parameters as `/balance`. Returns `data` as a `tokenBalances` array.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.anchored.finance/trading-api-docs-en/api-reference/user-assets.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
