Skip to main content

Trade

Version: v1​

POST /api/futures/trade/create-order​

Summary:​

Create order. After filling, order becomes a position.

clientOrderId is optional and enables per-user idempotency: a retried request that reuses the same clientOrderId returns the original order instead of placing a second order and reserving margin twice. The pair (userId, clientOrderId) is unique while clientOrderId is set; omit the field (or send null) for the non-idempotent path.

Request body​
{
"isMarket": true,
"isLong": true,
"price": 0,
"stopLoss": 0,
"takeProfit": 0,
"amount": 0,
"currencyPairCode": "string",
"futuresAccountId": 0,
"clientOrderId": "string"
}
Response model​

{
"id": 0,
"clientOrderId": "string"
}

Response codes​
CodeDescription
200Success

PUT /api/futures/trade/update-take-profit​

Summary:​

Update order take profit

Request body​
{
"orderId": 0,
"takeProfit": 0
}
Response codes​
CodeDescription
200Success

PUT /api/futures/trade/update-stop-loss​

Summary:​

Update order stop loss

Request body​
{
"orderId": 0,
"stopLoss": 0
}
Response codes​
CodeDescription
200Success

PUT /api/futures/trade/close​

Summary:​

Close position or cancel not filled order

Request body​
{
"orderId": 0,
"isMarket": true,
"limitPrice": 0
}
Response codes​
CodeDescription
200Success

GET /api/futures/trade/orders-history​

Summary:​

Get orders/positions history

Request parameters​
NameLocated inDescriptionRequiredSchema
CurrencyPairqueryNostring
PagequeryNointeger
PageSizequeryNointeger
DateFromqueryNodateTime
DateToqueryNodateTime
StatusesqueryCreated = 10, PositionClosed = 20, Cancelled = 30, Error = 40, InPosition = 50Nointeger
FuturesAccountIdqueryNolong
Response model​
[
{
"id": 0,
"clientOrderId": "string",
"createTimestamp": "2024-04-26T04:48:24.681Z",
"updateTimestamp": "2024-04-26T04:48:24.681Z",
"price": 0,
"amount": 0,
"currencyPairCode": "string",
"takeProfit": 0,
"stopLoss": 0,
"realizedPnl": 0,
"leverage": 0,
"isLong": true,
"isMarket": true,
"liquidationPrice": 0,
"filled": 0,
"fee": 0,
"feeAsset": "string",
"amountInPosition": 0,
"futuresOrderStatus": 10,
"fundingFee": 0,
"initialMargin": 0,
"currentMargin": 0,
"unRealizedPnl": 0,
"unRealizedPnlPercentage": 0,
"totalPnlPercentage": 0,
"roe": 0
}
]
Response codes​
CodeDescription
200Success

GET /api/futures/trade/positions​

Summary:​

Get positions

Request parameters​
NameLocated inDescriptionRequiredSchema
CurrencyPairqueryNostring
PagequeryNointeger
PageSizequeryNointeger
DateFromqueryNodateTime
DateToqueryNodateTime
FuturesAccountIdqueryNolong
IsActivequeryNoboolean
Response model​
[
{
"id": 0,
"clientOrderId": "string",
"createTimestamp": "2024-04-26T05:04:47.250Z",
"updateTimestamp": "2024-04-26T05:04:47.250Z",
"price": 0,
"amount": 0,
"currencyPairCode": "string",
"takeProfit": 0,
"stopLoss": 0,
"realizedPnl": 0,
"leverage": 0,
"isLong": true,
"isMarket": true,
"liquidationPrice": 0,
"filled": 0,
"fee": 0,
"feeAsset": "string",
"amountInPosition": 0,
"futuresOrderStatus": 10,
"fundingFee": 0,
"initialMargin": 0,
"currentMargin": 0,
"unRealizedPnl": 0,
"unRealizedPnlPercentage": 0,
"totalPnlPercentage": 0,
"roe": 0
}
]
Response codes​
CodeDescription
200Success

GET /api/futures/trade/orderbook/{currencyPairCode}​

Summary:​

Get orderbook

Request route parameters​
NameLocated inDescriptionRequiredSchema
currencyPairCoderouteYesstring
Response model​
{
"currencyPairCode": "string",
"asks": [
{
"price": 0,
"quantity": 0
}
],
"bids": [
{
"price": 0,
"quantity": 0
}
]
}
Response codes​
CodeDescription
200Success