wss://api.hotstuff.trade/ws
Channel: ticker
Parameters
Supported Methods
subscribe- Subscribe to ticker updatesunsubscribe- Unsubscribe from ticker updates
Supported Symbols
- Individual symbols:
BTC-PERP,ETH-PERP, etc. - All symbols:
"all"
Documentation Index
Fetch the complete documentation index at: /llms.txt
Use this file to discover all available pages before exploring further.
Questions? Join our Discord.
wss://api.hotstuff.trade/ws
Channel: ticker
| Parameter | Type | Required | Description | Example |
|---|---|---|---|---|
jsonrpc | string | Yes | JSON-RPC version | "2.0" |
id | string | Yes | Request identifier for tracking | "1" |
method | string | Yes | Action to perform | "subscribe" or "unsubscribe" |
channel | string | Yes | Channel name | "ticker" |
symbol | string | Yes | Trading symbol or “all” | "BTC-PERP", "ETH-PERP", "all" |
subscribe - Subscribe to ticker updatesunsubscribe - Unsubscribe from ticker updatesBTC-PERP, ETH-PERP, etc."all"{
"jsonrpc": "2.0",
"id": "1",
"method": "subscribe",
"params": {
"channel": "ticker",
"symbol": "BTC-PERP" // support "all"
}
}
{
"jsonrpc": "2.0",
"method": "event",
"params": {
"channel": "ticker:BTC-PERP",
"data": {
"instrument_name": "BTC-PERP",
"instrument_id": 1,
"symbol": "BTC-PERP",
"mark_price": 68295,
"mid_price": 120000,
"index_price": 67631.049159,
"best_bid_price": 119999,
"best_ask_price": 120001,
"best_bid_size": 0.001,
"best_ask_size": 0.002,
"funding_rate": 0.000012,
"volume_24h": 6319.722,
"change_24h": 341,
"open_interest": 0.093,
"max_trading_price": 70344.489513,
"min_trading_price": 66246.75226,
"premium": 0,
"last_price": 119999
}
}
}
import websocket
import json
def on_message(ws, message):
print(f"Received: {message}")
def on_open(ws):
subscribe_msg = {
"jsonrpc": "2.0",
"id": "1",
"method": "subscribe",
"params": {
"channel": "ticker",
"symbol": "BTC-PERP"
}
}
ws.send(json.dumps(subscribe_msg))
ws = websocket.WebSocketApp("wss://api.hotstuff.trade/ws",
on_message=on_message,
on_open=on_open)
ws.run_forever()
const ws = new WebSocket('wss://api.hotstuff.trade/ws');
ws.onopen = function() {
const subscribeMsg = {
"jsonrpc": "2.0",
"id": "1",
"method": "subscribe",
"params": {
"channel": "ticker",
"symbol": "BTC-PERP"
}
};
ws.send(JSON.stringify(subscribeMsg));
};
ws.onmessage = function(event) {
console.log('Received:', event.data);
};