# Get account balance history

```
GET /api/v1/account/balance/history
```

#### Query Parameters

<table><thead><tr><th width="176">Field</th><th width="98">Type</th><th width="95">Need</th><th>Description</th><th>Example</th></tr></thead><tbody><tr><td><code>"account"</code></td><td>string</td><td>required</td><td>User's wallet address</td><td><code>42trU9A5...</code></td></tr><tr><td><code>"limit"</code></td><td>integer</td><td>optional</td><td>Maximum number of records to return, defaults to system defined limit</td><td><code>100</code></td></tr><tr><td><code>"cursor"</code></td><td>string</td><td>optional</td><td>Cursor pagination to access records. Default to none</td><td><code>1115hVka</code></td></tr></tbody></table>

```
/api/v1/account/balance/history?account=42trU9A5...
```

#### Response

* Status 200: Successfully retrieved balance history

```json
{
  "success": true,
  "data": [
    {
      "amount": "100.000000",
      "balance": "1200.000000",
      "pending_balance": "0.000000",
      "event_type": "deposit",
      "created_at": 1716200000000
    }
    ...
  ],
  "next_cursor": "11114Lz77",
  "has_more": true
}
```

| Field               | Type           | Description                                                  |
| ------------------- | -------------- | ------------------------------------------------------------ |
| `'amount'`          | decimal string | Amount change to balance after event                         |
| `'balance'`         | decimal string | Account balance after event                                  |
| `'pending_balance'` | decimal string | Pending balance after event                                  |
| `'event_type'`      | string         | Type of balance event (see below)                            |
| `'created_at'`      | integer        | Timestamp in milliseconds of when the balance event occurred |
| `'next_cursor'`     | string         | Next cursor for pagination                                   |
| `'has_more'`        | boolean        | True if there exists a `'next_cursor'`                       |

| Event Type (String)      | Description                                |
| ------------------------ | ------------------------------------------ |
| `'deposit'`              | Deposit funds to account                   |
| `'deposit_release'`      | Release of previously pending deposit      |
| `'withdraw'`             | Withdrawal of funds from account           |
| `'trade'`                | Trading activity (fees, realized PnL)      |
| `'market_liquidation'`   | Liquidation by market orders               |
| `'backstop_liquidation'` | Liquidation by backstop liquidator         |
| `'adl_liquidation'`      | Liquidation by auto-deleveraging           |
| `'subaccount_transfer'`  | Transfer between subaccounts               |
| `'funding'`              | Funding payment                            |
| `'payout'`               | Payout event (from e.g. affiliate program) |

* Status 400: Invalid request parameters
* Status 401: Unauthorized access
* Status 500: Internal server error

#### Code Example (Python)

```python
import requests

response = requests.get(
    "/api/v1/portfolio?account/balance/history?account=42trU9A5..."
    headers={"Accept": "*/*"},
)

data = response.json()
```


---

# 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://pacifica.gitbook.io/docs/api-documentation/api/rest-api/account/get-account-balance-history.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.
