Positions
wss://ws-api-futures.kucoin.com
Topic: /contract/positionAll
OR
Topic:/contract/position:XBTUSDTM
Description
1.
2.
3.
4.
5.
1.
2.
Subscribe Message
//Get all symbols position change
{
"id": 1545910660739,
"type": "subscribe",
"topic": "/contract/positionAll",
"response": true,
"privateChannel": "true"
}
//Get specific symbol position change
{
"id": 1545910660739,
"type": "subscribe",
"topic": "/contract/position:XBTUSDTM",
"response": true,
"privateChannel": "true"
}
Response
Data SchemaDeprecated, will delete later Symbol of the contract. Please refer to Get Symbol endpoint: symbol Margin Mode: CROSS, ISOLATED Whether it is cross margin. ADL ranking percentile Open time Current timestamp Current position quantity Current position value Current commission Unrealized value Unrealized profit and loss Profit-loss ratio of the position Rate of return on investment Current realized position value Accumulated realized gross profit value Accumulated realized gross profit value Realized profit and loss Opened position or not Mark price Mark Value Position value Inital margin Cross = opening value/cross leverage; isolated = accumulation of initial margin for each transaction Bankruptcy cost Cross = mark value * imr; Isolated = position margin (accumulation of initial margin, additional margin, generated funding fees, etc.) Average entry price Liquidation price: For Cross Margin, you can refer to the liquidationPrice, and the liquidation is based on the risk rate. Bankruptcy price: For Cross Margin, you can refer to the bankruptPrice, and the liquidation is based on the risk rate. Currency used to clear and settle the trades Position Side Leverage Maintenance margin requirement Maintenance margin Auto deposit margin or not Only applicable to Isolated Margin Risk limit Only applicable to Isolated Margin Leverage of the order Only applicable to Isolated Margin Added margin Only applicable to Isolated Margin Bankruptcy cost Only applicable to Isolated Margin Funding fees paid out Only applicable to Isolated Margin The current remaining unsettled funding fee for the position Only applicable to Isolated Margin Position margin Only applicable to Isolated Margin Funding time Position size Funding rate Funding fees Funding Fee Settlement Time (nanoseconds) Adjustment isolated margin risk limit level successful or not Adjustment isolated margin risk limit level failure reason
position
userId
string
required
topic
string
required
subject
string
required
type
string
required
channelType
string
required
data
object
required
symbol
string
required
Examples:
XBTUSDTMXBTUSDMETHUSDTM
marginMode
enum<string>
required
Allowed values:
CROSSISOLATED
crossMode
boolean
required
delevPercentage
number
required
openingTimestamp
integer <int64>
required
currentTimestamp
integer <int64>
required
currentQty
integer
required
currentCost
number
required
currentComm
number
required
unrealisedCost
number
required
unrealisedPnl
number
required
unrealisedPnlPcnt
number
required
unrealisedRoePcnt
number
required
realisedCost
number
required
realisedGrossCost
number
required
realisedGrossPnl
number
required
realisedPnl
number
required
isOpen
boolean
required
markPrice
number
required
markValue
number
required
posCost
number
required
posInit
number
required
posMargin
number
required
avgEntryPrice
number
required
liquidationPrice
number
required
bankruptPrice
number
required
settleCurrency
string
required
positionSide
enum<string>
required
Allowed value:
BOTH
leverage
number
required
maintMarginReq
number
optional
posMaint
number
optional
autoDeposit
boolean
optional
riskLimit
integer
optional
realLeverage
number
optional
posCross
number
optional
posComm
number
optional
posLoss
number
optional
posFunding
number
optional
maintMargin
number
optional
fundingTime
integer <int64>
optional
qty
integer
optional
fundingRate
number
optional
fundingFee
number
optional
ts
integer <int64>
optional
success
boolean
optional
msg
string
optional
Example
1. Position Changes Caused Operations
//Isolated Margin
{
"topic": "/contract/position:XBTUSDTM",
"type": "message",
"data": {
"symbol": "XBTUSDTM",
"maintMarginReq": 0.005,
"riskLimit": 500000,
"realLeverage": 4.9685590767,
"crossMode": false,
"delevPercentage": 0.10,
"openingTimestamp": 1731916913097,
"autoDeposit": true,
"currentTimestamp": 1731924561514,
"currentQty": 1,
"currentCost": 91.5306,
"currentComm": 0.09179284,
"unrealisedCost": 91.6945,
"realisedCost": -0.07210716,
"isOpen": true,
"markPrice": 91839.79,
"markValue": 91.83979,
"posCost": 91.6945,
"posCross": 0,
"posInit": 18.3389,
"posComm": 0.06602004,
"posLoss": 0,
"posMargin": 18.40492004,
"posFunding": 0,
"posMaint": 0.5634627025,
"maintMargin": 18.55021004,
"avgEntryPrice": 91694.5,
"liquidationPrice": 73853.0426625,
"bankruptPrice": 73355.6,
"settleCurrency": "USDT",
"changeReason": "positionChange",
"riskLimitLevel": 2,
"realisedGrossCost": -0.1639,
"realisedGrossPnl": 0.1639,
"realisedPnl": 0.07210716,
"unrealisedPnl": 0.14529,
"unrealisedPnlPcnt": 0.0016,
"unrealisedRoePcnt": 0.0079,
"leverage": 4.9685590767,
"marginMode": "ISOLATED",
"positionSide": "BOTH"
},
"subject": "position.change",
"userId": "633559791e1cbc0001f319bc",
"channelType": "private"
}
//Cross Margin
{
"topic": "/contract/position:XBTUSDTM",
"type": "message",
"data": {
"symbol": "XBTUSDTM",
"crossMode": true,
"delevPercentage": 0.06,
"openingTimestamp": 1717639498983,
"currentTimestamp": 1717724686618,
"currentQty": -2,
"currentCost": -136.002,
"currentComm": 0.06739824,
"unrealisedCost": -136.002,
"realisedCost": 0.06739824,
"isOpen": true,
"markPrice": 70778.04,
"markValue": -141.55608,
"posCost": -136.002,
"posInit": 5.4509819612,
"posMargin": 5.6735903779,
"avgEntryPrice": 68001,
"liquidationPrice": 80700.49720065,
"bankruptPrice": 81152.42267235,
"settleCurrency": "USDT",
"changeReason": "positionChange",
"realisedGrossCost": 0,
"realisedGrossPnl": 0,
"realisedPnl": -0.09580416,
"unrealisedPnl": -5.55408,
"unrealisedPnlPcnt": -0.0408,
"unrealisedRoePcnt": -1.0189,
"leverage": 24.95,
"marginMode": "CROSS", // CROSS,ISOLATED
"positionSide": "BOTH"
},
"subject": "position.change",
"userId": "665ec530aa70390001d22576",
"channelType": "private"
}
2. Funding Fee Settlement
{
"userId": "xbc453tg732eba53a88ggyt8c", // Deprecated, will detele later
"topic": "/contract/position:XBTUSDM",
"subject": "position.settlement",
"data": {
"fundingTime": 1551770400000, //Funding time
"qty": 100, //Position size
"markPrice": 3610.85, //Settlement price
"fundingRate": -0.002966, //Funding rate
"fundingFee": -296, //Funding fees
"ts": 1547697294838004923, //Current time (nanosecond)
"settleCurrency": "XBT" //Currency used to clear and settle the trades
}
}
3. Adjustment Isolated margin Risk Limit Level
{
"userId": "xbc453tg732eba53a88ggyt8c",
"topic": "/contract/position:ADAUSDTM",
"subject": "position.adjustRiskLimit",
"data": {
"success": true, // Successful or not
"riskLimitLevel": 1, // Current risk limit level
"msg": "" // Failure reason
}
}
Request
Query Params
token
string
required
Example:
2neAiuYvAU737TOajb2U3uT8AEZqSWYe0fBD4LoHuXJDSC7gIzJiH4kNTWhCPISWo6nDpAe7aUaaHJ4fG8oRjFgMfUI2sM4IySWHrBceFocY8pKy2REU1HwZIngtMdMrjqPnP-biofFWbNaP1cl0X1pZc2SQ-33hDH1LgNP-yg8ht7P5VWcj8iVVF8KnrZyV.ju8o70DBgQIHLwPJo2vIXA==
connectId
string
optional
Example:
121345
Modified at 2024-12-12 16:19:27