> ## 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.

# Account Margin

> Streams all changes made to an account's margin mode in any market.

Refer to [Websocket](/api-documentation/api/websocket) for establishing the websocket connection.

## Margin

### Params

```json theme={null}
{
    "method": "subscribe",
    "params": {
        "source": "account_margin",
        "account": "42trU9A5..."
    }
}
```

### Stream

```json theme={null}
{
    "channel": "account_margin",
    "data": {
        "u": "42trU9A5...",
        "s": "ETH",
        "i": true,
        "t": 1234567890
    }
}
```

| Field | Type    | Description                                |
| ----- | ------- | ------------------------------------------ |
| `'u'` | string  | Account address                            |
| `'t'` | number  | Timestamp in milliseconds                  |
| `'s'` | string  | Symbol                                     |
| `'i'` | boolean | New margin mode (isolated or not isolated) |
