BitMEX WebSocket API
Stream BitMEX derivatives data (orderBookL2, quote, trade, funding) and authenticated account/order/position channels from a typed Delphi component.
Stream BitMEX derivatives data (orderBookL2, quote, trade, funding) and authenticated account/order/position channels from a typed Delphi component.
BitMEX derivatives WebSocket API client — full Level 2 order book, trade tape, quote stream and HMAC-signed private channels.
TsgcWSAPI_Bitmex
Windows, macOS, Linux, iOS, Android
Standard / Professional / Enterprise
Pair the component with a TsgcWebSocketClient, set Bitmex.ApiKey / Bitmex.ApiSecret for signed streams, then subscribe to instrument channels.
uses
sgcWebSocket, sgcWebSocket_API_Bitmex;
var
WSClient: TsgcWebSocketClient;
Bitmex: TsgcWSAPI_Bitmex;
begin
WSClient := TsgcWebSocketClient.Create(nil);
Bitmex := TsgcWSAPI_Bitmex.Create(nil);
Bitmex.Client := WSClient;
Bitmex.Bitmex.ApiKey := 'your-api-key';
Bitmex.Bitmex.ApiSecret := 'your-api-secret';
WSClient.Active := True;
Bitmex.SubscribeQuote('XBTUSD');
Bitmex.SubscribeTrade('XBTUSD');
Bitmex.SubscribeOrderBookL2('XBTUSD');
end;
// uses: sgcWebSocket, sgcWebSocket_API_Bitmex
TsgcWebSocketClient *WSClient = new TsgcWebSocketClient(this);
TsgcWSAPI_Bitmex *Bitmex = new TsgcWSAPI_Bitmex(this);
Bitmex->Client = WSClient;
WSClient->Active = true;
Bitmex->SubscribeQuote("XBTUSD");
Bitmex->SubscribeTrade("XBTUSD");
Bitmex->SubscribeOrderBookL2("XBTUSD");
Level 2 book snapshots and deltas, trade tape, quote stream, instrument metadata, plus authenticated execution and margin channels.
SubscribeQuote, SubscribeTrade, SubscribeOrderBookL2, SubscribeOrderBook10, SubscribeInstrument, SubscribeFunding, SubscribeLiquidation cover the full BitMEX market surface.
OrderBookL2 publishes the partial snapshot then per-row insert / update / delete deltas. Apply each delta to maintain a synchronised local book.
Set Bitmex.ApiKey and Bitmex.ApiSecret then subscribe to position, execution, order, margin, wallet — the component signs each request with HMAC-SHA256.
Toggle Bitmex.TestNet to switch the WebSocket endpoint to testnet.bitmex.com for sandbox testing.
Each channel:symbol pair routes through its own event so a single component can multiplex hundreds of subscribed contracts on one connection.
Bind to the underlying TsgcWebSocketClient for HeartBeat (ping/pong every 5s) and WatchDog auto-reconnect with state restoration.
Authoritative sources for the APIs this component implements.
Deep-link to the component reference, grab the ready-to-run demo project, and download the trial.
| Online Help — API_Bitmex Full property, method and event reference for this component. | Open | |
| Demo Project — Demos\05.Crypto\06.Bitmex Ready-to-run example project. Ships inside the sgcWebSockets package — download the trial below. | Open | |
| Technical Document (PDF) Features, quick start, code samples for Delphi & C++ Builder and primary-source references — this component only. | Open | |
| User Manual (PDF) Comprehensive manual covering every component in the library. | Open |