User data stream.
Response
Orders data:
{
"channel":"Orders",
"instId":"BINANCE_PERP_ETH_USDT",
"data":{
"portfolioId":"1702884522340000",
"orderId":"1703213979730000",
"clientOrderId":"1703213979730000",
"exchangeType":"BINANCE",
"businessType":"PERP",
"sym":"BINANCE_PERP_ETH_USDT",
"limitPrice":"2346",
"orderQty":"0.01",
"quoteOrderQty":"0",
"side":"BUY",
"exchangeOrderType":"LIMIT",
"orderType": "DMA",
"timeInForce":"GTC",
"executedQty":"0",
"executedAmount":"0",
"executedAvgPrice":"0",
"lastExecutedQty":"0",
"lastExecutedPrice":"0",
"lastExecutedAmount":"0",
"fee":"10",
"feeCoin":"USDT",
"rebate":"0.1",
"rebateCoin":"USDT",
"orderState":"NEW",
"updateAt":"1703213979731",
"createAt":"1703213979731",
"borrowAmount":"0",
"borrowAsset":null,
"reason":"",
"leverage":"1",
"action": "",
"actionMsg": "",
"cancelType": "",
"amendType": ""
}
}
| Field | Type | remark |
|---|---|---|
| channel | String | Channel name:Orders |
| instId | String | Trading unique identifier, example: BINANCE_SPOT_BTC_USDT, BINANCE_PERP_BTC_USDT If you want to know other trading unique identifiers, please go to the introduction page. |
| data | Array | Data |
| >portfolioId | String | Portfolio ID |
| >orderId | String | Order ID |
| >clientOrderId | String | Customer defined order ID |
| >exchangeType | String | Exchange type(BINANCE, OKX) |
| >businessType | String | Business type(SPOT, PERP) |
| >sym | String | Trading unique identifier, example: BINANCE_SPOT_BTC_USDT, BINANCE_PERP_BTC_USDT If you want to know other trading unique identifiers, please go to the introduction page. |
| >limitPrice | String | Order price |
| >orderQty | String | Order quantity, note: trading unit of OKX is the number of contracts/ trading unit of Binance is the number of coin Note: The trading unit on OKX is measured in the number of contracts, while the trading unit on Binance is measured in the number of coins. |
| >quoteOrderQty | String | Order quote quantity, applicable only for spot market buy orders. |
| >side | String | Side(BUY,SELL) |
| >exchangeOrderType | String | Exchange order type(LIMIT, MARKET) |
| >orderType | String | Please see ENUM Definitions for supported values. |
| >timeInForce | String | Default GTC, enums:GTC,IOC,FOK,GTX |
| >executedQty | String | Transaction quantity Note: The trading unit on OKX is measured in the number of contracts, while the trading unit on Binance is measured in the number of coins. |
| >executedAmount | String | Transaction amount |
| >executedAvgPrice | String | Average transaction price |
| >lastExecutedQty | String | Last transaction quantity |
| >lastExecutedPrice | String | Last transaction price |
| >lastExecutedAmount | String | Last transaction amount |
| >fee | String | Transaction fee amount |
| >feeCoin | String | Transaction fee coin |
| >rebate | String | Rabate amount |
| >rebateCoin | String | Rebate coin |
| >orderState | String | Please see ENUM Definitions for supported values. |
| >updateAt | String | Update time |
| >createAt | String | Create time |
| >reason | String | Fail reason |
| >borrowAmount | String | Borrow amount |
| >borrowAsset | String | Borrow asset |
| >leverage | String | Order leverage |
| >positionSide | String | Position side |
| >action | String | AMEND_PENDING AMEND_COMPLETED AMEND_FAILED CANCEL_PENDING CANCEL_COMPLETE CANCEL_FAILED |
| >actionMsg | String | action msg |
| >cancelType | String | USER EXPIRE REDUCE_ONLY LIQUIDATING SYSTEM SYM_DELIST |
| >amendType | String | USER REDUCE_ONLY |
Trades data:
{
"channel":"Trades",
"instId":"OKX_PERP_BTC_USDT",
"data":{
"transactionId":"1703832204600001",
"portfolioId":"1702884522340000",
"orderId":"1703832204506000",
"clientOrderId":"1000981",
"sym":"OKX_PERP_BTC_USDT",
"exchangeType":"OKX",
"businessType":"PERP",
"price":"42703.4",
"quantity":"1",
"tradingFee":"0.0640551",
"tradingFeeCoin":"USDT",
"side":"SELL",
"createAt":"1703832204600",
"execType":"TAKER",
"rpnl":"101"
}
}
| Field | Type | remark |
|---|---|---|
| channel | String | Channel name:Trades |
| instId | String | Trading pair unique identifier, example: BINANCE_SPOT_BTC_USDT, BINANCE_PERP_BTC_USDT |
| data | Array | Data |
| >transactionId | String | Transaction ID |
| >portfolioId | String | Portfolio ID |
| >orderId | String | Order ID |
| >clientOrderId | String | Customer defined order ID |
| >sym | String | Trading unique identifier, example: BINANCE_SPOT_BTC_USDT, BINANCE_PERP_BTC_USDT |
| >exchangeType | String | Exchange type (example: BINANCE,OKX) |
| >businessType | String | Business type |
| >price | String | Filled price |
| >quantity | String | Filled quantity, note: trading unit of OKX is the number of contracts/ trading unit of Binance is the number of coin |
| >tradingFee | String | Trading fee |
| >tradingFeeCoin | String | Trading fee coin |
| >side | String | Side(BUY,SELL) |
| >createAt | String | Execution time |
| >execType | String | TAKER or MAKER |
| >rpnl | String | Realized PNL |
Asset data:
{
"channel": "Assets",
"data": [{
"portfolioId": "1711075287090000",
"coin": "USDT",
"exchangeType": "OKX",
"businessType": "UNI",
"balance": "99.012100925",
"equity": "99.012100925",
"available": "99.012100925",
"frozen": "0",
"overdraw": "0",
"marginValue": "96.536798401875",
"debt": "0",
"virtualBorrow": "0",
"debtMargin": "0",
"perpMargin": "0",
"maxTransferable": "0",
"equityValue": "0",
"borrow": "0",
"upnl":"0",
"updateAt": "1711955466958"
}]
}
| Field | Type | remark |
|---|---|---|
| channel | String | Channel name:Assets |
| data | Array | Data |
| >portfolioId | String | Portfolio ID |
| >coin | String | Coin |
| >exchangeType | String | Exchange type(example: BINANCE, OKX) |
| >businessType | String | UNI |
| >balance | String | Transferable amount |
| >equity | String | Equity |
| >available | String | Available |
| >frozen | String | Frozen |
| >overdraw | String | OverDraw |
| >debt | String | Debt |
| >marginValue | String | Margin value |
| >virtualBorrow | String | Virtual Borrow |
| >debtMargin | String | Debt Margin |
| >perpMargin | String | Perp Margin |
| >maxTransferable | String | Maximum transfer amount |
| >equityValue | String | Equity value |
| >borrow | String | Borrow |
| >upnl | String | Unrealized Profit and Loss |
| >updateAt | String | Update time |
Positon data:
{
"channel":"Positions",
"instId":"OKX_PERP_BTC_USDT",
"data":{
"portfolioId":"1702884522340000",
"positionId":"1704179813908000",
"sym":"OKX_PERP_BTC_USDT",
"positionSide":"NET",
"positionMargin":"226.586",
"positionMM":"4.53172",
"positionQty":"1",
"positionValue":"453.172",
"entryValue":"453.194",
"unrealizedPNL":"-0.022",
"unrealizedPNLRate":"-0.000097088664015851",
"avgPrice":"45319.4",
"markPrice":"45317.2",
"leverage":"2",
"maxLeverage":"20",
"riskLevel":"1",
"fee":"0.0679791",
"fundingFee":"0",
"liqPrice":"1.1",
"createAt":"1704179813908",
"updateAt":"1704179813908"
}
}
| Field | Type | remark |
|---|---|---|
| channel | String | Channel name:Positions |
| data | Array | Data |
| >portfolioId | String | Portfolio ID |
| >positionId | String | Position ID |
| >sym | String | Trading unique identifier, example: BINANCE_PERP_BTC_USDT |
| >positionSide | String | NET |
| >positionMargin | String | Position margin |
| >positionMM | String | Position maintain margin |
| >positionQty | String | Position quantity, note: trading unit of OKX is the number of contracts/ trading unit of Binance is the number of coin |
| >positionValue | String | Position value |
| >entryValue | String | Position init value |
| >unrealizedPNL | String | Unrealized PNL |
| >unrealizedPNLRate | String | Unrealized PNL rate |
| >avgPrice | String | Average price |
| >markPrice | String | Mark price |
| >leverage | String | Leverage |
| >maxLeverage | String | Max leverage |
| >riskLevel | String | Risk level |
| >fee | String | Trading fee |
| >fundingFee | String | Funding fee |
| >liqPrice | String | Estimated liquidation price of position. If the data is null, it means there will be no forced liquidation |
| >createAt | String | Create time |
| >updateAt | String | Update time |
MarginCall data:
{
"channel":"MarginCall",
"data":{
"portfolioId":"1702884522340000",
"exchangeType":"OKX",
"margin":"141.598333333333333333",
"maintainMargin":"4.24795",
"uniMMR":"-0.220583246036323403",
"accountStatus":"LIQUIDATED",
"updateAt":"1703834254274"
}
}
| Field | Type | remark |
|---|---|---|
| channel | String | Channel name:MarginCall |
| data | Array | Data |
| >portfolioId | String | Portfolio ID |
| >exchangeType | String | BINANCE, OKX |
| >margin | String | Margin |
| >maintainMargin | String | Maintain margin |
| >uniMMR | String | uniMMR |
| >accountStatus | String | Account status |
| >updateAt | String | Update time |
