Wallets

Receive a snapshot and updates for any wallet events on your account.

Subscribe to the account information channel to keep track of your wallets. The account information channel provides a snapshot and updates on the wallet events in your account. The snapshot is delivered upon subscribing and any changes to your wallets 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.

Wallet events are sent with CHAN_ID = 0 and can be identified by looking at the TYPE stream field. Wallet events will use one of the following abbreviations: 'ws' (wallet snapshot) and 'wu' (wallet update).


[
  0, //CHAN_ID
  "ws", //MSG_TYPE
  [
    [
      "exchange", //WALLET_TYPE
      "SAN", //CURRENCY
      19.76, //BALANCE
      0, //UNSETTLED_INTEREST
      null, //BALANCE_AVAILABLE
      null, //Used for DESCRIPTION on 'wu' events
      null //Used for META on 'wu' events
    ] //WALLET_ARRAY
  ] //WALLET_SNAPSHOT
]

[
  0, //CHAN_ID
  "wu", //MSG_TYPE
  [ 
    "exchange", //WALLET_TYPE
    "BTC", //CURRENCY
    1.61169184, //BALANCE
    0, //UNSETTLED_INTEREST
    null, //BALANCE_AVAILABLE
    "Exchange 0.01 BTC for USD @ 7804.6", //DESCRIPTION
    {
      "reason":"TRADE",
      "order_id":34988418651,
      "order_id_oppo":34990541044,
      "trade_price":"7804.6",
      "trade_amount":"0.01"
    } //META
  ] //WALLET_ARRAY
]

Wallet snapshot data

IndexFieldTypeDescription
[0]CHANNEL_IDIntIdentification number assigned to the channel for the duration of this connection.
[1]MSG_TYPEString'ws' (wallet snapshot)
[2]WALLET_SNAPSHOTArrayArray with an array of wallet arrays(Indices [0...n] will be wallet arrays)
[2][0...n]WALLET_ARRAYArrayWallet array

Wallet update data

IndexFieldTypeDescription
[0]CHANNEL_IDIntIdentification number assigned to the channel for the duration of this connection.
[1]MSG_TYPEString'wu' (wallet update)
[2]WALLET_ARRAYArrayWallet array

Wallet array

Index Field Type Description
[0]WALLET_TYPEStringWallet name (exchange, margin, funding)
[1]CURRENCYStringCurrency (USD, etc)
[2]BALANCEFloatWallet balance
[3]UNSETTLED_INTERESTFloatUnsettled interest
[4]BALANCE_AVAILABLEFloat / NullAmount not tied up in active orders, positions or funding (null if the value has not yet been calculated).
[5]DESCRIPTIONStringDescription of the ledger entry (can be null)
[6]METAJsonProvides info on the reason for the wallet update (can be null)

📘

Important

Certain calculated values (available balance) are only updated periodically. If the value reads 'null', this means that the calculated value is not yet available.

A 'calc' request can be used to to receive an updated value. See calc input dedicated section for more details.