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

# Account Statistics

Use account statistics to retrieve historical time-series metrics for a trading sub-account, including equity, PnL, trading volume, and ROI.

## REST Endpoint

```http theme={null}
GET /api/v1/account/statistics
```

### Query Parameters

| Parameter             | Required | Description                                                                                                            |
| --------------------- | -------- | ---------------------------------------------------------------------------------------------------------------------- |
| `sub_account_address` | No       | Sub-account to query. If omitted, the backend determines the accessible account(s) from the authenticated user.        |
| `start_time`          | No       | Start timestamp in Unix milliseconds.                                                                                  |
| `end_time`            | No       | End timestamp in Unix milliseconds.                                                                                    |
| `step`                | No       | Aggregation interval. Supported values: `hour`, `day`, `week`, `month` (aliases `h`, `d`, `w`, `m` are also accepted). |
| `limit`               | No       | Maximum number of records to return.                                                                                   |
| `sorting_order`       | No       | Sort order: `asc` or `desc`.                                                                                           |

## TypeScript SDK

Retrieve account statistics:

```ts theme={null}
const statistics = await client.account.getStatistics({
  sub_account_address,
  start_time,
  end_time,
  step: "day",
  limit: 100,
  sorting_order: "desc",
});
```

## Example

```bash theme={null}
curl \
  -H "Authorization: Bearer <jwt>" \
  "https://api.cnt.ekiden.fi/api/v1/account/statistics?sub_account_address=<sub_account_address>"
```

## Response Fields

Each entry may include:

* `timestamp`
* `sub_account_address`
* `equity`
* `realised_pnl_cum`
* `unrealised_pnl`
* `volume`
* `roi`

The exact response schema is documented in the API Reference.
