Add Order
REQUESTwss://ws-auth.kraken.com
addOrderAuthentication Required
Sends a single, new order into the exchange. A range of order types, Time-In-Force (TIF) and order flags can be specified by the parameters below.
Request
- Request Schema
- Example
MESSAGE BODY
addOrder
limit
, market
, stop-loss
, stop-loss-limit
, take-profit
, take-profit-limit
, trailing-stop
, trailing-stop-limit
, settle-position
] buy
, sell
] - limit price for
limit
orders. - trigger price for
stop-loss
,stop-loss-limit
,take-profit
,take-profit-limit
,trailing-stop
andtrailing-stop-limit
orders
To specify a relative price, this field can be prefixed by +, -, or # to specify the order price as an offset relative to the last traded price.
+
adds the amount to the last traded price.-
subtracts the amount from the last traded price.#
will either add or subtract the amount to the last traded price, depending on the direction.
Prices can also be suffixed with a %
to signify the relative amount as a percentage, rather than an absolute price difference in the quote currency. Example, to specify a price as 2% from last price use "+2%"
.
Note, trailing stop order types must use a relative price for this field, i.e. +
to represent the reversion from the peak / trough price.
stop-loss-limit
, take-profit-limit
and trailing-stop-limit
orders.To specify a relative price, this field can be prefixed by + or - to specify the order price as an offset relative to the market price.
+
adds the amount to the reference price.-
subtracts the amount from the reference price.
Prices can also be suffixed with a %
to signify the relative amount as a percentage, rather than an absolute price difference in the quote currency. Example, to specify a price as 2% from last price use "+2%"
.
Note, trailing stop order types must use a relative price for this field, i.e. +
or -
to represent the offset from the triggered price.
2
, 3
, 4
, 5
] false
, true
] false
false
, true
] false
fciq
, fcib
, nompp
, post
, viqc
] fcib
: prefer fee in base currency.fciq
: prefer fee in quote currency.nompp
: no market price protection.post
: post only order (only on limit orders).viqc
: volume in quote currency (only available on buy market orders without margin funding).
+n
= schedule start time n
seconds from now n
= unix timestamp of start time.+n
= expiren
seconds from now n
= unix timestamp of expiration time. GTD orders can have an expiry time up to one month in future.Adds a alphanumeric client order identifier which uniquely identifies an open order for each client. This field is mutually exclusive with userref
parameter.
cl_ord_id
parameter can be one of the following formats:- Long UUID:
6d1b345e-2821-40e2-ad83-4ecb18a06876
32 hex characters separated with 4 dashes. - Short UUID:
da8e4ad59b78481c93e589746b0cf91f
32 hex characters with no dashes. - Free text:
arb-20240509-00010
Free format ascii text up to 18 characters.
This is an optional non-unique, numeric identifier which can associated with a number of orders by the client. This field is mutually exclusive with cl_ord_id
parameter.
Adds a alphanumeric sub-account/trader identifier which enables STP to be performed at a more granular level.
Thesender_sub_id
parameter can be one of the following formats:- Long UUID:
6d1b345e-2821-40e2-ad83-4ecb18a06876
32 hex characters separated with 4 dashes. - Short UUID:
da8e4ad59b78481c93e589746b0cf91f
32 hex characters with no dashes. - Free text:
arb-20240509-00010
Free format ascii text up to 18 characters.
GTC
, GTD
, IOC
] GTC
GTC
: Good Till Canceled - until user has cancelled.GTD
: Good Till Date - untilexpiretm
parameter.IOC
: Immediate Or Cancel - immediately cancels back any quantity that cannot be filled on arrival.
price
of OTO secondary order - see price
parameter.price2
of OTO secondary order - see price2
parameter.{
"event": "addOrder",
"ordertype": "limit",
"pair": "XBT/USD",
"price": "9000",
"token": "0000000000000000000000000000000000000000",
"type": "buy",
"volume": "10.123"
}
Response
- Response Schema
- Example
- Example Error
MESSAGE BODY
addOrderStatus
add_order
parameters.ok
, error
] {
"descr": "buy 0.01770000 XBTUSD @ limit 4000",
"event": "addOrderStatus",
"status": "ok",
"txid": "ONPNXH-KMKMU-F4MR5V"
}
{
"errorMessage": "EOrder:Order minimum not met",
"event": "addOrderStatus",
"status": "error"
}