Subscribe to contract push

Access Instructions

WebSocket Domain Name

wss://wss-ct.hotcoin.fit

Subscription Topic

After successfully establishing a connection with the Websocket server, the Websocket client sends a subscribe request to subscribe to a specific topic:

Request

{
    "event": "subscribe",   
    "params": {
        "biz": "perpetual",	    //Fixed Parameters
        "type": "topic to subscribe",   //topic type
        "contractCode": "contractCode",	//contract code
        "zip": false,						
      	"serialize": false		
    }
}
Parameter Description
Name Required Type Description Default Value Value Range
biz y string Business   perpetual
type y string type   depth
contractCode y string contract code    
zip N boolean Compression false  
serialize N boolean serialize false  

After successfully subscribing, the Websocket client will receive a confirmation message:

Response

{
    "biz": "perpetual",
    "data": {
        "result": true
    },
    "channel": "subscribe",
    "type": "fund_rate",
    "env": 0,
    "contractCode": "btcusdt"
}
Subscription Result
  • Description of the "data" Object
Type Field Name Description
boolean result Subscription Result(true: Success, false: Failure)



Afterwards, whenever there is an update to the subscribed topic, the HotCoin server will push the updated message to the Websocket client.

Maintenance

After the user's Websocket client connects to the Hot Coin server, the user needs to regularly send heartbeat messages to the server. Otherwise, after 5 minutes, the user will not receive any pushes, as follows:

Request

{
    "event": "ping"
}
  • Parameter Description
Type Field Name Description
String event ping

After successfully sending, the Websocket client will receive a confirmation message as follows:

Response

{
    "event": "pong"
}
  • Response Result
Type Field Name Description
String event pong:Success

Unsubscribe

Request

{
    "event": "unsubscribe",
    "params": {
        "biz": "perpetual",
        "type": "topic to subscribe",
        "contractCode": "contractCode",
        "zip": false,
      	"serialize": false
    }
}
Unsubscribe Result Description
Name Required Type Description Default Value Value Range
biz y string Business   perpetual
type y string type   depth
contractCode y string contract code    
zip N boolean Compress or Not false  
serialize N boolean Serialize or Not false  

Response

{
    "biz": "perpetual",
    "data": {
        "result": true
    },
    "channel": "unsubscribe",
    "type": "fund_rate",
    "contractCode": "ethusdt",
    "env": 0
}
Unsubscribe Success Confirmation
Type Field Name Description
boolean result Subscription Result(true: Success, false: Failure)






PING

Request

{
    "event": "ping"
}

Parameter Description

Type Field Name Description
String event ping

Response

{
    "event": "pong"
}

Response Result

Type Field Name Description
String event pong:Success

ws Login In

example

Request

{
    "event": "signin",
    "params": {
        "apiKey": "xxx",
        "timestamp": "1593683685313",
        "signature": "xxx"
    }
}

Parameter Description

Name Required Type Description Default Value Value Range
apiKey y string Access Key    
signature y string sign, you can refer to the example of signature for the way of signing.    
timestamp y string timestamp    

Response

{
    "data": {
        "result": true
    },
    "channel": "signin"
}

Response Result

  • Description of the "data" Object
Type Field Name Description
boolean result Login Result: (true: Success, false: Failure)
String error_msg Error Message (An error message will be returned in case of failed login)
String error_code Error Code (An error code will be returned in case of failed login)

ws Depth

example

Request

{
    "event": "subscribe",
    "params": {
        "biz": "perpetual",
        "type": "depth",
        "contractCode": "ethusdt",
        "zip": false,
      	"serialize": false
    }
}

Parameter Description

Name Required Type Description Default Value Value Range
biz y string Business   perpetual
type y string type   depth
contractCode y string contract code    
zip N boolean Compress or Not false  
serialize N boolean Serialize or Not false  

Response

