Practical overview
When it fits
Use it when a C# application needs a BitMEX WebSocket client and its required messages appear in the project's coverage list.
Who it is for
- C# developers integrating BitMEX WebSocket connectivity into a service or trading application.
- Developers consuming supported BitMEX market-data or authenticated account streams.
Documented uses
- Connect a .NET application to BitMEX over WebSocket.
- Subscribe to supported public market streams such as quotes, trades, funding, instrument data, liquidations, and order books.
- Consume supported authenticated execution, order, margin, position, and wallet messages.
- Handle reconnection and restore channel subscriptions after reconnecting.
Requirements & limits
The project documents NuGet installation and targets .NET Standard 2.0 and 2.1, plus .NET 6 through 10.
- Check the documented API coverage against the exact public or authenticated streams required; the coverage table lists some areas as uncovered.
- The documented default idle reconnection timeout is one minute and can be configured.
- The client must resubscribe to channels after reconnection.
- The project describes an IBitmexCommunicator abstraction between the client and communicator for backtesting.
Check current requirements in the official documentation. Source-based guidance does not mean OpenViST has run or independently tested this project.
Connect to BitMEX and handle a ping-pong response
Start the WebSocket communicator, observe the info stream, send a ping, and wait for a pong.
Before you start
- A C# project targeting one of the listed frameworks: netstandard2.0, netstandard2.1, or net6.0 through net10.0.
- The Bitmex.Client.Websocket library, available via NuGet.
Steps
Create a ManualResetEvent and obtain the WebSocket URL from BitmexValues.ApiWebsocketUrl.
Create a BitmexWebsocketCommunicator with that URL and a BitmexWebsocketClient using the communicator, disposing both when finished.
Subscribe to InfoStream and send a PingRequest when an info event arrives; subscribe to PongStream and set the event when a pong arrives.
Start the communicator and wait on the event for up to 30 seconds.
Expected outcome
The sample waits for a pong response after starting the communicator and sending a ping.
Guide limitations
- The sample demonstrates info and ping-pong streams, not a specific market-data subscription or trading operation.
- The documented wait is limited to 30 seconds; no result is guaranteed if no pong arrives.
- After reconnection, channel subscriptions must be sent again.
Sources & review
Source record details
- Source availability
- Active
- Sources checked
- 8 October 2026
- Original website title
- Marfusios/bitmex-client-websocket · Official homepage title · retained in its source language

