Executions
CHANNELwss://ws-auth.kraken.com/v2
executionsAuthentication Required
The executions
channel streams order status and execution events for this account.
It corresponds to a combination of the following Websockets v1 channels: openOrders
and ownTrades
.
This channel contains account specific data, an authentication token is required in the request.
Subscribe Request
- Subscribe Schema
- Subscribe Ack Schema
- Example: Subscribe
- Example: Subscribe Ack
MESSAGE BODY
subscribe
executions
true
, false
] false
If true
, the last 50 order fills will be included in snapshot.
true
, false
] true
If true
, open orders will be included in snapshot.
true
, false
] true
If true
, all possible status transitions will be sent. Otherwise, only open / close transitions will be streamed: new
, filled
, canceled
, expired
.
true
, false
] false
If true
, the rate-limit counter is included in the stream.
true
, false
] If true
, snapshot provides only trade events. Otherwise, open orders and trades will be included in snapshot.
true
, false
] MESSAGE BODY
subscribe
executions
true
, false
] true
, false
] true
, false
] {
"method": "subscribe",
"params": {
"channel": "executions",
"token": "G38a1tGFzqGiUCmnegBcm8d4nfP3tytiNQz6tkCBYXY",
"snap_orders": true,
"snap_trades": true
}
}
{
"method": "subscribe",
"result": {
"channel": "executions",
"maxratecount": 125,
"snap_orders": true,
"snap_trades": true
},
"success": true,
"time_in": "2023-10-16T13:18:35.303171Z",
"time_out": "2023-10-16T13:18:35.318297Z"
}
Snapshot / Update Responses
The snapshot and update stream share the same data schema, the fields included in the message is dependant on the exec_type
.
By default, the snapshot response contains all open orders and latest 50 trades.
The snapshot message content can be adjusted with the subscription parameters.
- Snapshot / Update Schema
- Example: Pending
- Example: Live Order
- Example: Execution
MESSAGE BODY
executions
snapshot
, update
] A list of execution reports: order status and fills.
true
, false
] OrderAmends
endpoint. This field is present in the snapshot and the amended
, restated
event types.The contingent object describes the template for generating the secondary close orders when the primary order fills.
limit
, stop-loss
, stop-loss-limit
, take-profit
, take-profit-limit
, trailing-stop
, trailing-stop-limit
] Describes the order type of the secondary orders which will be created on each fill.
Describes the trigger price amount on the secondary orders.
This field is used in combination with the contingent.trigger_price_type
field to determine the effective trigger price.
static
, pct
, quote
] Describes trigger price units on the secondary orders.
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
Describes limit price amount on the secondary orders.
This field is used in combination with the contingent.limit_price_type
field to determine the effective limit price.
static
, pct
, quote
] Describes limit price units on the secondary orders.
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
pending_new
, new
, trade
, filled
, iceberg_refill
, canceled
, expired
, restated
, status
] Describes the type of order event and determines the set of fields in the message.
-
pending_new
: Order request has been received and validated but the order is not live yet. -
new
: Order has been created and is live in the engine. -
trade
: The order has received a fill. -
filled
: The order has been fully filled. -
canceled
: The order has been cancelled. -
iceberg_refill
: Indicates an Iceberg order refill. -
expired
: The order has expired. -
amended
: There is a user initiated amend on the order, i.e. limit price change. -
restated
: There is a engine initiated amend on the order for maintenance of position or book, seereason
field, i.e. reduce non-tradable liquidity. -
status
: The order has a status update, i.e. trigger price has been updated.
The fees paid on this trade event. Currently, the fees are expressed in the quote currency only.
The preferred currency for paying fees.
fcib
: prefer fee in base currency.fciq
: prefer fee in quote currency.
m
, t
] t
taker, m
maker.limit
, market
, iceberg
, stop-loss
, stop-loss-limit
, take-profit
, take-profit-limit
, trailing-stop
, trailing-stop-limit
, settle-position
] Describes current state of the order.
-
pending_new
: Order has been received but not yet created by the engine. -
new
: Order is live but has no fills. -
partially_filled
: Order is live and some fills. -
filled
: The order has been fully filled. -
canceled
: The order has been cancelled. -
expired
: The order has expired.
true
, false
] opened
, closing
, closed
] true
, false
] buy
, sell
] GTC
, GTD
, IOC
] Time-in-force specifies how long an order remains in effect before being expired.
GTC
: Good Till CanceledGTD
: Good Till DateIOC
: Immediate Or Cancel
Describes the parameters and status of the price trigger for triggered order types.
index
, last
] 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.
static
, pct
, quote
] 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
trailing-stop
and trailing-stop-limit
orders.triggered
, untriggered
] triggered
when the trigger conditions are met and the order becomes active.index
, last
] {
"channel": "executions",
"type": "update",
"data": [
{
"order_id": "OK4GJX-KSTLS-7DZZO5",
"order_userref": 3,
"symbol": "BTC/USD",
"order_qty": 0.005,
"cum_cost": 0.0,
"time_in_force": "GTC",
"exec_type": "pending_new",
"side": "sell",
"order_type": "limit",
"limit_price_type": "static",
"limit_price": 26500.0,
"stop_price": 0.0,
"order_status": "pending_new",
"fee_usd_equiv": 0.0,
"fee_ccy_pref": "fciq",
"timestamp": "2023-09-22T10:33:05.709950Z"
}
],
"sequence": 8
}
{
"channel": "executions",
"type": "update",
"data": [
{
"timestamp": "2023-09-22T10:33:05.709982Z",
"order_status": "new",
"exec_type": "new",
"order_userref": 3,
"order_id": "OK4GJX-KSTLS-7DZZO5"
}
],
"sequence": 9
}
{
"channel": "executions",
"type": "update",
"data": [
{
"order_id": "OK4GJX-KSTLS-7DZZO5",
"order_userref": 3,
"exec_id": "TGBB7L-HT5LX-J3BZ4A",
"exec_type": "trade",
"trade_id": 62887576,
"symbol": "BTC/USD",
"side": "sell",
"last_qty": 0.005,
"last_price": 26599.9,
"liquidity_ind": "t",
"cost": 132.9995,
"order_type": "limit",
"timestamp": "2023-09-22T10:33:05.709993Z",
"order_status": "partially_filled",
"cum_qty": 0.005,
"cum_cost": 132.9995,
"avg_price": 26599.9,
"fee_usd_equiv": 0.3458,
"fees": [
{
"asset": "USD",
"qty": 0.3458
}
]
}
],
"sequence": 10
}
Unsubscribe Request
- Unsubscribe Schema
- Unsubscribe Ack Schema
- Example: Unsubscribe
- Example: Unsubscribe Ack
MESSAGE BODY
unsubscribe
executions
MESSAGE BODY
unsubscribe
executions
true
, false
] {
"method": "unsubscribe",
"params": {
"channel": "executions",
"token": "G38a1tGFzqGiUCmnegBcm8d4nfP3tytiNQz6tkCBYXY"
}
}
{
"method": "unsubscribe",
"result": {
"channel": "executions"
},
"success": true,
"time_in": "2023-10-16T13:18:35.303171Z",
"time_out": "2023-10-16T13:18:35.318297Z"
}