> ## 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.discovery

> Streams the discovery board: each column in full after subscribing, then each change.

Streams the columns of the discovery board, ranked.

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 [Discovery](https://docs.metastreams.io/reference/rest/discovery.md) request body: `chains`, and one or more of the columns `newPairs`, `graduating` and `graduated`. Each column takes `sortBy`, `order`, `limit` and `filters`, with the same defaults as the REST request.

`chains` must list at least one chain, and the filter must include at least one column. Each subscription counts as one address against the [address limit](https://docs.metastreams.io/streams/filters.md#address-limits). The channel does not accept a `throttleMs` above 0 or any other subscribe option.

## Updates

* After the `ack`, one update for each requested column contains the whole column, in rank order. It matches the REST response for the same body. An empty column sends an update with an empty `deltas` list.
* After that, each change to a token can add, move or remove it. A token is added while its column has room, or when it ranks above the last row of a full column, which then drops.
* A token that no longer matches `filters` or the column defaults is removed, and the rows below it move up. A token that graduates moves from `newPairs` or `graduating` to `graduated`.
* Changes are batched every 250 milliseconds. Each batch sends one update for each column that changed, and nothing for a column that did not.
* If the first request for one chain does not succeed, the first update omits that chain's rows, and the other chains still fill the column. The REST request returns an error instead.

The server never ranks a column again, and checks the time rules, such as the 24-hour activity cutoff and `lastActivityMinutes`, only when a token changes. A token that stops trading therefore stays in the column, and a removed row's place stays empty until another token fills it. Over time, a column drifts from the REST response for the same body. To realign it, subscribe again, for example every few minutes.

Each update costs [one third of a credit](https://docs.metastreams.io/concepts/errors.md#credits).

## Message format

Each update's `data` contains the `column` it describes and a `deltas` list. Keep one row per `column`, `chain` and `address`, and apply each delta in order:

| Delta | Action |
| - | - |
| `data` and `rank` | Replace the row with `data`, and place it at `rank`. The row is new, or its token changed. |
| `rank` without `data` | Move the row to `rank`. |
| `rank` is `null` | Remove the row. |

In each update, the removals come first, then the other rows in rank order. `rank` starts at 1. `data` has the same fields as a token in the [Discovery](https://docs.metastreams.io/reference/rest/discovery.md) response.

After a reconnect, subscribe again. No REST request is needed.

## Errors

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

```json Subscribe theme={null}
{
  "action": "subscribe",
  "channel": "spot.discovery",
  "filters": {
    "chains": ["solana"],
    "newPairs": { "limit": 30 },
    "graduating": { "sortBy": "bondingCurveActivity", "limit": 30 }
  }
}
```

```json First update (shortened) theme={null}
{
  "type": "update",
  "channel": "spot.discovery",
  "subscriptionId": "6f7a8b9c-0d1e-4f2a-8b3c-4d5e6f7a8b9c",
  "data": {
    "column": "newPairs",
    "deltas": [
      {
        "chain": "solana",
        "address": "TokenMint1111111111111111111111111111111pump",
        "rank": 1,
        "data": {
          "chain": "solana",
          "address": "TokenMint1111111111111111111111111111111pump",
          "name": "Example",
          "symbol": "EXAMPLE",
          "launchpad": "pumpfun",
          "bondingCurvePct": "12.4",
          "price": { "native": "0.000000031", "usd": "0.0000055" },
          "marketCap": { "native": "31", "usd": "5520" },
          "createdAt": 1789632001000,
          "updatedAt": 1789632012345
        }
      }
    ]
  }
}
```

```json Later update (shortened) theme={null}
{
  "type": "update",
  "channel": "spot.discovery",
  "subscriptionId": "6f7a8b9c-0d1e-4f2a-8b3c-4d5e6f7a8b9c",
  "data": {
    "column": "newPairs",
    "deltas": [
      { "chain": "solana", "address": "TokenMint2222222222222222222222222222222pump", "rank": null },
      {
        "chain": "solana",
        "address": "TokenMint3333333333333333333333333333333pump",
        "rank": 1,
        "data": { "chain": "solana", "address": "TokenMint3333333333333333333333333333333pump", "symbol": "NEW" }
      },
      { "chain": "solana", "address": "TokenMint1111111111111111111111111111111pump", "rank": 2 }
    ]
  }
}
```


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