Receive a snapshot and updates for any order events on your account.
Subscribe to the account information channel to keep track of your orders. The account information channel provides a snapshot and updates on the orders in your account. The snapshot is delivered upon subscribing and any changes to your orders will be provided as updates for as long as the channel remains open. Any authenticated connection is automatically subscribed to the account information channel.
Example code to open an authenticated connection can be found on our Authenticated Channels Page.
Order events are sent with CHAN_ID = 0 and can be identified by looking at the TYPE stream field. Order events will use one of the following abbreviations: 'os' (order snapshot), 'on' (order new), 'ou' (order update), and 'oc' (order cancel).
[
0, //CHAN_ID
"os", //MSG_TYPE
[
[
34930659963, //ID
null, //GID
1574955083558, //CID
"tETHUSD", //SYMBOL
1574955083558, //MTS_CREATE
1574955083573, //MTS_UPDATE
0.201104, //AMOUNT
0.201104, //AMOUNT_ORIG
"EXCHANGE LIMIT", //ORDER_TYPE
null, //TYPE_PREV
null, //MTS_TIF
null, //PLACEHOLDER
0, //FLAGS
"ACTIVE", //STATUS
null, //PLACEHOLDER
null, //PLACEHOLDER
120, //PRICE
0, //PRICE_AVG
0, //PRICE_TRAILING
0, //PRICE_AUX_LIMIT
null, //PLACEHOLDER
null, //PLACEHOLDER
null, //PLACEHOLDER
0, //NOTIFY
0, //HIDDEN
null, //PLACED_ID
null, //PLACEHOLDER
null, //PLACEHOLDER
"BFX", //ROUTING
null, //PLACEHOLDER
null, //PLACEHOLDER
{meta_object} //META
], //ORDER_ARRAY
...
] //ORDER_SNAPSHOT
]
[
0, //CHAN_ID
"oc", //MSG_TYPE
[
34930659963, //ID
null, //GID
1574955083558, //CID
"tETHUSD", //SYMBOL
1574955083558, //MTS_CREATE
1574955354487, //MTS_UPDATE
0.201104, //AMOUNT
0.201104, //AMOUNT_ORIG
"EXCHANGE LIMIT", //ORDER_TYPE
null, //TYPE_PREV
null, //MTS_TIF
null, //PLACEHOLDER
0, //FLAGS
"CANCELED", //ORDER_STATUS
null, //PLACEHOLDER
null, //PLACEHOLDER
120, //PRICE
0, //PRICE_AVG
0, //PRICE_TRAILING
0, //PRICE_AUX_LIMIT
null, //PLACEHOLDER
null, //PLACEHOLDER
null, //PLACEHOLDER
0, //NOTIFY
0, //HIDDEN
null, //PLACED_ID
null, //PLACEHOLDER
null, //PLACEHOLDER
"BFX", //ROUTING
null, //PLACEHOLDER
null, //PLACEHOLDER
{meta_object} //META
] //ORDER_ARRAY
]
Order snapshot data
Index | Field | Type | Description |
---|---|---|---|
[0] | CHANNEL_ID | Int | Identification number assigned to the channel for the duration of this connection. |
[1] | MSG_TYPE | String | 'os' (order snapshot) |
[2] | ORDER_SNAPSHOT | Array | Array with an array of active orders (Indices [0...n] will be orders) |
[2][0...n] | ORDER_ARRAY | Array | Order array |
Order update data
Index | Field | Type | Description |
---|---|---|---|
[0] | CHANNEL_ID | Int | Identification number assigned to the channel for the duration of this connection. |
[1] | MSG_TYPE | String | 'on' (order new), 'ou' (order update), 'oc' (order cancel (canceled or fully executed)). |
[2] | ORDER_ARRAY | Trade | Order array |
Order arrays
Index | Field | Type | Description |
---|---|---|---|
[0] | ID | Int | Order ID |
[1] | GID | Int | Group ID |
[2] | CID | Int | Client Order ID |
[3] | SYMBOL | String | Pair (tBTCUSD, …) |
[4] | MTS_CREATE | Int | Millisecond timestamp of creation |
[5] | MTS_UPDATE | Int | Millisecond timestamp of update |
[6] | AMOUNT | Float | Positive means buy, negative means sell. |
[7] | AMOUNT_ORIG | Float | Original amount |
[8] | ORDER_TYPE | String | The type of the order: LIMIT, MARKET, STOP, STOP LIMIT, TRAILING STOP, EXCHANGE MARKET, EXCHANGE LIMIT, EXCHANGE STOP, EXCHANGE STOP LIMIT, EXCHANGE TRAILING STOP, FOK, EXCHANGE FOK, IOC, EXCHANGE IOC. |
[9] | TYPE_PREV | String | Previous order type |
[10] | MTS_TIF | Int | Millisecond timestamp of Time-In-Force: automatic order cancellation |
[ . . . ] | |||
[12] | FLAGS | Int | See https://docs.bitfinex.com/v2/docs/flag-values |
[13] | ORDER_STATUS | String | Order Status: ACTIVE, EXECUTED @ PRICE(AMOUNT) e.g. "EXECUTED @ 107.6(-0.2)", PARTIALLY FILLED @ PRICE(AMOUNT), INSUFFICIENT MARGIN was: PARTIALLY FILLED @ PRICE(AMOUNT), CANCELED, CANCELED was: PARTIALLY FILLED @ PRICE(AMOUNT), RSN_DUST (amount is less than 0.00000001), RSN_PAUSE (trading is paused due to rebase events on AMPL or funding settlement on derivatives) |
[ . . . ] | |||
[16] | PRICE | Float | Price |
[17] | PRICE_AVG | Float | Average price |
[18] | PRICE_TRAILING | Float | The trailing price |
[19] | PRICE_AUX_LIMIT | Float | Auxiliary Limit price (for STOP LIMIT) |
[ . . . ] | |||
[23] | NOTIFY | Int | 0 if false, 1 if true |
[24] | HIDDEN | Int | 1 if Hidden, 0 if not hidden |
[25] | PLACED_ID | Int | If another order caused this order to be placed (OCO) this will be that other order's ID |
[ . . . ] | |||
[28] | ROUTING | String | Indicates origin of action: BFX |
[ . . . ] | |||
[31] | META | Json string | Additional meta information about the order (e.g., $F7 = IS_POST_ONLY (0 if false, 1 if true), $F33 = Leverage (int), aff_code: "aff_code_here") |
Multiple Flags
The summation of flags may result in multiple flags. For example 4160 (64 + 4096) means hidden post only.