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

# Account Activity

> Query Prediction Markets positions, trades, and related activity for the currently authenticated account.

The Broker API returns positions and trades for the user identified by `X-User-Wallet-Address`. These private endpoints require a Broker API Key. See [Broker API Key and signing](https://dexbuilder.mintlify.site/en/api-reference/common/broker-authentication.md).

Production Base URL:

```text theme={null}
https://api.dexbuilder.com
```

## List Positions

```bash cURL theme={null}
curl -G "https://api.dexbuilder.com/api/v4/broker/prediction/positions" \
  -H "KEY: ${BROKER_API_KEY}" \
  -H "SIGN: ${SIGN}" \
  -H "Timestamp: ${TIMESTAMP}" \
  -H "X-User-Wallet-Address: ${USER_WALLET}" \
  --data-urlencode "event_id=<event_id>" \
  --data-urlencode "condition_id=<condition_id>" \
  --data-urlencode "settlement_status=OPEN" \
  --data-urlencode "limit=20"
```

Common response fields include:

| Field | Description |
| - | - |
| `position_id` | Position ID |
| `event_id` | Event ID |
| `token_id` | Outcome Token ID |
| `outcome` | Corresponding outcome |
| `size` | Total position size |
| `available_size` | Available quantity |
| `locked_size` | Locked quantity |
| `avg_open_price` | Average entry price |
| `position_value` | Current position value |
| `settlement_status` | Settlement status |
| `won` | Whether the position won after market resolution |
| `updated_at` | Last update time |

Use the returned `next_cursor` as `cursor` for the next page.

## Get a Position

```bash cURL theme={null}
curl "https://api.dexbuilder.com/api/v4/broker/prediction/positions/<position_id>" \
  -H "KEY: ${BROKER_API_KEY}" \
  -H "SIGN: ${SIGN}" \
  -H "Timestamp: ${TIMESTAMP}" \
  -H "X-User-Wallet-Address: ${USER_WALLET}"
```

## List User Trades

```bash cURL theme={null}
curl -G "https://api.dexbuilder.com/api/v4/broker/prediction/usertrades" \
  -H "KEY: ${BROKER_API_KEY}" \
  -H "SIGN: ${SIGN}" \
  -H "Timestamp: ${TIMESTAMP}" \
  -H "X-User-Wallet-Address: ${USER_WALLET}" \
  --data-urlencode "condition_id=<condition_id>" \
  --data-urlencode "token_id=<token_id>" \
  --data-urlencode "limit=20"
```

User trade records typically include fields such as `trade_id`, `order_id`, `condition_id`, `token_id`, `price`, `size`, `side`, `role`, and `fee_rate`.

## Query Scope

The current endpoints primarily provide data for the authenticated account, including:

* positions;
* user trades;
* orders;
* account assets and account-book records;
* settlement and claim records.

> [!NOTE]
>
> Account endpoints query data for the currently authenticated user. They should not be interpreted as public on-chain query endpoints for arbitrary wallet addresses.


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