Orders
Place Margin Order
{
"orderId": "5bd6e9286d99522a52e458de",
"borrowSize": 10.2,
"loanApplyId": "600656d9a33ac90009de4f6f"
}
There are two types of orders:
(limit
) order: set price and quantity for the transaction.
(market
) order : set amount or quantity for the transaction.
Before placing an order, make sure there are enough funds in your Margin Account. Once the order is successfully placed, the amount of funds required for the order will be frozen. The Holds will depend on the type of order placed as well as the request parameters set.
TIP
Placing an order will enable price protection. When the price of the limit order is outside the threshold range, the price protection mechanism will be triggered, causing the order to fail.
Please note that once your order enters the order book, the system will freeze the Order handling fee for the order ahead of time.
Before placing orders, please be sure to fully understand the meaning of the parameters for each symbol.
Do not include extra spaces in JSON strings.
Place Order Limit
The maximum active orders for a single trading pair in one account is 200
(stop orders included).
HTTP REQUEST
POST /api/v1/margin/order
API KEY PERMISSIONS
This endpoint requires the Margin Trading permission.
REQUEST URL
This endpoint support Spot URL
REQUEST RATE LIMIT
Spot weight
:5
PARAMETERS
Public order placement request parameters
Param | Type | Mandatory | Description |
---|---|---|---|
clientOid | String | Yes | Client Order Id,unique identifier created by the user, the use of UUID is recommended |
side | String | Yes | buy or sell |
symbol | String | Yes | symbol, such as, ETH-BTC |
type | String | No | Order type limit and market , The default is limit |
stp | String | No | self trade prevention is divided into four strategies: CN , CO , CB , and DC |
marginModel | String | No | The type of trading, including cross (cross mode) and isolated (isolated mode). It is set at cross by default. |
autoBorrow | boolean | No | Auto-borrow to place order. The system will first borrow you funds at the optimal interest rate and then place an order for you. Currently autoBorrow parameter only supports cross mode, not isolated mode. When add this param, stop profit and stop loss are not supported, if it is a sell order, the size must be passed |
autoRepay | boolean | No | Automatically repay when placing an order, that is, the system automatically triggers repayment after the order is completed. The maximum currency repayment amount is the trade amount. The same order does not support the simultaneous use of autoBorrow and autoRepay. |
Additional Request Parameters Required by limit
Orders
Param | Type | Mandatory | Description |
---|---|---|---|
price | String | Yes | Specify price for currency |
size | String | Yes | Specify quantity for currency |
timeInForce | String | No | Order timing strategy GTC , GTT , IOC , FOK (The default is GTC ) |
cancelAfter | long | No | Cancel after n seconds,the order timing strategy is GTT |
postOnly | boolean | No | passive order labels, this is disabled when the order timing strategy is IOC or FOK |
hidden | boolean | No | Hidden or not (not shown in order book) |
iceberg | boolean | No | Whether or not only visible portions of orders are shown in iceberg orders |
visibleSize | String | No | Maximum visible quantity in iceberg orders |
Additional request parameters required by market
orders
Param | Type | Mandatory | Description |
---|---|---|---|
size | String | No | (Select one out of two: size or funds ) |
funds | String | No | (Select one out of two: size or funds ) |
- When placing a market order, the size or funds must be set. For market buy orders, the
funds
must be set.
RESPONSES
Param | Description |
---|---|
orderId | An order Id is returned once an order is successfully placed. |
borrowSize | Borrowed amount. The field is returned only after placing the order under the mode of Auto-Borrow. |
loanApplyId | ID of the borrowing response. The field is returned only after placing the order under the mode of Auto-Borrow. |
Terms
MarginMode
There are two modes for API margin trading: cross
and isolated
, it is set at cross
by default.
AutoBorrow
This is the symbol of Auto-Borrow, if it is set to true
, the system will automatically borrow the funds required for an order according to the order amount. By default, the symbol is set to false
. When your order amount is too large, exceeding the max. borrowing amount via the max. leverage or the risk limit of margin, then you will fail in borrowing and order placing. Currently autoBorrow
parameter only supports cross
mode, not isolated
mode
There may be situations where the borrow is successful but the order placement fails. In this case, you can directly place the order again without the auto-borrow parameter, or choose the repayment operation.