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).

[
  CHAN_ID, 
  TYPE, //'ws'
  [
    [
      WALLET_TYPE, 
      CURRENCY, 
      BALANCE, 
      UNSETTLED_INTEREST,
      BALANCE_AVAILABLE,
      ...
    ], 
    ...
  ]
]

[0,"ws",[["exchange","SAN",19.76,0,null,null,null]]]
[
  CHAN_ID, 
  TYPE, //'wu'
  [
    WALLET_TYPE, 
    CURRENCY, 
    BALANCE, 
    UNSETTLED_INTEREST,
    BALANCE_AVAILABLE,
    DESCRIPTION,
    META
  ]
]

[0,"wu",["exchange","BTC",1.61169184,0,null,"Exchange 0.01 BTC for USD @ 7804.6",{"reason":"TRADE","order_id":34988418651,"order_id_oppo":34990541044,"trade_price":"7804.6","trade_amount":"0.01"}]]

Stream Fields

TermTypeDescription
CHAN_IDintIdentification number for the channel subscribtion. Wallet events are always sent through the account information channel with CHAN_ID = 0
TYPEstring'ws' (wallet snapshot), 'wu' (wallet update)
WALLET_TYPEstringWallet name (exchange, margin, funding)
CURRENCYstringCurrency (fUSD, etc)
BALANCEfloatWallet balance
UNSETTLED_INTERESTfloatUnsettled interest
BALANCE_AVAILABLEfloat / nullAmount not tied up in active orders, positions or funding (null if the value has not yet been calculated).
DESCRIPTIONstringDescription of the ledger entry
METAjsonProvides info on the reason for the wallet update, if available.

📘

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.