{
    "biz": "perpetual",
    "data": {
        "result": true
    },
    "channel": "subscribe",
    "type": "depth",
    "contractCode": "ethusdt"
}

Subscription Result

  • Description of the "data" Object
Type Field Name Description
boolean result Subscription Result(true: Success, false: Failure)





Response

{
  "biz": "perpetual",
  "data": {
    "asks": [
      [
        "250.00000",
        "94",
        "94"
      ]
    ],
    "bids": [
      [
        "216.01000",
        "5319",
        "5319"
      ]
    ]
  },
  "granularity": "1",
  "type": "depth",
  "env": 0,
  "contractCode": "LTCUSDT",
  "timestamp": 1712798513490
}

Push Result

  • Description of the "data" Object
Type Field Name Description
String[] asks Sorted Array of Selling Orders: [Price, Quantity, Total Quantity]
String[] bids Sorted Array of Buying Orders: [Price, Quantity, Total Quantity]















ws K Line candles

example

Request

{
    "event": "subscribe",
    "params": {
        "biz": "perpetual",
        "type": "candles",
        "contractCode": "ethusdt",
        "granularity": "1min",
        "zip": false,
      	"serialize": false
    }
}

Parameter Description

Name Required Type Description Default Value Value Range
biz y string Business   perpetual
type y string type   mark_candles-Indexed Marked Price Candlestick Chart,candles-Latest Price Candlestick Chart
contractCode y string contract code    
granularity y string granularity   1min,3min,5min,15min,30min,1hour,2hour,4hour,6hour,12hour,day,week
zip N boolean Compress or Not false  
serialize N boolean Serialize or Not false  

Response

    {
      "biz": "perpetual",
      "data": {
        "result": true
      },
      "granularity": "1min",
      "channel": "subscribe",
      "type": "candles",
      "env": 0,
      "contractCode": "BTCUSDT"
    }

Subscription Result

  • Description of the "data" Object
Type Field Name Description
boolean result login in result(true: Success, false: Failure)





Push Result

Response

    {
      "biz": "perpetual",
      "data": [
        [
          1712803200000,
          "70872.27",
          "70918.11",
          "70872.27",
          "70895.61",
          "6058",
          "429456.52294"
        ]
      ],
      "granularity": "1min",
      "type": "candles",
      "env": 0,
      "contractCode": "btcusdt",
      "timestamp": 1712803237414
    }
  • Description of the "data" Object(Latest Price Candlestick Chart)
Type Field Name Description
String[] data Sorted Array of Data: [0] Time, [1] Lowest Price, [2] Highest Price, [3] Opening Price, [4] Closing Price, [5] Volume, [6] Transaction Value












Response


{
  "biz": "perpetual",
  "data": [
                  [
                    1712803200000,
                    "70872.27",
                    "70918.11",
                    "70872.27",
                    "70895.61",
                    "6058",
                    "429456.52294",
                    "70895.61",
                    "6058",
                    "429456.52294"
                  ]
                ],
  "type": "mark_candles",
  "contractCode": "ethusdt",
  "granularity": "1min",
  "env": 0,
  "timestamp": 1712803237414
}
  • Description of the "data" Object(Indexed Marked Price Candlestick Chart)
Type Field Name Description
String[] data Sorted Array of Data: [0] Millisecond Timestamp, [1] Indexed Low Price, [2] Indexed High Price, [3] Indexed Opening Price, [4] Indexed Closing Price, [5] Marked Low Price, [6] Marked High Price, [7] Marked Opening Price, [8] Marked Closing Price














ws One Trading Pairs of Cryptocurrency Markets

example

Request

{
  "event": "subscribe",
  "params": {
    "serialize": false,
    "biz": "perpetual",
    "type": "ticker",
    "contractCode": "btcusdt"
  }
}

Parameter Description

Name Required Type Description Default Value Value Range
biz y string Business   perpetual
type y string type   tickers
contractCode y string contract code    
zip N boolean Compress or Not false  
serialize N boolean Serialize or Not false  



