# slotSubscribe

> Streams a notification every time the validator begins processing a new slot.

Source: https://docs.constant-k.com/rpc/websocket/slotsubscribe/

`slotSubscribe` fires roughly once per slot, about every 270 ms on mainnet-beta, with the newly processed `slot`, its `parent`, and the current `root` together in one message.

There is no configuration and no commitment parameter: this reports the validator's raw processing progress, not finality. `rootSubscribe` covers finalized progress only, firing far less often and at lower cost.

- Transport: WebSocket, JSON-RPC 2.0 over `wss://ws-newyork.constant-k.com:1337/ws?api-key=YOUR_API_KEY`
- Category: Subscriptions
- Availability: Operator and above

## Parameters

None.

## Result

- `result` (integer, optional): The subscription id, returned once in the initial RPC response. Passed to `slotUnsubscribe`, it cancels the stream.

## Notifications

Updates arrive as `slotNotification` messages. `slot` is the slot the validator just started processing, `parent` is its parent slot, and `root` is the current root slot at the moment of the notification.

- `params.result` (object, optional)
  - `slot` (integer, optional): The newly processed slot.
  - `parent` (integer, optional): The parent of `slot`.
  - `root` (integer, optional): The current root slot when the notification was emitted.

## Unsubscribe

`slotUnsubscribe`, called with the subscription id, returns `true` once the subscription is removed.

## Example: Subscribe to slot updates

Request (send after connecting):

```json
{
  "jsonrpc": "2.0",
  "id": 1,
  "method": "slotSubscribe"
}
```

Response:

```json
{
  "jsonrpc": "2.0",
  "result": 25978,
  "id": 1
}
```

Notification:

```json
{
  "jsonrpc": "2.0",
  "method": "slotNotification",
  "params": {
    "result": {
      "slot": 447946408,
      "parent": 447946407,
      "root": 447946376
    },
    "subscription": 25978
  }
}
```

## Notes

- WebSocket access is included on the Operator plan and above; it is not available on Free.
- Concurrent connections are capped per API key: 10 on Operator, 50 on Blade Runner, 100 on Nexus.
- Subscribe and unsubscribe calls draw from the same global per-plan request-rate limit as HTTP calls: 50 req/s on Operator, 200 req/s on Blade Runner, 500 req/s on Nexus.
- Only subscription methods (the `*Subscribe` / `*Unsubscribe` family) are accepted on the WebSocket endpoint; standard request/response RPC methods must go over HTTPS instead.
- A `getHealth` request sent over the open socket on a regular interval serves as a keepalive; connections that go quiet can be dropped by intermediate load balancers.
- Each region has its own WebSocket hostname, for example `wss://ws-newyork.constant-k.com:1337/ws?api-key=YOUR_API_KEY`; every region is listed on the Endpoints page.
- Captured live from `wss://api.mainnet-beta.solana.com`.

