Private websocket
Private websocket
Private websocket address
mainnet: wss://stream.deepcoin.com/v1/private
Get listenkey
HTTP Method: GET
HTTP Request: /deepcoin/listenkey/acquire
response:
{
"code": "0",
"msg": "",
"data": {
"listenkey": "a29e6d260bb2a82478abf49759cb31a9",
"expire_time": 1691403285
}
}
Extend expiration time
By sliding window, the expiration time will be extended for another hour
HTTP Method: GET
HTTP Request: /deepcoin/listenkey/extend
body listenkey="f24739a259bc1ac714dad2ac6690c816"
response:
{
"code": "0",
"msg": "",
"data": {
"listenkey": "a29e6d260bb2a82478abf49759cb31a9",
"expire_time": 1691403285
}
}
Connection Limit
Same IP limited to 300 connections per 5 minutes. Rate limited but no limit on total connection count.
Subscribe ws
wss://stream.deepcoin.com/v1/private?listenKey=404879eae0a969e199d2bc3f3766faa1
Return parameters
Currently, once the subscription is successful, fund changes, order changes, etc. will be pushed at once.
Subscribe with tables parameter
The private WebSocket supports subscribing to specific channels. Send the following message to subscribe to only the channels you need:
{"action":"subscribe","tables":["Account","AccountDetail","Order","Position","Trade","TriggerOrder"]}
If tables is not specified, all channels will be subscribed by default.
To unsubscribe from specific channels, re-subscribe with a tables array that only includes the channels you want to keep.
Tables to Channels Mapping
| tables | Channel | Description |
|---|---|---|
| Account | Asset | Account balance changes |
| AccountDetail | Account Details | Account detail changes |
| Order | Order | Order changes |
| Position | Position | Position changes |
| Trade | Trade | Trade record changes |
| TriggerOrder | Trigger Order | Trigger order changes |