Response

{
      "biz": "perpetual",
      "data": {
        "result": true
      },
      "channel": "subscribe",
      "type": "ticker",
      "contractCode": "btcusdt",
      "env": 0
}

Subscription Result

  • Description of the "data" Object
Type Field Name Description
boolean result Subscription Result(true: Success, false: Failure)





Response

{
  "biz": "perpetual",
  "data": [
    [
      1712800975802,
      "99999.00",
      "60000.00",
      "15021528",
      "1042275165",
      "69539.35",
      "70615.76",
      1065,
      "1.55",
      "70598.22",
      "70607.15",
      "btcusdt",
      "508041.27",
      0
    ]
  ],
  "type": "ticker",
  "env": 0,
  "contractCode": "btcusdt",
  "timestamp": 1712800977406
}

Push Result

  • Description of the "data" Object
Type Field Name Description
String[] data Sorted Array of Data: [0] Data Timestamp, [1] Highest Price, [2] Lowest Price, [3] Transaction Quantity, [4] Transaction Value, [5] Opening Price, [6] Latest Price, [7] 24-Hour Price Change, [8] 24-Hour Price Change Rate, [9] Bid Price Level 1, [10] Ask Price Level 1, [11] Contract Code, [12] Latest Price Converted to CNY, [13] Is Test Coin











ws All Trading Pairs of Cryptocurrency Markets

example

Request

{
    "event": "subscribe",
    "params": {
        "biz": "perpetual",
        "type": "tickers",
        "zip": false,
      	"serialize": false
    }
}

Parameter Description

Name Required Type Description Default Value Value Range
biz y string Business   perpetual
type y string type   tickers
zip N boolean Compress or Not false  
serialize N boolean Serialize or Not false  



Response

{
      "biz": "perpetual",
      "data": {
        "result": true
      },
      "granularity": "1",
      "channel": "subscribe",
      "type": "tickers",
      "env": 0
}

Subscription Result

  • Description of the "data" Object
Type Field Name Description
boolean result Subscription Result(true: Success, false: Failure)





Response

{
      "biz": "perpetual",
      "data": [
        [
          1712762705687,
          "99999.00",
          "60000.00",
          "15179004",
          "1048002762",
          "69191.55",
          "68444.85",
          "-746",
          "-0.3",
          "68444.39",
          "68445.31",
          "btcusdt",
          "491432.98",
          0
        ]
      ],
      "type": "tickers",
      "env": 0,
      "timestamp": 1712762707373
}

Push Result

  • Description of the "data" Object
Type Field Name Description
String[] data Sorted Array of Data: [0] Data Timestamp, [1] Highest Price, [2] Lowest Price, [3] Transaction Quantity, [4] Transaction Value, [5] Opening Price, [6] Latest Price, [7] 24-Hour Price Change, [8] 24-Hour Price Change Rate, [9] Bid Price Level 1, [10] Ask Price Level 1, [11] Contract Code, [12] Latest Price Converted to CNY, [13] Is Test Coin











ws Funding Rate and Fair Price for Individual Trading Pair

example

Request

{
    "event": "subscribe",
    "params": {
        "biz": "perpetual",
        "type": "fund_rate",
        "zip": false,
        "contractCode": "ethusdt",
        "serialize": true
    }
}

Parameter Description

Name Required Type Description Default Value Value Range
biz y string Business   perpetual
type y string type   fund_rate
contractCode y string contract code    
zip N boolean Compress or Not false  
serialize N boolean Serialize or Not false  


Response

{
    "biz": "perpetual",
    "data": {
        "result": true
    },
    "channel": "subscribe",
    "type": "fund_rate",
  	"contractCode": "btcusdt",
}

Subscription Result

  • Description of the "data" Object
Type Field Name Description
boolean result Subscription Result(true: Success, false: Failure)




Response

