# Trades

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

### Params

```json
{
    "method": "subscribe",
    "params": {
        "source": "trades",
        "symbol": "SOL"
    }
}
```

### Stream

```json
{
  "channel": "trades",
  "data": [
    {
      "h": 80062522,
      "s": "BTC",
      "a": "0.00001",
      "p": "89471",
      "d": "close_short",
      "tc": "normal",
      "t": 1765018379085,
      "li": 1559885104
    }
  ]
}
```

<table><thead><tr><th width="181.800048828125">Field</th><th width="237.4000244140625">Type</th><th>Description</th></tr></thead><tbody><tr><td><code>'h'</code></td><td>integer</td><td>History ID</td></tr><tr><td><code>'s'</code></td><td>string</td><td>Symbol</td></tr><tr><td><code>'a'</code></td><td>decimal string</td><td>Amount</td></tr><tr><td><code>'p'</code></td><td>decimal string</td><td>Price</td></tr><tr><td><code>'d'</code></td><td>string</td><td><p>Trade side</p><p><code>open_long</code></p><p><code>open_short</code></p><p><code>close_long</code></p><p><code>close_short</code></p></td></tr><tr><td><code>'tc'</code></td><td>string</td><td><p>Trade cause</p><p><code>normal</code> <code>market_liquidation</code> <code>backstop_liquidation</code> <code>settlement</code></p></td></tr><tr><td><code>'t'</code></td><td>number</td><td>Timestamp in milliseconds</td></tr><tr><td><code>'li'</code></td><td>number</td><td>Exchange-wide nonce. Used to reliably determine exchange event ordering. Sequential and not subject to clock drift.</td></tr></tbody></table>


---

# 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/websocket/subscriptions/trades.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.
