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

# Trade Executed

The executions channel streams trades execution events for this account.

{% hint style="info" %}
This channel contains account specific data, an authentication token is required in the request. Follow this [documentation ](/websocket-api-1.0/websocket-authentication.md)how to get an authentication token.
{% endhint %}

### Subscribe with Pusher

```javascript
var channel = pusher.subscribe("private-trade-executed.{userId}");
```

### Subscribe Request Payload

```javascript
{
   "event": "pusher:subscribe",
   "data": {
       "auth": "cd02139a35ead0a82ef6:672560a4d0f83cf5053cf509157ee24009c674188b58b71dd2f98647d9cab1df",
       "channel": "private-trade-executed.{userId}"
   }
}
```

### Examples

<details>

<summary>Pusher</summary>

```javascript
var channel = pusher.subscribe("private-trade-executed.{userId}");
```

</details>

<details>

<summary>WebSocket API in Javascript</summary>

```javascript
const message = {
        event: "pusher:subscribe",
        "data": {
            "auth": "cd02139a35ead0a82ef6:672560a4d0f83cf5053cf509157ee24009c674188b58b71dd2f98647d9cab1df",
            "channel": "private-trade-executed.1"
         }
    };
socket.send(JSON.stringify(message));
```

</details>

### Payload

| Name            | Type           | Description                                                    |
| --------------- | -------------- | -------------------------------------------------------------- |
| id              | integer        | Unique identifier for the trade.                               |
| timestamp       | string         | Timestamp of the trade (e.g., "2024-09-18 23:31:27").          |
| type            | string         | Type of trade (e.g., "sell").                                  |
| order\_id       | integer        | Unique identifier for the related order (e.g., 196857).        |
| order\_type     | string         | The type of order (e.g., "limit").                             |
| pair\_id        | integer        | Unique identifier of the asset pair (e.g., 685).               |
| pair            | string         | The asset pair being traded (e.g., "NIZA/USDT").               |
| volume.amount   | string         | Volume of the asset being traded (e.g., "100.00000000").       |
| volume.currency | string         | The asset being traded (e.g., "NIZA").                         |
| price.amount    | string         | Price at which the asset was traded (e.g., "100.00000000").    |
| price.currency  | string         | Currency pair of the price (e.g., "NIZA/USDT").                |
| cost.amount     | string         | Total cost of the trade (e.g., "10000.00000000").              |
| cost.currency   | string         | Currency in which the cost is calculated (e.g., "USDT").       |
| fee.amount      | string         | Fee charged for the trade (e.g., "100.00000000").              |
| fee.currency    | string         | Currency of the fee (e.g., "USDT").                            |
| transaction\_id | string         | Unique transaction identifier for the trade.                   |
| leverage        | string or null | Leverage used in the trade, if applicable (null in this case). |

### Example of the Payload

```json
{
   "id": 156391,
   "timestamp": "2024-09-18 23:31:27",
   "type": "sell",
   "order_id": 196857,
   "order_type": "limit",
   "pair_id": 685,
   "pair": "NIZA\/USDT",
   "volume": {
       "amount": "100.00000000",
       "currency": "NIZA"
   },
   "price": {
       "amount": "100.00000000",
       "currency": "NIZA\/USDT"
   },
   "cost": {
       "amount": "10000.00000000",
       "currency": "USDT"
   },
   "fee": {
       "amount": "100.00000000",
       "currency": "USDT"
   },
   "transaction_id": "TGZA3R-ZVETW-RUIYAO",
   "leverage": null
}
```
