Position API

 

Position List

GET /api/v1/perpetual/position/{contractCode}/list

example

Request Parameter:

Path Parameter
Parameter Mandatory Type Description Default Value Value Range
contractCode y string Futurescode    
Query
Parameter Mandatory Type Description Default Value Value Range
AccessKeyId y string Accesskey    
SignatureVersion y string Version    
SignatureMethod y string Signature Method   HmacSHA256
Signature y string Signature    
Timestamp y string Timestamp    

Response

[
    {
        "amount": "4867",
        "base": "fbtc",
        "closingAmount": "0",
        "contractCode": "fbtcusd",
        "lever": "100",
        "liqudatePrice": "3237.43",
        "maintenanceMargin": "0.02527905",
        "markPrice": "9659.25",
        "minQuoteDigit": 2,
        "minTradeDigit": 8,
        "openMargin": "0.14863957",
        "price": "9626.54",
        "quote": "usd",
        "realizedSurplus": "0.00413503",
        "side": "long",
        "size": "5.05581019",
        "type": 0
    }
]

Return:

Parameter Mandatory Type Description Default Value Value Range
amount y string Amount    
base y string base currency name,example:BTC、ETH    
closingAmount y int Transaction Vol.    
contractCode y string Futures    
gear y string Risk limit    
lever y string Leverage    
liqudatePrice y string Liquidation price    
maintenanceMargin y string Maintenance margin    
markPrice y string Mark price    
minQuoteDigit y string Min. transaction decimal places of quote currency    
minTradeDigit y string Min. transaction decimal places of base currency    
openMargin y string Open margin    
price y string Avg.price    
quote y string quote currency name,USD,CNY,USDT    
realizedSurplus y Realized P/L      
side y string PositionType,longLong,shortShort    
size y string PositionValue    
type y string 0:Cross,1:Isolated    

 

 

 

 

 

 

Obtain Margin Rate and Levers of All Tiers

GET /v1/perpetual/public/{contractCode}/lever-gears

example

Request Parameter:

Path Parameter
Parameter Mandatory Type Description Default Value Value Range
contractCode y string Futurescode    
Query
Parameter Mandatory Type Description Default Value Value Range
AccessKeyId y string Accesskey    
SignatureVersion y string Version    
SignatureMethod y string Signature Method   HmacSHA256
Signature y string Signature    
Timestamp y string Timestamp    

Response

{
    "code": 200,
    "data": [
        {
            "entryRate": "0.008",
            "gear": 1,
            "lever": "125",
            "maintainRate": "0.004",
            "maxOpenAmount": "100"
        }
    ]
    "msg": "success"
}

Return:

Parameter Mandatory Type Description Default Value Value Range
entryRate y string Open margin rate    
gear y int tiers    
lever y string Leverage    
maintainRate y string Maintenance margin rate    
maxOpenAmount y string Max.Avail    

 

 

 

 

 

Position and Limit Settings

GET /api/v1/perpetual/position/{contractCode}/configs

example

Request Parameter:

Path Parameter
Parameter Mandatory Type Description Default Value Value Range
contractCode y string Futurescode    
Query
Parameter Mandatory Type Description Default Value Value Range
AccessKeyId y string Accesskey    
SignatureVersion y string Version    
SignatureMethod y string Signature Method   HmacSHA256
Signature y string Signature    
Timestamp y string Timestamp    

Response

{
  "contractCode": "btcusdt",
  "feeRate": "0.00065",
  "fundRate": "0.00375",
  "indexPrice": "37591.04",
  "longPositionConfigDetails": {
    "initOpenMarginRate": "0.008",
    "lever": "125",
    "maintainRate": "0.004",
    "maxOpenAmount": "100",
    "side": "long"
  },
  "makerFeeRate": "0.00035",
  "markPrice": "37704.1",
  "shortPositionConfigDetails": {
    "initOpenMarginRate": "0.008",
    "lever": "125",
    "maintainRate": "0.004",
    "maxOpenAmount": "100",
    "side": "short"
  },
  "takerFeeRate": "0.00065",
  "type": 0,
  "unitAmount": "0.01"
}

Return:

main

Parameter Mandatory Type Description Default Value Value Range
contractCode y string Futurescode    
feeRate y int Handling Fee Rate    
fundRate y string Fee Rate    
indexPrice y string Index price    
markPrice y string Mark price    
type y string 0:Cross,1:Isolated    
unitAmount y string (Conts):Number of quote face values for Futures (One cont)    
makerFeeRate y string maker Fee Rate    
takerFeeRate y string taker Fee Rate    
** longPositionConfigDetails   shortPositionConfigDetails Position详情**
Parameter Mandatory Type Description Default Value Value Range
lever y string Leverage    
side y string Side    
maxOpenAmount y string Max.Avail    
lever y string Leverage    
initOpenMarginRate y string Initial margin rate    

 

Set-up Leverage

POST /api/v1/perpetual/position/{contractCode}/lever

example

Request Parameter:

Path Parameter
Parameter Mandatory Type Description Default Value Value Range
contractCode y string Futurescode    
Query
Parameter Mandatory Type Description Default Value Value Range
AccessKeyId y string Accesskey    
SignatureVersion y string Version    
SignatureMethod y string Signature Method   HmacSHA256
Signature y string Signature    
Timestamp y string Timestamp    
Body(json)

Parameter|Mandatory|Type|Description|Default Value|Value Range ————- | ————- | ————- | ————- | ————- | ————- type|y|int|LeverageType||Cross:0,Isolated:1 shortLever|y|int|ShortLeverage|| longLever|y|string|LongLeverage||

Response

{
    "code":200,
    "data":
    {
        "shortLever":26,
        "type":1,
        "longLever": 10
    },
    "msg":"success"
}

Return:

Parameter Mandatory Type Description Default Value Value Range
lever y string Leverage    

 

 

 

Change Margin

POST /api/v1/perpetual/position/{contract_code}/change-margin

example

Request Parameter:

Path Parameter
Parameter Mandatory Type Description Default Value Value Range
contractCode y string Futurescode    
Query
Parameter Mandatory Type Description Default Value Value Range
AccessKeyId y string Accesskey    
SignatureVersion y string Version    
SignatureMethod y string Signature Method   HmacSHA256
Signature y string Signature    
Timestamp y string Timestamp    
margin y string Margin amount(A positive number indicates a margin increase, a negative number indicates a margin decrease)    
side y string Side   long Long short Short
Body(json)
{
}

Return:

Response

{
    "code": 200,
    "data": null,
    "msg": "success"
}
Parameter Mandatory Type Description Default Value Value Range
code y int Status,200:Success    
msg y string Tips    
data y object      

Set Automatic Margin

POST /api/v1/perpetual/position/{contractCode}/setting

example

Request Parameter:

Path Parameter
Parameter Mandatory Type Description Default Value Value Range
contractCode y string Futurescode    
Query
Parameter Mandatory Type Description Default Value Value Range
AccessKeyId y string Accesskey    
SignatureVersion y string Version    
SignatureMethod y string Signature Method   HmacSHA256
Signature y string Signature    
Timestamp y string Timestamp    
value y string 1 Enable Auto-margin call;0-Disable Auto-margin call    
Body(json)
{
}

Return:

Response

{
    "code": 200,
    "data": null,
    "msg": "success"
}
Parameter Mandatory Type Description Default Value Value Range
code y int Status,200:Success    
msg y string Tips    
data y object