{
    "biz": "perpetual",
    "data": [],
    "type": "fund_rate",
    "env": 0,
    "contractCode": "btcusdt"
}

Push Result

  • Description of the "data" Object
Type Field Name Description
String[] data Sorted Array of Data: [0] Contract Code, [1] Marked Price, [2] Indexed Price, [3] Funding Rate, [4] Estimated Funding Rate, [5] Next Settlement Time, [6] Current Open Interest, [7] Indexed Price Converted to CNY, [8] Marked Price Converted to CNY, [9] ENV, [10] Base Currency, [11] Quote Currency, [12] Settlement Currency, [13] Base Currency Display Name, [14] Quote Currency Display Name, [15] Settlement Currency Display Name

ws Funding Rates and Fair Prices for All Cryptocurrency Pairs

example

Request

{
    "event": "subscribe",
    "params": {
        "biz": "perpetual",
        "type": "fund_rates",
        "zip": false,
        "serialize": true
    }
}

Parameter Description

Name Required Type Description Default Value Value Range
biz y string Business   perpetual
type y string type   fund_rates
zip N boolean Compress or Not false  
serialize N boolean Serialize or Not false  


Response

{
    "biz": "perpetual",
    "data": {
        "result": true
    },
    "channel": "subscribe",
    "type": "fund_rates",
}

Subscription Result

  • Description of the "data" Object
Type Field Name Description
boolean result Subscription Result(true: Success, false: Failure)



Push Result

Response

{
    "biz": "perpetual",
    "data": [
        []
    ],
    "type": "fund_rates",
    "env": 1
}

Push Result

  • Description of the "data" Object
Type Field Name Description
String[] data Ordered Data Array: [0] Contract Code, [1] Marked Price, [2] Indexed Price, [3] Funding Rate, [4] Estimated Funding Rate, [5] Next Settlement Time, [6] Current Open Interest, [7] Indexed Price Converted to CNY, [8] Marked Price Converted to CNY, [9] ENV, [10] Base Currency, [11] Quote Currency, [12] Settlement Currency, [13] Base Currency Display Name, [14] Quote Currency Display Name, [15] Settlement Currency Display Name

ws New Fills

example

Request

{
    "event": "subscribe",
    "params": {
        "biz": "perpetual",
        "type": "fills",
        "contractCode": "btcusdt",
        "zip": false,
        "serialize": true
    }
}

Parameter Description

Name Required Type Description Default Value Value Range
biz y string Business   perpetual
type y string type   fills
contractCode y string contract code    
zip N boolean Compress or Not false  
serialize N boolean Serialize or Not false  


Response

{
    "biz": "perpetual",
    "data": {
        "result": true
    },
    "channel": "subscribe",
    "type": "fills",
  	"contractCode": "btcusdt"
}

Subscription Result

  • Description of the "data" Object
Type Field Name Description
boolean result Subscription Result(true: Success, false: Failure)




Response

{
      "biz": "perpetual",
      "data": [
        [
          "70495.35",
          "33",
          "short",
          1712814248594,
          0
        ],
        [
          "70495.35",
          "15",
          "short",
          1712814248594,
          0
        ]
      ],
      "type": "fills",
      "env": 0,
      "contractCode": "btcusdt",
      "timestamp": 1712814248602
}

Push Result

  • Description of the "data" Object
Type Field Name Description
String[] data Ordered Data Array: [0] Price, [1] Quantity, [2] Direction,[3]timestamp,[4]id















ws User Assets(need to log in)

example

Request

{
    "event": "subscribe",
    "params": {
        "biz": "perpetual",
        "type": "assets",
        "zip": false,
        "serialize": false
    }
}

Parameter Description

Name Required Type Description Default Value Value Range
biz y string Business   perpetual
type y string type   assets
zip N boolean Compress or Not false  
serialize N boolean Serialize or Not false  


Response

{
    "biz": "perpetual",
    "data": {
        "result": true
    },
    "channel": "subscribe",
    "type": "assets"
}

