Documentation Index
Fetch the complete documentation index at: https://kraken-sandbox.mintlify.app/llms.txt
Use this file to discover all available pages before exploring further.
WSSws-auth.kraken.com/v2batch_add
Sends a collection of orders (minimum of 2 and maximum 15):
- Validation is performed on the whole batch prior to submission to the engine. If an order fails validation, the whole batch will be rejected.
- On submission to the engine, if an order fails pre-match checks (i.e. funding), then the individual order will be rejected and remainder of the batch will be processed.
- All orders in batch are limited to a single pair.
- Request
- Response
Value:
batch_addHide properties
Hide properties
Format: RFC3339
Example:
Example:
2022-12-25T09:30:59.123ZRange of valid offsets (from current time) is 500 milliseconds to 60 seconds, default is 5 seconds. The precision of this parameter is to the millisecond. The engine will prevent this order from matching after this time, it provides protection against latency on time sensitive orders.Example:
"BTC/USD"The symbol of the currency pair.One of:
Default:
true, falseDefault:
falseIf set to true the order will be validated only, it will not trade in the matching engine.Authentication token. See authentication guide for details.
A list of orders in the batch.
Hide properties
Hide properties
Condition: market orders onlyOrder volume expressed in quote currency.
The conditional parameters are used as a template for generating the secondary close orders when the primary order fills. Each fill on the primary order will generate a new secondary order. The size of the secondary order will be the same size as the executed quantity and have the opposite side.
Hide properties
Hide properties
One of:
limit, stop-loss, stop-loss-limit, take-profit, take-profit-limit, trailing-stop, trailing-stop-limitDefines the order type of the secondary close orders which will be created on each fill.Defines the limit price on the secondary close orders. Only required on secondary order types that support limit price:
limit, stop-loss-limit, take-profit-limit.One of:
Default:
Condition: Only available on trailing-stop-limit ordersThe units for the limit price on the secondary order.
static, pct, quoteDefault:
quoteCondition: Only available on trailing-stop-limit ordersThe units for the limit price on the secondary order.
static: a static market price for the asset, i.e. 30000 for BTC/USD.pct: a percentage offset from the reference price, i.e. -10% from index price.quote: a notional offset from the reference price in the quote currency, i.e, 150 BTC/USD from last price.
trailing-stop-limit order type, the value represents offset from the trigger price. 0 would set a limit price the same as the trigger price.Specifies the amount for the trigger price - it supports both static market prices and relative prices. This field is used in combination with the
price_type field below to determine the effective trigger price.Examples:- To trigger at 29000.5 BTC/USD, use price=29000.5, price_type=static.
- To trigger when price rises by 5%, use price=5, price_type=pct.
- To trigger when price drops by 150 USD, use price=-150, price_type=quote.
trailing-stop and trailing-stop-limit order types, the price represents the reversion from the peak. It is always a positive offset value.One of:
Default:
static, pct, quoteDefault:
staticThe units for the trigger price.static: a static market price for the asset, i.e. 30000 for BTC/USD.pct: a percentage offset from the reference price, i.e. -10% from index price.quote: a notional offset from the reference price in the quote currency, i.e, 150 BTC/USD from last price.
Deprecated: Use
trigger_priceDefines the trigger price on the secondary close orders. Only required on triggered secondary order types: stop-loss, stop-loss-limit, take-profit, take-profit-limit.Condition: iceberg orders onlyDefines the quantity to show in the book while the rest of order quantity remains hidden. Minimum value is 1 / 15 of
order_qty.Format: RFC3339
Example:
Example:
2022-12-25T09:30:59ZScheduled start time (precision to seconds).Format: RFC3339
Example:
Condition: GTD orders onlyExpiration time of the order (precision to seconds). GTD orders can have an expiry time up to one month in future.
Example:
2022-12-25T09:30:59ZCondition: GTD orders onlyExpiration time of the order (precision to seconds). GTD orders can have an expiry time up to one month in future.
One of:
base, quoteFee preference base or quote currency. quote is the default for buy orders, base is the default for sell orders.Limit price for order types that support limit price restriction.
One of:
Default:
Condition: Only available on trailing-stop ordersThe units for the limit price.
static, pct, quoteDefault:
quoteCondition: Only available on trailing-stop ordersThe units for the limit price.
One of:
Default:
false, trueDefault:
falseFunds the order on margin using the maximum leverage for the pair (maximum is leverage of 5).One of:
Default:
Condition: Market orders only
Deprecated: If supplied, the flag is accepted but ignoredDisables Market Price Protection (MPP) if set to
true, falseDefault:
falseCondition: Market orders only
Deprecated: If supplied, the flag is accepted but ignoredDisables Market Price Protection (MPP) if set to
true. MPP is a feature that protects market orders from filling at a bad price due to price slippage in an illiquid or volatile market. See MPP support article.Adds an alphanumeric client order identifier which uniquely identifies an open order for each client. This field is mutually exclusive with
order_userref parameter. The cl_ord_id parameter can be one of the following formats:- Long UUID:
6d1b345e-2821-40e2-ad83-4ecb18a0687632 hex characters separated with 4 dashes. - Short UUID:
da8e4ad59b78481c93e589746b0cf91f32 hex characters with no dashes. - Free text:
arb-20240509-00010Free format ascii text up to 18 characters.
This is an optional non-unique, numeric identifier which can be associated with a number of orders by the client. This field is mutually exclusive with
cl_ord_id parameter. Many clients choose a unique integer value generated by their systems (i.e. a timestamp). However, because we don’t enforce uniqueness on our side, it can also be used to easily tag a group of orders for querying or cancelling.Order quantity in terms of the base asset.
One of:
limit, market, iceberg, stop-loss, stop-loss-limit, take-profit, take-profit-limit, trailing-stop, trailing-stop-limit, settle-positionThe execution model of the order.One of:
Default:
Condition: Orders with limit price onlyCancels the order if it will take liquidity on arrival. Post only orders will always be posted passively in the book.
true, falseDefault:
falseCondition: Orders with limit price onlyCancels the order if it will take liquidity on arrival. Post only orders will always be posted passively in the book.
One of:
Default:
true, falseDefault:
falseReduces an existing margin position without opening an opposite long or short position worth more than the current value of your leveraged assets.One of:
buy, sellSide of the order.One of:
Default:
cancel_newest, cancel_oldest, cancel_bothDefault:
cancel_newestSelf Trade Prevention (STP) is a protection feature to prevent users from inadvertently or deliberately trading against themselves. To prevent a self-match, one of the following STP modes can be used to define which order(s) will be expired.cancel_newest: arriving order will be canceled.cancel_oldest: resting order will be canceled.cancel_both: both arriving and resting orders will be canceled.
One of:
Default:
gtc, gtd, ioc, fokDefault:
gtcTime-in-force specifies how long an order remains in effect before being expired.gtc: Good Till Canceled - until user has cancelled.gtd: Good Till Date - untilexpire_timeparameter.ioc: Immediate Or Cancel - immediately cancels back any quantity that cannot be filled on arrival.fok: Fill Or Kill - immediately fills the full order quantity or cancels it entirely. Available forlimitorders only.
Condition: Required for triggered order types onlyThe parameters for setting the trigger price conditions.
Hide properties
Hide properties
One of:
Default:
index, lastDefault:
lastThe reference price to track for triggering orders.index: the index price in the broader market (for this pair). Note, to keep triggers serviceable during connectivity issues with external index feeds, the last price will be used as the reference price.last: the last traded price in the Kraken order book (for this pair).
Specifies the amount for the trigger price - it supports both static market prices and relative prices. This field is used in combination with the
price_type field below to determine the effective trigger price.Examples:- To trigger at 29000.5 BTC/USD, use price=29000.5, price_type=static.
- To trigger when price rises by 5%, use price=5, price_type=pct.
- To trigger when price drops by 150 USD, use price=-150, price_type=quote.
trailing-stop and trailing-stop-limit order types, the price represents the reversion from the peak. It is always a positive offset value.One of:
Default:
static, pct, quoteDefault:
staticThe units for the trigger price.static: a static market price for the asset, i.e. 30000 for BTC/USD.pct: a percentage offset from the reference price, i.e. -10% from index price.quote: a notional offset from the reference price in the quote currency, i.e, 150 BTC/USD from last price.
Condition: For institutional accounts with enhanced Self Trade Prevention (STP). The
sender_sub_id parameter can be one of the following formats:Adds an alphanumeric sub-account/trader identifier which enables STP to be performed at a more granular level.- Long UUID:
6d1b345e-2821-40e2-ad83-4ecb18a0687632 hex characters separated with 4 dashes. - Short UUID:
da8e4ad59b78481c93e589746b0cf91f32 hex characters with no dashes. - Free text:
arb-20240509-00010Free format ascii text up to 18 characters.
Deprecated: Use
triggers objectThe stop price for trigger order types.One of:
Default:
Condition: Triggered order types only
Deprecated: Use
last, indexDefault:
lastCondition: Triggered order types only
Deprecated: Use
triggers objectThe reference price to trigger the order.index: the index price for the broader market for this symbol.last: the last traded price in the order book for this symbol.
Optional client originated request identifier sent as acknowledgment in the response.
The order of returned txid’s in the response array is the same as the order of the order list sent in request.
Value:
batch_addCondition: if
success is trueHide properties
Hide properties
Unique order identifier generated by Kraken.
An optional, alphanumeric identifier specified by the client in the
batch_add parameters.An optional order identifier specified by the client in the
batch_add parameters.Non-fatal warnings about the order, if any.
Error message. Condition: if
success is false.Indicates if the request was successfully processed by the engine. One of:
true, falseOptional client originated request identifier sent as acknowledgment in the response.
The timestamp when the request was received on the wire, just prior to parsing data. Format: RFC3339. Example:
2022-12-25T09:30:59.123456ZThe timestamp when the response was sent on the wire, just prior to transmitting data. Format: RFC3339. Example:
2022-12-25T09:30:59.123456Z