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

# slotUnsubscribe | Solana

> Cancel a Solana slot subscription with slotUnsubscribe. Stop receiving real-time WebSocket notifications for slot processing updates from the node.

See also [slotSubscribe | Solana](/reference/slotsubscribe-solana).

## Parameters

* `integer` - The ID of the subscription that you want to cancel. This is the subscription ID that was returned when calling `slotSubscribe`.

## Response

* `boolean` - A boolean value indicating if the subscription was removed successfully. `true` if removed successfully, `false` if not.

## `slotUnsubscribe` code examples

<Info>
  Note that subscriptions require a WebSocket connection. You can use a WebSocket client library for your programming language of choice to interact with Solana's WebSocket API.
</Info>

<CodeGroup>
  ```shell wscat theme={"system"}
  $ wscat -c YOUR_CHAINSTACK_WEBSOCKET_ENDPOINT
  # Wait for the connection to be established

  Connected (press CTRL+C to quit)

  > {"jsonrpc":"2.0","id":1,"method":"slotUnsubscribe","params":[0]}
  ```
</CodeGroup>

## Use case

The `slotUnsubscribe` method is important for proper resource management in applications that use slot subscriptions. Common use cases include:

* Cleanup: Remove slot subscriptions when monitoring is no longer needed
* Resource management: Free up system resources by unsubscribing from unused slot notifications
* Connection handling: Clean up subscriptions during application shutdown or WebSocket disconnections
* Subscription rotation: Remove old subscriptions when establishing new ones

By properly managing slot subscriptions through unsubscribe calls, applications can maintain optimal performance and prevent resource leaks.
