This is a C# implementation of the Bitmex websocket API found here:
https://www.bitmex.com/app/wsAPI
Apache License 2.0
- instalation via NuGet (Bitmex.Client.Websocket)
- public and authenticated API
- targeting .NET Standard 2.0 (.NET Core, Linux/MacOS compatible)
- reactive extensions (Rx.NET)
- integrated logging (Serilog)
var exitEvent = new ManualResetEvent(false);
var url = Bitmex.ApiWebsocketUrl;
using (var communicator = new BitmexWebsocketCommunicator(url))
{
using (var client = new BitmexWebsocketClient(communicator))
{
client.Streams.InfoStream.Subscribe(info =>
{
Console.WriteLine($"Info received, reconnection happened.")
client.Send(new PingRequest()).Wait();
});
client.Streams.PongStream.Subscribe(pong =>
{
Console.WriteLine($"Pong received!")
exitEvent.Set();
});
await communicator.Start();
exitEvent.WaitOne(TimeSpan.FromSeconds(30));
}
}
More usage examples:
PUBLIC | Covered |
---|---|
Info | ✔ |
Ping-Pong | ✔ |
Errors | ✔ |
Subscribe | ✔ |
Unsubscribe | |
Announcement | |
Chat | |
Connected | |
Funding | |
Instrument | |
Insurance | |
Liquidation | ✔ |
Orderbook L2 | ✔ |
Orderbook L10 | |
Public notifications | |
Quote | ✔ |
Quote bin 1m | |
Quote bin 5m | |
Quote bin 1h | |
Quote bin 1d | |
Settlement | |
Trade | ✔ |
Trade bin 1m | |
Trade bin 5m | |
Trade bin 1h | |
Trade bin 1d |
AUTHENTICATED | Covered |
---|---|
Affilate | |
Execution | |
Order | ✔ |
Margin | |
Position | ✔ |
Private notifications | |
Transact | |
Wallet | ✔ |
Pull Requests are welcome!
I do consulting, please don't hesitate to contact me if you have a custom solution you would like me to implement (web, m@mkotas.cz)
Donations gratefully accepted.