Edit Order
REQUESTwss://ws-auth.kraken.com/v2
edit_orderAuthentication Required
Sends a request to edit the order parameters of a live order. When an order has been successfully modified, the original order will be cancelled and a new order will be
created with the adjusted parameters a new order_id
will be returned in the response.
The new amend_order endpoint resolves the caveats listed below and has additional performance gains.
There are a number of caveats for edit_order
:
- triggered stop loss or profit take profit orders are not supported.
- orders with conditional close terms attached are not supported.
- orders where the executed volume is greater than the newly supplied volume will be rejected.
cl_ord_id
is not supported.- existing executions will are associated with the original order and not copied to the amended order.
- queue position will not be maintained.
Request
- Request Schema
- Example
MESSAGE BODY
edit_order
Range 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.
Defines the quantity to show in the book while the rest of order quantity remains hidden.
Minimum value is 1 / 15 of order_qty
.
base
, quote
] Fee preference base or quote currency. quote
is the default for buy orders, base
is the default for sell orders.
true
, false
] false
Disables 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.
order_id
.true
, false
] false
Cancels the order if it will take liquidity on arrival. Post only orders will always be posted passively in the book.
true
, false
] false
Reduces an existing margin position without opening an opposite long or short position worth more than the current value of your leveraged assets.
symbol
cannot be amended. The parameters for setting the trigger price conditions.
index
, last
] last
The 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.
Note, for trailing-stop
and trailing-stop-limit
order types, the price represents the reversion from the peak. It is always a positive offset value.
static
, pct
, quote
] static
The 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
true
, false
] false
If set to true
the order will be validated only, it will not trade in the matching engine.
{
"method": "edit_order",
"params": {
"order_id": "ORDERX-IDXXX-XXXXX1",
"order_qty": 0.2123456789,
"symbol": "BTC/USD",
"token": "TxxxxxxxxxOxxxxxxxxxxKxxxxxxxExxxxxxxxN"
},
"req_id": 1234567890
}
Response
- Response Schema
- Example
MESSAGE BODY
edit_order
true
, false
] {
"method": "edit_order",
"req_id": 1234567890,
"result": {
"order_id": "ORDERX-IDXXX-XXXXX2",
"original_order_id": "ORDERX-IDXXX-XXXXX1"
},
"success": true,
"time_in": "2022-07-15T12:56:09.876488Z",
"time_out": "2022-07-15T12:56:09.923422Z"
}