Subscription Result

  • Description of the "data" Object
Type Field Name Description
boolean result Subscription Result(true: Success, false: Failure)





Response

{
    "biz": "perpetual",
    "data": {
        "totalCnyAccountRights": "3283806187.35",
        "totalBtcUnRealizedSurplus": "0",
        "data": [
            {
                "cnPrice": "7451165.96",
                "appLogo": "https://hotcoin-hk-static.oss-accelerate.aliyuncs.com/hotcoin/upload/coin/a417aec2fc85428aafed802649e227caUSDT.png",
                "fee": "0.000000",
                "orderFee": "0.001674",
                "realAvailableBalance": "1000156.504790",
                "realizedSurplus": "4.014119",
                "availableBalance": "1000156.504790",
                "positionAccountRights": "1000156.635250",
                "maintenanceMargin": "0.000000",
                "price": "1000156.50479026",
                "realPositionAccountRights": "0.000000",
                "currencyCodeDisplayName": "USDT",
                "unRealizedSurplusBtcValue": "0.000000",
                "unRealizedSurplusValue": "0.000000",
                "accountRightsValue": "1000156.635250",
                "openMargin": "0.000000",
                "frozenBalance": "0.000000",
                "sort": 1,
                "env": 0,
                "accountRightsBtcValue": "47.215127",
                "accountRightsCnValue": "7451166.93",
                "decimalPlaces": 6,
                "currentOrderMargin": "0.130460",
                "webLogo": "https://hotcoin-hk-static.oss-accelerate.aliyuncs.com/hotcoin/upload/coin/a417aec2fc85428aafed802649e227caUSDT.png",
                "unRealizedSurplus": "0.000000",
                "orderMargin": "0.130460",
                "positionMargin": "0.000000",
                "currencyCode": "USDT",
                "availableMargin": "0.000000",
                "btcValue": "47.21512161"
            }
        ],
        "totalBtcAccountRights": "20808.19422358",
        "totalBtcAvaliableMargins": "20808.19421819",
        "userId": 10061
    },
    "type": "assets",
    "env": 0
}

Push Result

Push Result

  • Description of the "data" Object
