> For the complete documentation index, see [llms.txt](https://docs.ticko.xyz/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.ticko.xyz/api-documentation/market/websocket/trade.md).

# Trade

Name of channel: `trade`

Description: Pushes recent trades for a symbol.

URL path: `/v1/public/market`

Authentication: No auth required

Request parameters:

| Parameter   | Type    | Required | Description      |
| ----------- | ------- | -------- | ---------------- |
| `channel`   | string  | Yes      | `trade`          |
| `symbol_id` | integer | Yes      | Trading pair ID. |

Subscription acknowledgement fields:

| Field     | Type    | Description                                                             |
| --------- | ------- | ----------------------------------------------------------------------- |
| `id`      | string  | Echoes the request `id`. String, max 32 characters, `[A-Za-z0-9]` only. |
| `op`      | string  | `subscribe` or `unsubscribe`.                                           |
| `success` | boolean | Whether at least one subscription succeeded.                            |
| `args`    | array   | Successful subscription args. Present on success.                       |
| `code`    | string  | Error code. Present on failure.                                         |
| `msg`     | string  | Error message. Present on failure.                                      |

Push data parameters:

| Field | Type    | Description                      |
| ----- | ------- | -------------------------------- |
| `i`   | string  | Trade ID.                        |
| `p`   | string  | Price.                           |
| `q`   | string  | Quantity.                        |
| `a`   | string  | Amount.                          |
| `m`   | boolean | Whether the taker was the buyer. |
| `t`   | integer | Trade timestamp.                 |
| `x`   | string  | Transaction hash.                |

Request example:

```json
{
  "id": "subTrade",
  "op": "subscribe",
  "args": [
    { "channel": "trade", "symbol_id": 100001 }
  ]
}
```

Response example, success:

```json
{
  "id": "subTrade",
  "op": "subscribe",
  "success": true,
  "args": [
    { "channel": "trade", "symbol_id": 100001 }
  ]
}
```

Response example, failure:

```json
{
  "id": "subTrade",
  "op": "subscribe",
  "success": false,
  "code": "220001",
  "msg": "Symbol does not exist"
}
```

Push data example:

```json
{
  "arg": { "channel": "trade", "symbol_id": 100001 },
  "finality": "final",
  "data": [
    {
      "i": "900001",
      "p": "67500.00",
      "q": "0.100",
      "a": "6750.00",
      "m": true,
      "t": 1719500000000,
      "x": "0xaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
    }
  ],
  "ts": 1719500000000
}
```


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## 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, and the optional `goal` query parameter:

```
GET https://docs.ticko.xyz/api-documentation/market/websocket/trade.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

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.
