> ## Documentation Index
> Fetch the complete documentation index at: https://docs.metastreams.io/llms.txt
> Use this file to discover all available pages before exploring further.

# spot.trending

> Streams a trending board: the full board after subscribing, then each change.

Streams one trending board. The first update contains the full board, and later updates contain only the rows that changed.

Subscribe on an open stream connection. See [WebSocket streams](https://docs.metastreams.io/streams/overview.md) for connections, frames and reconnection.

## Filters

The filter is the [Trending](https://docs.metastreams.io/reference/rest/trending.md) request body: `chains`, `window`, `limit` and `filters`.

`chains` must list at least one chain. Each subscription uses one unit of the [address limit](https://docs.metastreams.io/streams/filters.md#address-limits). The channel does not accept `throttleMs` or any other subscribe option.

## Updates

* The full board is sent as one update after the `ack`. It matches the REST response for the same body, in content and order, and can be up to 10 seconds old.
* The board is ranked again every 60 seconds. The update after each ranking contains only the rows that changed.
* Between rankings, changes to a ranked token's state are sent at most once per second, in one update.
* A token is added to the board only when the board is ranked again.
* A token whose new state no longer matches `filters` is removed between rankings, and the rows below it move up.
* No update is sent when nothing changed, so an empty board sends no update.

Each update counts against the organization's [credits](https://docs.metastreams.io/concepts/errors.md#credits). A board uses at most about one credit per second, plus one per minute for each ranking.

## Message format

Each update's `data` contains a `deltas` list, the same shape that [Trending](https://docs.metastreams.io/reference/rest/trending.md) returns. Keep one row per `chain` and `address`, and apply each delta in order:

| Delta | Action |
| - | - |
| `data` and `rank` | Replace the row with `data`, and place it at `rank`. |
| `rank` without `data` | Move the row to `rank`. |
| `rank` is `null` | Remove the row. |

The score is not sent. After a reconnect, subscribe again: the first update contains the full board, so no REST request is needed.

## Errors

| Code | When |
| - | - |
| `UNSUPPORTED_CHAIN` | Unsupported slug in `chains` |
| `VALIDATION_ERROR` | An empty `chains` list; an unknown filter field; `throttleMs` or another subscribe option; an exceeded [subscription limit](https://docs.metastreams.io/streams/filters.md#address-limits) |

```json Subscribe theme={null}
{
  "action": "subscribe",
  "channel": "spot.trending",
  "filters": {
    "chains": ["solana", "base"],
    "window": "1h",
    "limit": 50,
    "filters": { "marketCapUsd": { "min": "100000" } }
  }
}
```

```json Update (shortened) theme={null}
{
  "type": "update",
  "channel": "spot.trending",
  "subscriptionId": "4d5e6f7a-8b9c-4d0e-9f1a-2b3c4d5e6f7a",
  "data": {
    "deltas": [
      { "chain": "base", "address": "0x4200000000000000000000000000000000000abc", "rank": null },
      { "chain": "solana", "address": "TokenMint1111111111111111111111111111111pump", "rank": 3 },
      {
        "chain": "solana",
        "address": "TokenMint2222222222222222222222222222222pump",
        "rank": 4,
        "data": {
          "chain": "solana",
          "address": "TokenMint2222222222222222222222222222222pump",
          "name": "Example",
          "symbol": "EXAMPLE",
          "decimals": 6,
          "price": { "native": "0.0000031", "usd": "0.00055" },
          "marketCap": { "native": "3100", "usd": "552000" },
          "updatedAt": 1789632012345
        }
      }
    ]
  }
}
```


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.