Type Field Name Description
string totalCnyAccountRights Total Account Equity in CNY
string totalBtcUnRealizedSurplus Total unrealized profit and loss in BTC
string totalBtcAccountRights Total available margin in BTC
string userId user ID
object data Asset Information Array
string –cnPrice Price in Chinese Yuan
string –appLogo app logo
string –fee fee
string –orderFee order Fee
string –realAvailableBalance real Available Balance
string –realizedSurplus realized Surplus
string –availableBalance available Balance
string –positionAccountRights Position Account Equity (Calculated Based on User's Positions)
string –maintenanceMargin maintenance Margin
string –price Price (in USD, using the Indexed Price)
string –realPositionAccountRights Real Position Account Equity (Using Available Balance)
string –currencyCodeDisplayName currency Code Display Name
string –unRealizedSurplusBtcValue unRealized Surplus Btc Value(btc)
string –unRealizedSurplusValue unRealized Surplus Value(USDT)
string –accountRightsValue account Rights Value(USDT)
string –openMargin Initial Margin for Opening Positions
string –frozenBalance frozen Balance
string –sort sort
string –env env
string –accountRightsBtcValue account Rights Value(btc)
string –accountRightsCnValue account Rights Value(cn)
string –decimalPlaces decimal Places
string –currentOrderMargin current Order Margin
string –webLogo web logo
string –unRealizedSurplus unRealized Surplus
string –orderMargin order Margin
string –positionMargin position Margin
string –currencyCode currency Code
string –availableMargin available Margin
string –btcValue btc Valuation

ws User Order(need to log in)

example

Request

{
    "event": "subscribe",
    "params": {
        "biz": "perpetual",
        "type": "orders",
        "zip": false,
      	"serialize": false
    }
}

Parameter Description

Name Required Type Description Default Value Value Range
biz y string Business   perpetual
type y string type   orders-Regular Order,condition_orders-Conditional Order
zip N boolean Compress or Not false  
serialize N boolean Serialize or Not false  

Response

{
    "biz": "perpetual",
    "data": {
        "result": true
    },
    "channel": "subscribe",
    "type": "orders"
}

Subscription Result

  • Description of the "data" Object
Type Field Name Description
boolean result Subscription Result(true: Success, false: Failure)





Request

{
    "biz": "perpetual",
    "data": {
        "reason": 0,
        "orderType": 0,
        "extraMargin": "0",
        "positionType": 1,
        "avgPrice": "0.00000000",
        "marginDigit": 4,
        "orderSize": "2.5651281",
        "fee": "0.000000",
        "dualPosition": 0,
        "quoteDisplayName": "USDT",
        "quote": "usdt",
        "baseDisplayName": "USDT",
        "price": "0.22000000",
        "indexBase": "bat",
        "marketPriceDigit": 8,
        "contractCodeDisplayName": "BATUSDT",
        "systemType": 10,
        "id": 157016654939648,
        "profit": "0.000000",
        "side": "long",
        "amount": "1",
        "modifyDate": 1668072577089,
        "dealAmount": "0",
        "openMargin": "0.128256",
        "contractDirection": 0,
        "dealSize": "0",
        "lever": 20,
        "avgMargin": "0.128256",
        "userId": 10061,
        "mustMaker": 0,
        "indexBaseDisplayName": "BAT",
        "detailSide": "open_long",
        "createdDate": 1668072577089,
        "reduceOnly": 0,
        "unitAmount": "10",
        "contractCode": "batusdt",
        "clazz": 0,
        "base": "usdt",
        "status": 0
    },
    "type": "orders",
    "env": 0
}

Push Result

  • Description of the "data" Object
Type Field Name Description
int id Order ID
string contractCode  
int contractDirection Contract Direction: 0 Long, 1 Short
string base Base Currency Name
string quote Quote Currency Name
int userId  
string side Position Direction: long / short
string detailSide 1.open_long 2.open_short 3.close_long 4.close_short
int clazz 0: Place Order, 1: Cancel Order
int mustMaker Passive Order: 0: Don't Care, 1: Only Act as Maker, Cancel If It Becomes a Taker
string amount Order Quantity
string price User Order Price for Limit Order or Bankruptcy Price
string avgPrice Average Execution Price
string dealAmount Filled Quantity
string orderSize  
string dealSize  
string openMargin  
string extraMargin  
string avgMargin Margin Per Contract
int systemType 10: Limit Order, 11: Market Order, 13: Force Liquidation Order, 14: Margin Call Order
string profit Positive values indicate profit, negative values indicate loss
string fee Positive values indicate earning of fees, negative values indicate payment of fees
int reason Reason for Order Cancellation: 0 is the default value, indicating no specific reason for cancellation
int createdDate  
string triggerPrice  
string indexBase index Base,BTC、ETH
int direction Trigger Direction
int stopLimitType 0 - Stop Loss, 1 - Take Profit, 2 - Plan
int lever  
int orderPriceType opponent/optimal_20/optimal_10/optimal_5
string triggerBy Trigger Type: Indexed Price, Mark Price, Last Price
int refConditionOrderId  
int marginDigit  
int positionType 0: Cross-Margin, 1: Isolated-Margin, 2: Unknown
int status 0: Pending Execution, 1: Partially Executed, 2: Fully Executed, -1: Canceled
object stopLoss Stop Loss Target
object stopProfit Take Profit Target
int modifyDate  
int marketPriceDigit  
int unitAmount Nominal Value
string beforeClosePositionPrice  
string baseDisplayName  
string quoteDisplayName  
string contractCodeDisplayName  
string indexBaseDisplayName  
int env  
int dualPosition 0 - One-Way Position / 1 - Two-Way Position
int reduceOnly Whether to Only Reduce Position: 0 - No / 1 - Yes
int orderType 0: Regular Order, 1: Stop Loss and Take Profit, 2: Scheduled Order

ws User Positions(need to log in)

example

Request

{
    "event": "subscribe",
    "params": {
        "biz": "perpetual",
        "type": "position",
        "zip": false,
        "serialize": false
    }
}

Parameter Description

Name Required Type Description Default Value Value Range
biz y string Business   perpetual
type y string type   position
contractCode y string contract code    
zip N boolean Compress or Not false  
serialize N boolean Serialize or Not false  

Response

{
    "biz": "perpetual",
    "data": {
        "result": true
    },
    "channel": "subscribe",
    "type": "position"
}

Subscription Result

  • Description of the "data" Object
Type Field Name Description
boolean result Subscription Result(true: Success, false: Failure)




Request

{
    "biz": "perpetual",
    "data": {
        "fee": "0",
        "liqudatePrice": "0.00000000",
        "realizedSurplus": "0.000000",
        "type": 1,
        "onlyPositionPartInLever": 20,
        "quoteDisplayName": "USDT",
        "score": 0,
        "quote": "usdt",
        "maintenanceMargin": "0",
        "price": "0.00000000",
        "indexBase": "band",
        "id": 230393,
        "entireLever": "20",
        "modifyDate": 1668072633091,
        "lever": "20",
        "indexBaseDisplayName": "BAND",
        "onlyPositionEntireLever": 20,
        "size": "0",
        "closingAmount": "0",
        "unitAmount": "1",
        "unRealizedSurplus": "0.000000",
        "openMarginRate": "0",
        "autoAddMargin": 0,
        "marginDigit": 6,
        "maxLever": "125",
        "orderSize": "0",
        "orderFee": "0",
        "dualPosition": 0,
        "feeRate": "0.00065",
        "availableBalance": "1000156.633050",
        "markPrice": "1.89923333",
        "orderAmount": "0",
        "baseDisplayName": "USDT",
        "marketPriceDigit": 8,
        "contractCodeDisplayName": "BANDUSDT",
        "amount": "0",
        "brokerId": 1,
        "side": "long",
        "openMargin": "0.000000",
        "partInLever": "20",
        "env": 0,
        "userId": 10061,
        "createdDate": 1668072633169,
        "maintainRate": "0.025",
        "brokerPrice": "0",
        "orderMargin": "0",
        "contractCode": "bandusdt",
        "base": "usdt",
        "lastPrice": "5.92100000"
    },
    "type": "position",
    "env": 0
}

Push Result

  • Description of the "data" Object
Type Field Name Description
string closingProfitConditionAmount  
string closingLossConditionAmount  
string closingConditionAmount Take the Maximum Value
string closingAmount  
string amount Position Quantity
string orderAmount Order Quantity
string orderSize  
string orderFee  
string orderMargin  
string fee  
string liqudatePrice  
string realizedSurplus  
string availableBalance  
string maintenanceMargin  
string price Average Position Price
string entireLever before entire Lever
string openMargin  
string lever  
string partInLever  
string size  
string brokerPrice  
string unRealizedSurplus  
int createdDate  
string unitAmount Nominal Value per Contract, Default 1
int marginDigit  
string openMarginRate  
int autoAddMargin Enable Automatic Margin Call
string base Base Currency Name
int brokerId  
string contractCode  
int env 0: Live Trading, 1: Testnet Trading
string feeRate  
int id  
string maintainRate  
int marketPriceDigit  
string maxLever  
int modifyDate  
string preLiqudatePrice  
string quote Quote Currency
int score Calculate Force Reduction Indicator Value
string side Position Type,long/short
int type 0: Cross-Margin, 1: Isolated-Margin
int userId  
string indexBase  
string markPrice  
string lastPrice  
string baseDisplayName  
string quoteDisplayName  
string contractCodeDisplayName  
string indexBaseDisplayName  
int dualPosition 0 - One-Way Position / 1 - Two-Way Position

ws Funding Rate(need to log in)

example

Request

{
    "event": "subscribe",
    "params": {
        "biz": "perpetual",
        "type": "fund_rate",
        "contractCode": "btcusdt",
        "zip": false,
        "serialize": false
    }
}

Parameter Description

Name Required Type Description Default Value Value Range
biz y string Business   perpetual
type y string type   fund_rate
contractCode y string contract code    
zip N boolean Compress or Not false  
serialize N boolean Serialize or Not false  


Response

	{
      "biz": "perpetual",
      "data": {
        "result": true
      },
      "channel": "subscribe",
      "type": "fund_rate",
      "env": 0,
      "contractCode": "btcusdt"
    }

Subscription Result

  • Description of the "data" Object
Type Field Name Description
boolean result Subscription Result(true: Success, false: Failure)






Request

{
  "biz": "perpetual",
  "data": [
    "btcusdt",
    "67594.61",
    "67592.90",
    "0.0001",
    "0.0001",
    7294622,
    "24054",
    "436785.31",
    "436796.42",
    0,
    "usdt",
    "btc",
    "usdt",
    "USDT",
    "BTC",
    "USDT",
    "0"
  ],
  "type": "fund_rate",
  "env": 0,
  "contractCode": "btcusdt",
  "timestamp": 1713016705540
}

Push Result

  • Description of the "data" Object
Type Field Name Description
string contractCode  
string markPrice  
string indexPrice  
string feeRate  
string estimateFeeRate  
string nextLiquidationInterval  
string totalPosition  
string indexCny  
string markCny  
string env 0: Live Market, 1: Test Market
string base Base Currency Name
string indexBase Indexed Coin
string quote Quote Currency
string baseDisplayName  
string indexBaseDisplayName  
string quoteDisplayName  
string preDeliveryPrice  

ws All Funding Rate(need to log in)

example

Request

{
    "event": "subscribe",
    "params": {
        "biz": "perpetual",
        "type": "fund_rates",
        "zip": false,
        "serialize": false
    }
}

Parameter Description

Name Required Type Description Default Value Value Range
biz y string Business   perpetual
type y string type   fund_rates
zip N boolean Compress or Not false  
serialize N boolean Serialize or Not false  



Response

{
  "biz": "perpetual",
  "data": {
    "result": true
  },
  "channel": "subscribe",
  "type": "fund_rates",
  "env": 0
}

Subscription Result

  • Description of the "data" Object
Type Field Name Description
boolean result Subscription Result(true: Success, false: Failure)




Push Result

Request

	{
  "biz": "perpetual",
  "data": [
    [
      "movrusdt",
      "13.783",
      "13.782",
      "0.0001",
      "0.0001",
      21859068,
      "0",
      "89.05",
      "89.06",
      0,
      "",
      "",
      "",
      "USDT",
      "MOVR",
      "USDT",
      "0"
    ],
    [
      "1000xecusdt",
      "0.06155",
      "0.06155",
      "0.0001",
      "0.0001",
      17359068,
      "110",
      "0.39",
      "0.39",
      0,
      "",
      "",
      "",
      "USDT",
      "1000XEC",
      "USDT",
      "0"
    ]
  ],
  "type": "fund_rates",
  "env": 0,
  "timestamp": 1713016540940
}

Push Result

  • Description of the "data" Object
Type Field Name Description
string contractCode  
string markPrice  
string indexPrice  
string feeRate  
string estimateFeeRate  
string nextLiquidationInterval  
string totalPosition  
string indexCny  
string markCny  
string env 0: Live Market, 1: Test Market
string base Base Currency Name
string indexBase Indexed Coin
string quote Quote Currency
string baseDisplayName  
string indexBaseDisplayName  
string quoteDisplayName  
string preDeliveryPrice