Trades Endpoints
New Order
Path: /api/v1/trade/order
Method: POST
Description: Send new order
Body:
├─ symbol: String (Mandatory)
├─ side: String (Mandatory) (SELL, BUY)
├─ positionSide: String (Mandatory) (Default NET for One-way Mode ; LONG or SHORT for Hedge Mode. It must be sent in Hedge Mode.)
├─ type: String (Mandatory) (Order type: LIMIT, MARKET, STOP, TAKE_PROFIT,STOP_MARKET, TAKE_PROFIT_MARKET, TRAILING_STOP_MARKET, POST_ONLY)
├─ reduceOnly: String (Mandatory) ("true" or "false". default "false". Cannot be sent in Hedge Mode; cannot be sent with closePosition=true.not supported)
├─ quantity: Number (Mandatory) (Cannot be sent with closePosition=true(Close-All))
├─ price: Number (Mandatory)
├─ clientOrderId: String (Mandatory) (A unique id among open orders. Automatically generated if not sent. Can only be string following the rule: ^[\.A-Z\:/a-z0-9_-]{1,36}$)
├─ stopPrice: Number (Used with STOP/STOP_MARKET or TAKE_PROFIT/TAKE_PROFIT_MARKET orders)
├─ closePosition: String (true, false;Close-All,used with STOP_MARKET or TAKE_PROFIT_MARKET.not supported)
├─ activationPrice: Number (Used with TRAILING_STOP_MARKET orders, default as the latest price(supporting different workingType))
├─ callbackRate: Number (Used with TRAILING_STOP_MARKET orders, min 0.1, max 5 where 1 for 1%)
├─ timeInForce: String (Mandatory) (GTC, IOC, FOK, GTX)
├─ workingType: String (stopPrice triggered by: "MARK_PRICE", "CONTRACT_PRICE". Default "CONTRACT_PRICE")
└─ priceProtect: String ("TRUE" or "FALSE", default "FALSE". Used with STOP/STOP_MARKET or TAKE_PROFIT/TAKE_PROFIT_MARKET orders.not supported)
Condition orders will be triggered when:
-STOP, STOP_MARKET: BUY: latest price ("MARK_PRICE" or "CONTRACT_PRICE") >= stopPrice SELL: latest price ("MARK_PRICE" or "CONTRACT_PRICE") <= stopPrice
-TAKE_PROFIT, TAKE_PROFIT_MARKET: BUY: latest price ("MARK_PRICE" or "CONTRACT_PRICE") <= stopPrice SELL: latest price ("MARK_PRICE" or "CONTRACT_PRICE") >= stopPrice
Response:
├─ code: Number
├─ msg: String
└─ data: Object
├─ clientOrderId: String (User defined order number)
└─ orderId: String (System order number)
Example:
Request:
{
"symbol": "ETH-USDC",
"side": "BUY",
"type": "LIMIT",
"quantity": 1,
"price": 2500,
"clientOrderId": "00000001",
"timeInForce": "GTC",
}
Response:
{
"code": 0,
"msg": "",
"data": {
"clientOrderId": "",
"orderId": ""
}
}
Cancel Order
Path: /api/v1/trade/cancelOrder
Method: POST
Description: Cancel order by orderId and clientOrderId
Body:
├─ symbol: String (Mandatory)
├─ orderId: String (System order number)
└─ clientOrderId: String (User defined order number)
Response:
├─ code: Number
└─ msg: String
Example:
Request:
{
"symbol": "ETH-USDC",
"orderId": "37266642",
"clientOrderId": "000000001"
}
Response:
{
"code": 0,
"msg": ""
}
Query Current Open Order
Path: /api/v1/trade/openOrders
Method: GET
Description: Query current open order
Parameters:
└─ symbol: String
Response:
├─ code: Number
├─ msg: String
└─ data: Array
├─ symbol: String
├─ side: String
├─ positionSide: String
├─ status: String
├─ price: String
├─ origQty: String (Original quantity)
├─ origType: String (Original order type)
├─ type: String (order type)
├─ timeInForce: String
├─ orderId: String (System order number)
├─ clientOrderId: String (User defined order number)
├─ reduceOnly: Boolean (if reduce position only)
├─ workingType: String (Conditional price trigger type)
├─ stopPrice: String (please ignore when order type is TRAILING_STOP_MARKET)
├─ closePosition: Boolean (if Close-All)
├─ activatePrice: String (activation price, only return with TRAILING_STOP_MARKET order)
├─ priceRate: String (callback rate, only return with TRAILING_STOP_MARKET order)
├─ priceProtect: Boolean (if conditional order trigger is protected)
├─ orderTime: Number
├─ cumQuote: String (trades amount)
├─ executedQty: String (trades quantity)
├─ avgPrice: String (trades price)
├─ updateTime: Number
└─ frozenMargin: String
Example:
Request:
https://api.aboard.exchange/arbitrum/api/v1/trade/openOrders?symbol=ETH-USDC
Response:
{
"code": 0,
"msg": "",
"data": [
{
"symbol": "ETH-USDC",
"side": "BUY",
"positionSide": "SHORT",
"status": "NEW",
"price": "0",
"origQty": "0.40",
"origType": "TRAILING_STOP_MARKET",
"type": "TRAILING_STOP_MARKET",
"timeInForce": "GTC",
"orderId": "1573346959",
"clientOrderId": "abc",
"reduceOnly": false,
"workingType": "LAST_PRICE",
"stopPrice": "9300",
"closePosition": false,
"activatePrice": "9020",
"priceRate": "0.3",
"priceProtect": false,
"orderTime": 1579276756075,
"cumQuote": "0",
"executedQty": "0",
"avgPrice": "0.00000",
"updateTime": 1579276756075,
"frozenMargin": "12.34"
}
]
}
Query Order
Path: /api/v1/trade/order
Method: GET
Description: Query order
Parameters:
├─ symbol: String (Mandatory)
├─ orderId: String (System order number)
└─ clientOrderId: String (User defined order number)
Response:
├─ code: Number
├─ msg: String
└─ data: Object
├─ symbol: String
├─ side: String
├─ positionSide: String
├─ status: String (Order status)
├─ price: String
├─ origQty: String (Original quantity)
├─ origType: String (Original order type)
├─ type: String (Order type)
├─ timeInForce: String
├─ orderId: String (System order number)
├─ clientOrderId: String (User defined order number)
├─ reduceOnly: Boolean (if reduce position only)
├─ workingType: String (Conditional price trigger type)
├─ stopPrice: String (please ignore when order type is TRAILING_STOP_MARKET)
├─ closePosition: Boolean (if Close-All)
├─ activatePrice: String (activation price, only return with TRAILING_STOP_MARKET order)
├─ priceRate: String (callback rate, only return with TRAILING_STOP_MARKET order)
├─ priceProtect: Boolean (if conditional order trigger is protected)
├─ orderTime: Number
├─ cumQuote: String (trades amount)
├─ executedQty: String (trades quantity)
├─ avgPrice: String (trades price)
└─ updateTime: Number
Example:
Request:
https://api.aboard.exchange/arbitrum/api/v1/trade/order?symbol=ETH-USDC&orderId=&clientOrderId=
Response:
{
"code": 0,
"msg": "",
"data": {
"symbol": "ETH-USDC",
"side": "BUY",
"positionSide": "SHORT",
"status": "NEW",
"price": "0",
"origQty": "0.40",
"origType": "TRAILING_STOP_MARKET",
"type": "TRAILING_STOP_MARKET",
"timeInForce": "GTC",
"orderId": "1573346959",
"clientOrderId": "abc",
"reduceOnly": false,
"workingType": "LAST_PRICE",
"stopPrice": "9300",
"closePosition": false,
"activatePrice": "9020",
"priceRate": "0.3",
"priceProtect": false,
"orderTime": 1579276756075,
"cumQuote": "0",
"executedQty": "0",
"avgPrice": "0.00000",
"updateTime": 1579276756075
}
}
Query History Orders
Path: /api/v1/trade/historyOrders
Method: GET
Description: Query history orders
Parameters:
├─ symbol: String (Mandatory)
├─ orderId: String (If orderId is set, it will get orders >= that orderId. Otherwise most recent orders are returned)
├─ startTime: Number
├─ endTime: Number
└─ limit: Number (Number of result sets returned, default:100 maximum:500)
Response:
├─ code: Number
├─ msg: String
└─ data: Array
├─ symbol: String
├─ side: String
├─ positionSide: String
├─ status: String (Order status)
├─ price: String
├─ origQty: String (Original quantity)
├─ origType: String (Original order type)
├─ type: String (Order type)
├─ timeInForce: String
├─ orderId: String (System order number)
├─ clientOrderId: String (User defined order number)
├─ reduceOnly: Boolean (if reduce position only)
├─ workingType: String (Conditional price trigger type)
├─ stopPrice: String (please ignore when order type is TRAILING_STOP_MARKET)
├─ closePosition: Boolean (if Close-All)
├─ activatePrice: String (activation price, only return with TRAILING_STOP_MARKET order)
├─ priceRate: String (callback rate, only return with TRAILING_STOP_MARKET order)
├─ priceProtect: Boolean (if conditional order trigger is protected)
├─ orderTime: Number
├─ cumQuote: String (trades amount)
├─ executedQty: String (trades quantity)
├─ avgPrice: String (trades price)
└─ updateTime: Number
Example:
Request:
https://api.aboard.exchange/arbitrum/api/v1/trade/historyOrders?symbol=ETH-USDC&orderId=&startTime=1628575642000&endTime=1628585642000&limit=100
Response:
{
"code": 0,
"msg": "",
"data": [
{
"symbol": "ETH-USDC",
"side": "BUY",
"positionSide": "SHORT",
"status": "NEW",
"price": "0",
"origQty": "0.40",
"origType": "TRAILING_STOP_MARKET",
"type": "TRAILING_STOP_MARKET",
"timeInForce": "GTC",
"orderId": "1573346959",
"clientOrderId": "abc",
"reduceOnly": false,
"workingType": "LAST_PRICE",
"stopPrice": "9300",
"closePosition": false,
"activatePrice": "9020",
"priceRate": "0.3",
"priceProtect": false,
"orderTime": 1579276756075,
"cumQuote": "0",
"executedQty": "0",
"avgPrice": "0.00000",
"updateTime": 1579276756075
}
]
}
Query History Trades
Path: /api/v1/trade/historyTrades
Method: GET
Description: Query history trades
Parameters:
├─ symbol: String (Mandatory)
├─ fromId: String (TradeId to fetch from. Default gets most recent trades)
├─ startTime: Number
├─ endTime: Number
└─ limit: Number (Number of result sets returned, default:100 maximum:500)
Response:
├─ code: Number
├─ msg: String
└─ data: Array
├─ symbol: String
├─ side: String
├─ positionSide: String
├─ orderId: Number
├─ id: String (Trades id)
├─ price: String
├─ qty: String (trades quantity)
├─ quoteQty: String (trades amount)
├─ realizedPnl: String (Profit and loss)
├─ commission: String
├─ commissionAsset: String
├─ maker: Boolean (if maker)
├─ doneTime: Number
└─ tradeType: String (Standard; Liquidation; Auto Deleveraging)
Example:
Request:
https://api.aboard.exchange/arbitrum/api/v1/trade/historyTrades?symbol=ETH-USDC&fromId=&startTime=1628575642000&endTime=1628585642000&limit=100
Response:
{
"code": 0,
"msg": "",
"data": [
{
"symbol": "ETH-USDC",
"side": "SELL",
"positionSide": "SHORT",
"orderId": 25851813,
"id": "698759",
"price": "7819.01",
"qty": "0.002",
"quoteQty": "15.63802",
"realizedPnl": "-0.91539999",
"commission": "-0.07819010",
"commissionAsset": "USDT",
"maker": false,
"doneTime": 1569514978020,
"tradeType": "Standard"
}
]
}
Set Leverage
Path: /api/v1/trade/setLeverage
Method: POST
Description: Set leverage for contract
Parameters:
├─ symbol: String (Mandatory) └─ leverage: Number (Leverage value)
Response:
├─ code: Number └─ msg: String
Example:
Request:
{
"symbol": "ETH-USDC",
"leverage": 10
}
Response:
{
"code": 0,
"msg": ""
}
Query Leverage
Path: /api/v1/trade/symbolLeverage
Method: GET
Description: Query leverage
Parameters:
└─ symbol: String (Mandatory)
Response:
├─ code: Number ├─ msg: String └─ data: Object ├─ symbol: String └─ leverage: Number (Leverage value)
Example:
Request:
https://api.aboard.exchange/arbitrum/api/v1/trade/symbolLeverage?symbol=ETH-USDC
Response:
{
"code": 0,
"msg": "",
"data": [
{
"symbol": "ETH-USDC",
"leverage": 10
}
]
}
Last updated