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

> Streams deposit, withdrawal, and transfer events for an account.

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

## Account Transfers

### Params

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

### Stream

```json theme={null}
{
    "channel": "account_transfers",
    "data": {
        "u": "42trU9A5...",
        "e": "deposit",
        "a": "USDC",
        "am": "1000.000000",
        "t": 1716200000000,
        "tx": "5xGk...",
        "bn": 42,
        "ra": "1000.000000",
        "f": "0.500000"
    }
}
```

Note: the optional keys (`tx`, `s`, `r`, `bn`, `ra`, `f`) are **omitted** from the payload when they do not apply — they are not sent as `null`. Only `u`, `e`, `a`, `am`, and `t` are always present.

| Field | Type | Description |
| - | - | - |
| `'u'` | string | Account address |
| `'e'` | string | Transfer event type: `deposit`, `subaccount_transfer`, `withdrawal_pending`, `withdrawal_confirmed` |
| `'a'` | string | Asset symbol |
| `'am'` | string | Transfer amount |
| `'t'` | number | Timestamp in milliseconds |
| `'tx'` | string (optional) | Transaction ID (omitted if not applicable) |
| `'s'` | string (optional) | Source address (omitted if not applicable) |
| `'r'` | string (optional) | Receiver address (omitted if not applicable) |
| `'bn'` | integer (optional) | Batch nonce for withdrawals (omitted if not applicable) |
| `'ra'` | string (optional) | Requested amount before fees (omitted if not applicable) |
| `'f'` | string (optional) | Fee amount (omitted if not applicable) |

#### Code Example (Python)

```python theme={null}
import asyncio
import json
import websockets

async def subscribe_account_transfers(account: str):
    uri = "wss://<exchange-ws-url>"
    async with websockets.connect(uri) as ws:
        await ws.send(json.dumps({
            "method": "subscribe",
            "params": {
                "source": "account_transfers",
                "account": account,
            },
        }))
        async for message in ws:
            data = json.loads(message)
            print(data)

asyncio.run(subscribe_account_transfers("42trU9A5..."))
```


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.