The following subscription topics are available without authentication:

"announcement",        // Site announcements
"chat",                // Trollbox chat
"connected",           // Statistics of connected users/bots
"funding",             // Updates of swap funding rates. Sent every funding interval (usually 8hrs)
"instrument",          // Instrument updates including turnover and bid/ask
"insurance",           // Daily Insurance Fund updates
"liquidation",         // Liquidation orders as they're entered into the book
"orderBookL2_25",      // Top 25 levels of level 2 order book
"orderBookL2",         // Full level 2 order book
"orderBook10",         // Top 10 levels using traditional full book push
"publicNotifications", // System-wide notifications (used for short-lived messages)
"quote",               // Top level of the book
"quoteBin1m",          // 1-minute quote bins
"quoteBin5m",          // 5-minute quote bins
"quoteBin1h",          // 1-hour quote bins
"quoteBin1d",          // 1-day quote bins
"settlement",          // Settlements
"trade",               // Live trades
"tradeBin1m",          // 1-minute trade bins
"tradeBin5m",          // 5-minute trade bins
"tradeBin1h",          // 1-hour trade bins 

The following subjects require authentication:

"affiliate",   // Affiliate status, such as total referred users & payout %
"execution",   // Individual executions; can be multiple per order
"order",       // Live updates on your orders
"margin",      // Updates on your current account balance and margin requirements
"position",    // Updates on your positions
"privateNotifications", // Individual notifications - currently not used
"transact"     // Deposit/Withdrawal updates
"wallet"       // Bitcoin address balance data, including total deposits & withdrawals



<script src="https://cdnjs.cloudflare.com/ajax/libs/crypto-js/3.1.2/rollups/hmac-sha256.js"></script>

<script src="https://cdnjs.cloudflare.com/ajax/libs/crypto-js/3.1.2/components/enc-base64-min.js"></script>

<script type="text/javascript"> 
function getSocket(API_KEY,API_SECRET){
	var timestamp = new Date().getTime();
	var message = "GET/realtime"+timestamp;
	var bitmex_signature = CryptoJS.HmacSHA256(message, API_SECRET);
	var exampleSocket    = new WebSocket("wss://www.bitmex.com/realtime?");
	
	exampleSocket.onopen = function (){
		exampleSocket.send("{\"op\" : \"authKeyExpires\", \"args\" : [\""+API_KEY+"\","+timestamp+",\""+bitmex_signature+"\"]}");
		exampleSocket.send("{\"op\" : \"subscribe\" , \"args\" : [\"position\",\"wallet\",\"margin\",\"order\"]}"); 	
	}
	
	exampleSocket.onmessage = function (event) {
		console.log(event.data);
	}
}
</script>