跳到主要内容

User Messages

危险

Poloniex futures v1/v2 API will be officially offline on November 30, 2024. You can access the V3 API to provide you with a better trading experience.

Private Messages

{
"type": "message",
"topic": "/contractMarket/tradeOrders",
"subject": "orderChange",
"channelType": "private",
"data": {
"orderId": "5cdfc138b21023a909e5ad55", //Order ID
"symbol": "BTCUSDTPERP", //symbol
"type": "match", // Message Type: "open", "match", "filled", "canceled", "update"
"marginType": 0, //Margin Mode 0(Isolated) 1(Cross)
"status": "open", // Order Status: "match", "open", "done"
"matchSize": "", // Match Size (when the type is "match")
"matchPrice": "",// Match Price (when the type is "match")
"orderType": "limit", // Order Type, "market" indicates market order, "limit" indicates limit order
"side": "buy", // Trading direction,include buy and sell
"price": "3600", // Order Price
"size": "20000", // Order Size
"remainSize": "20001", // Remaining Size for Trading
"filledSize":"20000", // Filled Size
"canceledSize": "0", // Cancelled Size
"tradeId": "5ce24c16b210233c36eexxxx", // Trade ID (when the type is "match")
"clientOid": "5ce24c16b210233c36ee321d", // clientOid
"orderTime": 1545914149935808589, // Order Time
"oldSize ": "15000", // Size Before Update (when the type is "update")
"liquidity": "maker", // Trading direction, buy or sell in taker
"ts": 1545914149935808589 // Timestamp
}
}

Order Status

  • match: when the taker order executes with orders in the order book, the taker order status is “match”;
  • open: the order is in the order book;
  • done: the order is fully executed successfully;

Message Type

  • open: when the order enters into the order book;
  • match: when the order has been executed;
  • filled: when the order has been executed and its status was changed into DONE;
  • canceled: when the order has been cancelled and its status was changed into DONE;
  • update: when the order has been updated;

Stop Order Lifecycle Event

Topic: /contractMarket/advancedOrders

  {
"topic": "/contractMarket/advancedOrders",
"subject": "stopOrder",
"channelType": "private",
"data": {
"orderId": "5cdfc138b21023a909e5ad55", //Order ID
"symbol": "BTCUSDTPERP", //Ticker symbol of the contract
"type": "open", // Message type: open (place order), triggered (order triggered), cancel (cancel order)
"marginType": 0, //Margin Mode 0(Isolated) 1(Cross)
"orderType":"stop", // Order type: stop order
"side":"buy", // Buy or sell
"size":"1000", //Quantity
"orderPrice":"9000", //Order price. For market orders, the value is null
"stop":"up", //Stop order types
"stopPrice":"9100", //Trigger price of stop orders
"stopPriceType":"TP", //Trigger price type of stop orders
"triggerSuccess": true, //Mark to show whether the order is triggered. Only for triggered type of orders
"error": "error.createOrder.accountBalanceInsufficient", //error code, which is used only when the trigger of the triggered type of orders fails
"createdAt": 1558074652423, //Time the order created
"ts":1558074652423004000 // timestamp - nanosecond
}
}

Account Balance Events

Topic: /contractAccount/wallet

Order Margin Event

  //Order Margin Event
{
"topic": "/contractAccount/wallet",
"subject": "orderMargin.change",
"channelType": "private",
"data": {
"orderMargin": 5923,//Current order margin
"currency":"USDT",//Currency
"timestamp": 1553842862614
}
}

Available Balance Event

//Available Balance Event
{
"topic": "/contractAccount/wallet",
"subject": "availableBalance.change",
"channelType": "private",
"data": {
"availableBalance": 5923, //Current available amount
"currency":"USDT",//Currency
"timestamp": 1553842862614
}
}

Position Change Events

Topic: /contract/position:{symbol}

Position Changes Caused Operations

  //Position Changes Caused Operations
{
"topic": "/contract/position:BTCUSDTPERP",
"subject": "position.change",
"channelType": "private",
"data": {
"realisedGrossPnl": 0E-8, //Accumulated realised profit and loss
"marginType": 0, //Margin Mode 0(Isolated) 1(Cross)
"liquidationPrice": 1000000.0, //Liquidation price
"posLoss": 0E-8, //Deprecated,Manually added margin amount
"avgEntryPrice": 7508.22, //Average entry price
"unrealisedPnl": -0.00014735, //Unrealised profit and loss
"markPrice": 7947.83, //Mark price
"posMargin": 0.00266779, //Position margin
"riskLimit": 200, //Risk limit
"unrealisedCost": 0.00266375, //Deprecated,Unrealised value
"posComm": 0.00000392, //Deprecated,Bankruptcy cost
"posMaint": 0.00001724, //Maintenance margin
"posCost": 0.00266375, //Position value
"maintMarginReq": 0.005, //Maintenance margin rate
"bankruptPrice": 1000000.0, //Bankruptcy price
"realisedCost": 0.00000271, //Deprecated,Currently accumulated realised position value
"markValue": 0.00251640, //Mark value
"posInit": 0.00266375, //Position margin
"realisedPnl": -0.00000253, //Realised profit-losts of the position
"maintMargin": 0.00252044, //Position margin
"realLeverage": 1.06, //Leverage of the order
"currentCost": 0.00266375, //Deprecated,Current position value
"openingTimestamp": 1558433191000, //Open time
"currentQty": -20, //Current position
"delevPercentage": 0.52, //ADL ranking percentile
"currentComm": 0.00000271, //Deprecated,Current commission
"realisedGrossCost": 0E-8, //Accumulated reliased gross profit value
"isOpen": true, //Opened position or not
"posCross": 1.2E-7, //Manually added margin
"currentTimestamp": 1558506060394, //Current timestamp
"unrealisedRoePcnt": -0.0553, //Rate of return on investment
"unrealisedPnlPcnt": -0.0553, //Position profit and loss ratio
"settleCurrency": "XBT" //Currency used to clear and settle the trades
}
}

Position Changes Caused by Mark Price

  //Position Changes Caused by Mark Price
{
"topic": "/contract/position:BTCUSDTPERP",
"subject": "position.change",
"channelType": "private",
"data": {
"marginType": 0, //Margin Mode 0(Isolated) 1(Cross)
"markPrice": 7947.83, //Mark price
"markValue": 0.00251640, //Mark value
"maintMargin": 0.00252044, //Position margin
"realLeverage": 10.06, //Leverage of the order
"unrealisedPnl": -0.00014735, //Unrealised profit and lost
"unrealisedRoePcnt": -0.0553, //Rate of return on investment
"unrealisedPnlPcnt": -0.0553, //Position profit and loss ratio
"delevPercentage": 0.52, //ADL ranking percentile
"currentTimestamp": 1558087175068, //Current timestamp
"settleCurrency": "XBT" //Currency used to clear and settle the trades
}
}

Funding Settlement

  //Funding Settlement
{
"topic": "/contract/position:BTCUSDTPERP",
"subject": "position.settlement",
"channelType": "private",
"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
}
}

Cross Position Information

  {
"topic": "/contract/positionCross",
"subject": "positionCross.change",
"channelType": "private",
"data": {
"maintainMargin" : 100.99, //Maintenance margin
"marginAvailable" : 30.98, //Position margin
"maintainRate" : 0.38, //Margin rate
"unreleaseSum" : 1.5, //Unrealised profit and lost
"fundingSum" : -0.3, //Funding fees profit and loss
"accountAvailable" : 100.1 //Cross balance
}
}