The Paradex WebSocket API provides real-time market data and account updates. WebSockets allow for a persistent connection between the client and server, enabling efficient two-way communication.
The Paradex WebSocket API provides two types of channels:
Public Channels: Publish information about the exchange that is not specific to a particular account. Examples include market summary, order book, trades, etc. You do not need to authenticate to subscribe to public channels.
Private Channels: Publish information about a particular account. You need to authenticate to subscribe to private channels.
To establish a WebSocket connection, you can use various programming languages and libraries. When running Python-based code, Python 3.10+ is recommended.
Upon successful connection, you should see:
Paradex has implemented ping/pong functionality as part of the WebSocket specification. This works at the protocol level:
Most modern WebSocket libraries and frameworks automatically handle ping/pong messages. If you’re using older libraries or building a WebSocket client from scratch, you may need to implement this functionality manually.
To display incoming ping messages, you can use the following wscat command: