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

# Get Account Balance History

> This endpoint allows users to get account balance history. Returns all balance effects that affect the queried account.

```http theme={null}
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><tr><td><code>"include\_trades"</code></td><td>boolean</td><td>optional</td><td>If true, includes trade events. By default only shows deposit, withdraw, subaccount transfer, and payout events</td><td><code>false</code></td></tr></tbody></table>

```http theme={null}
/api/v1/account/balance/history?account=42trU9A5...
```

#### Response

* Status 200: Successfully retrieved balance history

```json theme={null}
{
  "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 theme={null}
import requests

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

data = response.json()
```
