# All Mini Tickers Stream

24hr rolling window mini-ticker statistics for all symbols. These are NOT the statistics of the UTC day, but a 24hr rolling window from requestTime to 24hrs before. **Note that only tickers that have changed will be present in the array**.

## Update Speed

* Pushed on each block that is at least 1 second since the last push.

## Subscribe Request

* Subscribe Schema

See [`WsAllMiniTickerSubscriptionParams`](https://sodex.com/documentation/rest-v1/schema#wsallminitickersubscriptionparams) in [Schema](https://sodex.com/documentation/api/rest-v1/schema).

```typescript
interface SubscribeRequest {
  op: "subscribe";
  id: number | null; // Optional client originated request identifier sent as acknowledgment in the response.
  params: WsAllMiniTickerSubscriptionParams;
}
```

* Subscribe Ack Schema

See [`WsAllMiniTickerSubscriptionResult`](https://sodex.com/documentation/rest-v1/schema#wsallminitickersubscriptionresult) in [Schema](https://sodex.com/documentation/api/rest-v1/schema).

```typescript
interface SubscriptionResult {
  op: "subscribe";
  id: number | null; // Optional client originated request identifier sent as acknowledgment in the response.
  result: WsAllMiniTickerSubscriptionResult | null;
  success: boolean; // Indicates if the request was successfully processed by the engine.
  connID: string;
  error: string | null; // Condition: If success is false. Error message.
  time_in: number; // The timestamp when the subscription was received on the wire, just prior to parsing data, in milliseconds.
  time_out: number; // The timestamp when the acknowledgement was sent on the wire, just prior to transmitting data, in milliseconds.
}
```

* Example: Subscribe

```json
{
  "op": "subscribe",
  "params": {
    "channel": "allMiniTicker"
  }
}
```

* Example: Subscribe Ack

```json
{
  "op": "subscribe",
  "result": {
    "channel": "allMiniTicker"
  },
  "success": true,
  "connID": "0x9b2b4dab436282ffc8308ec125e0a4f4",
  "time_in": 1672515782130,
  "time_out": 1672515782136
}
```

## Unsubscribe Request

* Unsubscribe Schema

See [`WsAllMiniTickerSubscriptionParams`](https://sodex.com/documentation/rest-v1/schema#wsallminitickersubscriptionparams) in [Schema](https://sodex.com/documentation/api/rest-v1/schema).

```typescript
interface UnsubscribeRequest {
  op: "unsubscribe";
  id: number | null; // Optional client originated request identifier sent as acknowledgment in the response.
  params: WsAllMiniTickerSubscriptionParams;
}
```

* Unsubscribe Ack Schema

See [`WsAllMiniTickerSubscriptionResult`](https://sodex.com/documentation/rest-v1/schema#wsallminitickersubscriptionresult) in [Schema](https://sodex.com/documentation/api/rest-v1/schema).

```typescript
interface UnsubscriptionResult {
  op: "unsubscribe";
  id: number | null; // Optional client originated request identifier sent as acknowledgment in the response.
  result: WsAllMiniTickerSubscriptionResult | null;
  success: boolean; // Indicates if the request was successfully processed by the engine.
  connID: string;
  error: string | null; // Condition: If success is false. Error message.
  time_in: number; // The timestamp when the subscription was received on the wire, just prior to parsing data, in milliseconds.
  time_out: number; // The timestamp when the acknowledgement was sent on the wire, just prior to transmitting data, in milliseconds.
}
```

* Example: Unsubscribe

```json
{
  "op": "unsubscribe",
  "params": {
    "channel": "allMiniTicker"
  }
}
```

* Example: Unsubscribe Ack

```json
{
  "op": "unsubscribe",
  "result": {
    "channel": "allMiniTicker"
  },
  "success": true,
  "connID": "0x9b2b4dab436282ffc8308ec125e0a4f4",
  "time_in": 1672515782130,
  "time_out": 1672515782136
}
```

## Snapshot / Update Response

* Snapshot / Update Schema

See [`WsMiniTickerData`](https://sodex.com/documentation/rest-v1/schema#wsminitickerdata) in [Schema](https://sodex.com/documentation/api/rest-v1/schema).

```typescript
interface AllMiniTickerResponse {
  channel: "allMiniTicker";
  type: "snapshot" | "update";
  data: Array<WsMiniTickerData>;
}
```

* Example: Snapshot

```json
{
  "channel": "allMiniTicker",
  "type": "snapshot",
  "data": [
    {
      "E": 1766907116587,
      "s": "BTC-USD",
      "c": "87644",
      "o": "87545",
      "h": "87923",
      "l": "87274",
      "v": "5839.63544",
      "q": "511238370.12834"
    },
    {
      "E": 1766907116587,
      "s": "ETH-USD",
      "c": "2938.2",
      "o": "2933.4",
      "h": "2957.8",
      "l": "2916.6",
      "v": "16384.1424",
      "q": "48178150.8233"
    }
  ]
}
```

* Example: Update

```json
{
  "channel": "allMiniTicker",
  "type": "update",
  "data": [
    {
      "E": 1766907116587,
      "s": "BTC-USD",
      "c": "87644",
      "o": "87545",
      "h": "87923",
      "l": "87274",
      "v": "5839.63544",
      "q": "511238370.12834"
    },
    {
      "E": 1766907116587,
      "s": "ETH-USD",
      "c": "2938.2",
      "o": "2933.4",
      "h": "2957.8",
      "l": "2916.6",
      "v": "16384.1424",
      "q": "48178150.8233"
    }
  ]
}
```
