v1
latestOpenAPI 3.0.32026-07-2613529376.3 KBCollateral Trading
Collateral Market Order
The endpoint creates a market order using collateral balance. The order executes immediately at the best available market price. Optionally attach stopLoss and takeProfit prices to create an OTO order that activates after the market order fills.
<Warning> Rate limit: 10000 requests/10 sec. </Warning> <Accordion title="Error Codes"> - `30` - default validation error code. Also returned when `reduceOnly=true` is combined with `stopLoss` or `takeProfit` - `31` - market validation failed - `32` - amount validation failed - `36` - clientOrderId validation failed - `10` - insufficient balance to place the order - `111` - resulting position would exceed the market maximum - `112` - pending orders value would exceed the allowed maximum - `113` - position side cannot be changed while open positions or orders exist - `114` - hedge mode position side does not match (sent `BOTH` or omitted `positionSide` in hedge mode, or sent `LONG`/`SHORT` in one-way mode) - `115` - order would open a position in the opposite direction (one-way mode) - `116` - reduce-only validation failed (no position exists or order side matches position direction) </Accordion>post/api/v4/order/collateral/market
Request body
Example request
{
"market": "BTC_USDT",
"side": "buy",
"amount": "0.01",
"clientOrderId": "order1987111",
"stopLoss": "50000",
"takeProfit": "40000",
"positionSide": "LONG",
"stp": "no",
"request": "{{request}}",
"nonce": 1594297865000
}Response
Successful response - market order created
Example response
{
"orderId": 4180284841,
"clientOrderId": "order1987111",
"market": "BTC_USDT",
"side": "sell",
"type": "market",
"timestamp": 1595792396.165973,
"dealMoney": "0",
"dealStock": "0",
"amount": "0.001",
"left": "0.001",
"dealFee": "0",
"status": "FILLED",
"stp": "no",
"oto": {
"otoId": 29457221,
"stopLoss": "50000",
"takeProfit": "40000"
},
"positionSide": "LONG"
}