Balances
CHANNELwss://ws-auth.kraken.com/v2
balancesAuthentication Required
The balances
channel streams client asset balances and transactions from the account ledger.
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
balances
true
, false
] true
all
If all
, events for master and subaccounts are streamed, otherwise only master account events are published. No snapshot is provided.
MESSAGE BODY
subscribe
balances
true
, false
] true
, false
] {
"method": "subscribe",
"params": {
"channel": "balances",
"token": "G38a1tGFzqGiUCmnegBcm8d4nfP3tytiNQz6tkCBYXY"
}
}
{
"method": "subscribe",
"result": {
"channel": "balances",
"snapshot": true
},
"success": true,
"time_in": "2023-10-16T13:29:13.111530Z",
"time_out": "2023-10-16T13:29:13.111775Z"
}
Snapshot Response
The snapshot provides the value of each asset held in this account.
- Snapshot Schema
- Example: Snapshot
MESSAGE BODY
balances
snapshot
A list of assets held on account.
currency
A list of wallets for each asset.
spot
, earn
] main
, flex
, bonded
, flexible
, liquid
, locked
, closed
] {
"channel": "balances",
"data": [
{
"asset": "BTC",
"asset_class": "currency",
"balance": 1.2,
"wallets": [
{
"type": "spot",
"id": "main",
"balance": 1.2
}
]
},
{
"asset": "MATIC",
"asset_class": "currency",
"balance": 500,
"wallets": [
{
"type": "spot",
"id": "main",
"balance": 300
},
{
"type": "earn",
"id": "flex",
"balance": 200
}
]
},
{
"asset": "USD",
"asset_class": "currency",
"balance": 80595.4943,
"wallets": [
{
"type": "spot",
"id": "main",
"balance": 80595.4943
}
]
}
],
"type": "snapshot",
"sequence": 1
}
Update Response
An update will be streamed on each completed transaction to the client account.
- Update Schema
- Example: Deposit Update
- Example: Trade Update
MESSAGE BODY
balances
update
A list of account ledger transactions for each asset.
currency
ref_id
will be the trade_id
for a trade event.deposit
, withdrawal
, trade
, margin
, adjustment
, rollover
, credit
, transfer
, settled
, staking
, sale
, reserve
, conversion
, dividend
, reward
, creator_fee
] spotfromfutures
, spottofutures
, stakingfromspot
, spotfromstaking
, stakingtospot
, spottostaking
] deposit
, withdrawal
, trade
, margin-trade
, margin-settle
, margin-conversion
, conversion
, credit
, marginrollover
, staking-rewards
, instant
, equity-trade
, airdrop
, equity-dividend
, reward-bonus
, nft
, block-trade
] spot
, earn
] main
, bonded
, flexible
, liquid
, locked
] The following combinations of wallet types and wallet identifiers are available:
Wallet typespot
:main
: Primary spot pairs trading wallet.
Wallet type earn
:
bonded
: earn on-chain product with lockup period.flexible
: earn product without lockup period.liquid
: kraken rewards program, see support center.locked
: earn product (may or may not have a lockup period).
{
"channel": "balances",
"type": "update",
"data": [
{
"ledger_id": "ADKKFF-WEA5A-CNUBHG",
"ref_id": "AGBWUJRU-LAREZ-W3UFAN",
"timestamp": "2023-09-22T10:23:42.925034Z",
"type": "deposit",
"asset": "BTC",
"asset_class": "currency",
"category": "deposit",
"wallet_type": "spot",
"wallet_id": "main",
"amount": 0.01,
"fee": 0.0,
"balance": 0.02
}
],
"sequence": 2
}
An example of selling 0.005 BTC/USD, two events are streamed with a shared ref_id
. The ref_id
refers to the trade_id
in this scenario:
- BTC debit of -0.005.
- USD credit of 132.9995.
{
"channel": "balances",
"type": "update",
"data": [
{
"ledger_id": "AAICKV-NMQSR-ZO5IJD",
"ref_id": "AGBB7L-HT5LX-J3BB4A",
"timestamp": "2023-09-22T10:33:05.710082Z",
"type": "trade",
"asset": "BTC",
"asset_class": "currency",
"category": "trade",
"wallet_type": "spot",
"wallet_id": "main",
"amount": -0.005,
"fee": 0.0,
"balance": 0.005
}
],
"sequence": 9
},
{
"channel": "balances",
"type": "update",
"data": [
{
"ledger_id": "A5KS77-LQRMP-SMMN4B",
"ref_id": "AGBB7L-HT5LX-J3BB4A",
"timestamp": "2023-09-22T10:33:05.710082Z",
"type": "trade",
"asset": "USD",
"asset_class": "currency",
"category": "trade",
"wallet_type": "spot",
"wallet_id": "main",
"amount": 132.9995,
"fee": 0.3458,
"balance": 500
}
],
"sequence": 10
}
Unsubscribe Request
- Unsubscribe Schema
- Unsubscribe Ack Schema
- Example: Unsubscribe
- Example: Unsubscribe Ack
MESSAGE BODY
unsubscribe
balances
MESSAGE BODY
unsubscribe
balances
true
, false
] {
"method": "unsubscribe",
"params": {
"channel": "balances",
"token": "G38a1tGFzqGiUCmnegBcm8d4nfP3tytiNQz6tkCBYXY"
}
}
{
"method": "unsubscribe",
"result": {
"channel": "balances"
},
"success": true,
"time_in": "2023-10-16T13:29:13.111530Z",
"time_out": "2023-10-16T13:29:13.111775Z"
}