---
title: "private/get_subaccount_value_history"
method: POST
path: "/private/get_subaccount_value_history"
tags: ["Other"]
---

# private/get_subaccount_value_history

`POST /private/get_subaccount_value_history`

## Request

- Base URL: `https://api.derive.xyz/v3`
- URL: `https://api.derive.xyz/v3/private/get_subaccount_value_history`
- Auth: API key in header `X-DeriveWallet` and API key in header `X-DeriveTimestamp` and API key in header `X-DeriveSignature`

## Request body

- GetSubaccountValueHistoryRequest: `wallet`, when set, takes precedence over `subaccount_id`. The window is unix milliseconds; `period` is seconds and must be one the sampler's tables cover.
  - `end_timestamp` integer, nullable
  - `page` integer, nullable
  - `page_size` integer, nullable
  - `period` integer, nullable
  - `start_timestamp` integer, nullable
  - `subaccount_id` integer, nullable
  - `wallet` string, nullable

## Response `200`

Success

- SubaccountValueHistoryResult: By-wallet lookups return every owned subaccount's samples, concatenated and tagged with `subaccount_id` — not a summed wallet total. Coverage is ragged by design: a subaccount contributes no entry for buckets in which it held nothing, rather than reporting a zero it never had. Callers plotting a wallet total must group by `subaccount_id` and carry each series forward.
  - `pagination` Pagination, required: Response envelope for paginated RPCs.
    - `count` integer, required
    - `num_pages` integer, required
  - `subaccount_value_history` SubaccountValueEntry[], required
    - `currency` string, required: The manager's currencies, comma-joined; empty if it has none listed.
    - `initial_margin` string, decimal, required: Initial margin at the sample, positive meaning healthy.
    - `maintenance_margin` string, decimal, required: Maintenance margin at the sample, positive meaning healthy.
    - `margin_type` string, required: Manager's margin model — "SM" or "PM2".
    - `subaccount_id` integer, required
    - `subaccount_value` string, decimal, required: Mark-to-market value, e12 fixed point on the wire as a decimal string.
    - `timestamp` integer, required: The instant this sample is as-of, unix milliseconds.

## Other responses

- `default`: JSON-RPC error (see Error Codes)

## Changes

- **2026-10-20** `0c500202be49`: 2 info
  - the endpoint scheme security `DeriveWallet AND DeriveTimestamp AND DeriveSignature` was added to the API
  - added the media type `application/json` for the response with the status `default`

[Operation history](https://skmtc.dev/lyra/apis/derive-v3-api/changes/private/get_subaccount_value_history/post.md)

---

[API](https://skmtc.dev/lyra/apis/derive-v3-api.md) - [All operations](https://skmtc.dev/lyra/apis/derive-v3-api/llms.txt) - [OpenAPI document](https://skmtc.dev/lyra/apis/derive-v3-api/revisions/415f8a73b10c?raw)
