The Paradex WebSocket API allows you to subscribe to various channels to receive real-time updates. This page explains how to subscribe and unsubscribe from channels.
To receive updates from a specific channel, you need to subscribe to it. Multiple calls to subscribe can be made, each for a different channel.
Note: Subscribing to the same channel more than once will return an error.
To subscribe to a channel, send a message with the following format:
Upon successful subscription, you will receive a response similar to:
To stop receiving updates from a specific channel, you need to unsubscribe from it.
Note: Unsubscribing from a channel that you are not subscribed to will return an error.
To unsubscribe from a channel, send a message with the following format:
Upon successful unsubscription, you will receive a response similar to:
Here’s a complete example of how to subscribe to the trades.ETH-USD-PERP channel using Python:
Here’s a complete example of how to unsubscribe from the trades.ETH-USD-PERP channel using Python:
Refer to the WebSocket Channels documentation for a list of supported channels.