Creates a spot order. Limit or market orders can be created by changing the “type” field.
POST /v1/orders
true
View Only
Request
Name | Type | Description | Example | Required |
---|---|---|---|---|
clientOrderId | string | optional order id provided by client. Must be alphanumeric including underscores and dashes and less ≤ 64 characters. | "order123" |
No |
market | string | trading market pair | "AVAX-USDC" |
Yes |
price | string | limit price. Must be aligned with quoteIncrement from /v1/markets |
||
Do not specify for market order. | "1.55" |
Yes | ||
quoteSize | string | order quantity based in quote currency. Can only be set for market order buys. | "13.0967" |
No |
side | string | buy or sell | "buy" |
Yes |
size | string | the amount of base currency to buy or sell. Both market and limit order can use this. Must be aligned with baseIncrement from /v1/markets |
"20.30" |
Yes |
type | string | the order type, “limit” or “market” | limit |
No, defaults to “limit” |
timeInForce | string | “GTC” - Good until cancelled or “IOC” - Immediate or cancel. Cannot be set for market orders. | IOC |
No, defaults to “GTC” |
postOnly | boolean | Whether an order should be prohibited from filling on placement. | true |
No, defaults to false |
If postOnly
is true
and an order would match at placement, response code 400
will be returned, with the error message post_only_has_match
.
If postOnly
is true
, and timeInForce
is set to IOC
, response code 400 will be returned, with the error message invalid_time_in_force
.
See below for more details on the error response.
{
"clientOrderId": "order123",
"market": "AVAX-USDC",
"price": "1.55",
"side": "buy",
"size": "20.30",
}
Response
Name | Type | Description | Example | Required |
---|---|---|---|---|
canceledAt | dateTime | order cancel time | "2022-06-16T12:35:11.123456Z" |
No |
clientOrderId | string | order id provided by client | "order123" |
No |
createdAt | dateTime | order created time | "2022-06-16T12:35:11.123456Z" |
Yes |
fee | string | Fees incurred on order | "0.0837" |
Yes |
filledAt | dateTime | time when order was fully filled | "2022-06-16T12:35:11.123456Z" |
No |
filledCost | string | cost of filled portion of order (filledSize * filledPrice) | "8.37465" |
Yes |
filledSize | string | quantity of order filled | "5.403" |
Yes |
market | string | market | "AVAX-USDC" |
Yes |
orderId | string | order id used internally by Enclave | "70a37d8f972f2494837f9dba8364cbb4" |
Yes |
price | string | limit price | "1.55" |
Yes |
side | string | "buy" or "sell" | "buy" |
Yes |
size | string | order quantity | "20.30" |
Yes |
status | string | order status - open / fullyfilled / canceled | "open" |
Yes |
type | string | the order type, “limit” or “market” | limit |
Yes |
timeInForce | string | “GTC” - Good until cancelled or “IOC” - Immediate or cancel. | ||
Will not be returned for market orders. | IOC |
No | ||
cancelReason | string | cancel reason description | "immediateorcancel" |
Yes |
{
"result": {
"canceledAt": "2022-06-16T12:35:11.123456Z",
"clientOrderId": "order123",
"createdAt": "2022-06-16T12:35:11.123456Z",
"fee": "0.0837",
"filledAt": "2022-06-16T12:35:11.123456Z",
"filledCost": "8.37465",
"filledSize": "5.403",
"market": "AVAX-USDC",
"orderId": "70a37d8f972f2494837f9dba8364cbb4",
"price": "1.55",
"side": "buy",
"size": "20.30",
"status": "open",
},
"success": true
}
Gets orders that meet parameters
GET /v1/orders
true
View Only
Request
Query parameters
Name | Located in | Description | Example | Required | Schema |
---|---|---|---|---|---|
limit | query | maximum number of results to return | 1000 |
No | integer |
cursor | query | pagination cursor | "NQ5WWO3THN3Q====" |
No | string |
market | query | trading market | "AVAX-USDC" |
No | string |
status | query | order status | "open" |
No | string |
startTime | query | time order placed at (UTC milliseconds) | 1684814400000 |
No | integer |
endTime | query | time order placed at (UTC milliseconds) | 1672549200000 |
No | integer |