# Best Bid/Ask

**Channel Update Frequency:** Real-time

This websocket subscription streams the best bid and ask in real-time. Messages are pushed on every best bid/ask update in real-time

<details>

<summary>Curl</summary>

**Request format**

```
{
    "op": "subscribe",
    "tag": "test1",
    "args": [
        "bestBidAsk:BTC-USD-SWAP-LIN"
    ]
}
```

**Success response format**

```
{
    "success": true,
    "tag": "test1",
    "event": "subscribe",
    "channel": "bestBidAsk:BTC-USD-SWAP-LIN",
    "timestamp": "1665456882918"
}
```

\*\* depth update channel format\*\*

```
{
    "table": "bestBidAsk",
    "data": {
        "ask": [
            19045.0,
            1.0
        ],
        "checksum": 3790706311,
        "marketCode": "BTC-USD-SWAP-LIN",
        "bid": [
            19015.0,
            1.0
        ],
        "timestamp": "1665456882928"
    }
}
```

</details>

**Request Parameters**

| Parameters | Type              | Required | Description                                                                                   |
| ---------- | ----------------- | -------- | --------------------------------------------------------------------------------------------- |
| op         | STRING            | Yes      | `subscribe`                                                                                   |
| tag        | INTEGER or STRING | No       | If given it will be echoed in the reply                                                       |
| args       | LIST              | Yes      | List of individual markets `<bestBidAsk>:<marketCode>` e.g: `["bestBidAsk:BTC-USD-SWAP-LIN"]` |

**Channel Update Fields**

| Fields     | Type           | Description                                                     |
| ---------- | -------------- | --------------------------------------------------------------- |
| table      | STRING         | `bestBidAsk`                                                    |
| data       | DICTIONARY     |                                                                 |
| ask        | LIST of floats | <p>Sell side depth;</p><ol><li>price</li><li>quantity</li></ol> |
| bid        | LIST of floats | <p>Buy side depth;</p><ol><li>price</li><li>quantity</li></ol>  |
| checksum   | LONG           |                                                                 |
| marketCode | STRING         | marketCode                                                      |
| timestamp  | STRING         | Millisecond timestamp                                           |
