Private WebSocket streams deliver account-specific events such as order state changes, balance updates, and position changes. Unlike public streams, private connections require your API key, secret, and passphrase. The SDK handles authentication automatically when you subscribe to a private WsKey — no extra steps are needed beyond providing credentials in the constructor.Documentation Index
Fetch the complete documentation index at: https://mintlify.com/tiagosiebler/kucoin-api/llms.txt
Use this file to discover all available pages before exploring further.
Authentication Flow
When you callsubscribe() with a private WsKey (spotPrivateV1, futuresPrivateV1, or privateProV2), the SDK:
- Fetches a signed connection token from the KuCoin REST API using your credentials.
- Opens a WebSocket connection using that token in the URL (V1) or as a query parameter (V2).
- Completes any exchange-level authentication handshake automatically.
- Sends your subscription requests once the connection is ready.
Spot Private V1 Streams
Use thespotPrivateV1 WsKey for all private spot and margin topics.
Margin Private Topics
Margin topics also use thespotPrivateV1 WsKey:
Futures Private V1 Streams
Use thefuturesPrivateV1 WsKey for futures-specific private events.
V1 private topic reference
V1 private topic reference
| Topic | WsKey | Description |
|---|---|---|
/spotMarket/tradeOrders | spotPrivateV1 | Spot HF order updates |
/spotMarket/tradeOrdersV2 | spotPrivateV1 | Spot order updates (V2 format) |
/account/balance | spotPrivateV1 | Account balance changes |
/spotMarket/advancedOrders | spotPrivateV1 | Stop order triggers |
/market/match:SYMBOL | spotPrivateV1 | Your private trade fills |
/margin/position | spotPrivateV1 | Cross margin position changes |
/margin/isolatedPosition:SYMBOL | spotPrivateV1 | Isolated margin changes |
/contractMarket/tradeOrders | futuresPrivateV1 | Futures order updates (all) |
/contractMarket/tradeOrders:SYMBOL | futuresPrivateV1 | Futures order updates (single) |
/contractMarket/advancedOrders | futuresPrivateV1 | Futures stop orders |
/contractAccount/wallet | futuresPrivateV1 | Futures wallet balance |
/contract/position:SYMBOL | futuresPrivateV1 | Futures position (single) |
/contract/positionAll | futuresPrivateV1 | Futures positions (all) |
Unified Private Pro V2 Streams
TheprivateProV2 WsKey provides a single connection covering both spot and futures private events. Use structured WsTopicRequest objects and set the appropriate tradeType in the payload.
With
privateProV2, a single authenticated WebSocket connection replaces the two separate V1 private connections (spotPrivateV1 and futuresPrivateV1). This reduces overhead and simplifies connection management.Reconnection and Re-authentication
Private connections reconnect with the same automatic behaviour as public ones, with one addition: authentication is re-executed automatically after reconnect because a fresh token is fetched via the REST API. Your subscriptions are cached internally and replayed in full after every successful reconnection. Thereconnected event fires once the connection is live and topics are active again. No manual intervention is needed.