WSSfutures.kraken.com/ws/v1balances
This feed returns balance information for holding wallets, single collateral wallets and multi-collateral wallets.
Request
string
required
subscribe or unsubscribestring
required
The requested subscription feed. Value:
balancesstring
required
The user API key.
string
required
The message that is received from a challenge request.
string
required
The signed challenge message with user API secret.
{
"event": "subscribe",
"feed": "balances",
"api_key": "drUfSSmBbDpcIpwpqK0OBTcGLdAYZJU+NlPIsHaKspu/8feT2YSKl+Jw",
"original_challenge": "c094497e-9b5f-40da-a122-3751c39b107f",
"signed_challenge": "Ds0wtsHaXlAby/Vnoil59Q+yJIrJwZGUlgECD3+qEvFcTFfacJi2LrSRzAoqwBAeZk4pGXSmyyIW0uDymZ3olw=="
}
Response Success
string
One of:
subscribed, subscribed_failed, unsubscribed, unsubscribed_failedThe result.string
The requested subscription feed. Value:
balancesstring
The user API key.
string
The message that is received from a challenge request.
string
The signed challenge message with user API secret.
{
"event": "subscribed",
"feed": "balances"
}
Balances Snapshot
string
The subscribed feed.
string
The user account.
positive integer
The unix timestamp of the balance state in milliseconds.
positive integer
The subscription message sequence number.
map of floats
A map from currency names to balance quantity.
Show properties
Show properties
string
The name of the account.
string
The wallet currency pair.
string
The wallet settlement unit.
float
The current balance with haircuts and any unrealized margin from open positions in settlement units.
float
The current balance in settlement units.
positive float
The maintenance margin for open positions.
float
The initial margin for open positions and open orders.
float
The current portfolio value minus initial margin.
positive float
The total unrealized funding for open positions.
positive float
The total profit and loss for open positions.
float
The cash value of the single collateral wallet in USD.
map of structures
A map from single collateral wallet names to collateral wallet structure.
Show properties
Show properties
string
The name of the account.
string
The wallet currency pair.
string
The wallet settlement unit.
float
The current balance with haircuts and any unrealized margin from open positions in settlement units.
float
The current balance in settlement units.
positive float
The maintenance margin for open positions.
float
The initial margin for open positions and open orders.
float
The current portfolio value minus initial margin.
positive float
The total unrealized funding for open positions.
positive float
The total profit and loss for open positions.
float
The cash value of the single collateral wallet in USD.
structure
The multi-collateral wallet structure.
Show properties
Show properties
float
The current USD balance of the account.
float
The current collateral value with unrealized margin from any open positions.
float
The current USD balance with haircuts.
float
The total initial margin for open positions and open orders.
float
The total initial margin for open positions.
float
The total maintenance margin for open positions.
float
The total profit and loss for open positions.
float
The total unrealized funding for open positions.
float
The total unrealized funding and pnl.
float
The total unrealized in USD.
float
The current collateral value and unrealized margin.
float
The margin equity minus initial margin.
float
Sum of all position sizes in USD.
boolean
True if the user has unified balances enabled, false if not.
map of structures
A map from collateral wallet names to collateral wallet structure.
Show properties
Show properties
float
The currency quantity.
float
The USD value of the currency balance.
float
The current USD balance with haircuts.
float
The total available margin valued in the wallet currency.
float
The rate of reduction in the value of a collateral asset that may be used as margin.
float
The conversion spread is used to calculate conversion fee for multi-collateral wallets.
map of structures
A map from collateral wallet names to collateral wallet structure.
Show properties
Show properties
map of structures
The current margin information for cross position(s).
Show properties
Show properties
float
Initial margin for all positions plus open orders.
float
Initial margin for all positions.
float
Maintenance margin for all positions.
float
Total profit and loss for all positions.
float
Unrealized funding for all positions.
float
Unrealized funding plus pnl.
float
Total unrealized as USD.
float
Total USD balance minus initial margin of isolated positions.
float
USD balance, but with haircuts applied.
float
USD balance plus total unrealized.
float
Collateral value plus total unrealized.
float
Margin equity minus initial margin of cross and isolated positions.
float
Ratio of position size to margin equity.
float
Sum of all cross position sizes in USD.
float
Cash value sum total of the single collateral wallets in USD.
float
Cash value sum total with unrealized pnl of the single collateral wallets in USD.
{
"feed": "balances_snapshot",
"account": "4a012c31-df95-484a-9473-d51e4a0c4ae7",
"holding": {
"USDT": 4997.5012493753,
"XBT": 0.1285407184,
"ETH": 1.8714395862,
"LTC": 47.6462740614,
"GBP": 3733.488646461,
"USDC": 5001.00020004,
"USD": 5000.0,
"BCH": 16.8924625832,
"EUR": 4459.070194683,
"XRP": 7065.5399485629
},
"futures": {
"F-ETH:EUR": {
"name": "F-ETH:EUR",
"pair": "ETH/EUR",
"unit": "EUR",
"portfolio_value": 0.0,
"balance": 0.0,
"maintenance_margin": 0.0,
"initial_margin": 0.0,
"available": 0.0,
"unrealized_funding": 0.0,
"pnl": 0.0
},
"F-XBT:USD": {
"name": "F-XBT:USD",
"pair": "XBT/USD",
"unit": "XBT",
"portfolio_value": 0.0,
"balance": 0.0,
"maintenance_margin": 0.0,
"initial_margin": 0.0,
"available": 0.0,
"unrealized_funding": 0.0,
"pnl": 0.0
}
},
"flex_futures": {
"currencies": {
"USDT": {
"quantity": 0.0,
"value": 0.0,
"collateral_value": 0.0,
"available": 0.0,
"haircut": 0.0,
"conversion_spread": 0.0
},
"USD": {
"quantity": 0.0,
"value": 0.0,
"collateral_value": 0.0,
"available": 0.0,
"haircut": 0.0,
"conversion_spread": 0.0
}
},
"balance_value": 0.0,
"portfolio_value": 0.0,
"collateral_value": 0.0,
"initial_margin": 0.0,
"initial_margin_without_orders": 0.0,
"maintenance_margin": 0.0,
"pnl": 0.0,
"unrealized_funding": 0.0,
"total_unrealized": 0.0,
"total_unrealized_as_margin": 0.0,
"margin_equity": 0.0,
"available_margin": 0.0,
"isolated": {
"PF_ETHUSD": {
"initial_margin": 0.0,
"initial_margin_without_orders": 0.0,
"maintenance_margin": 0.0,
"pnl": 0.0,
"unrealized_funding": 0.0,
"total_unrealized": 0.0,
"total_unrealized_as_margin": 0.0
}
},
"cross": {
"balance_value": 9963.66,
"portfolio_value": 9963.66,
"collateral_value": 9963.66,
"initial_margin": 0.0,
"initial_margin_without_orders": 0.0,
"maintenance_margin": 0.0,
"pnl": 0.0,
"unrealized_funding": 0.0,
"total_unrealized": 0.0,
"total_unrealized_as_margin": 0.0,
"margin_equity": 9963.66,
"available_margin": 9963.66,
"effective_leverage": 0.0
}
},
"timestamp": 1640995200000,
"seq": 0
}
Balances Delta
string
The subscribed feed.
string
The user account.
positive integer
The unix timestamp of the balance state in milliseconds.
positive integer
The subscription message sequence number.
optional map of floats
A map from currency names to balance quantity.
Show properties
Show properties
string
The name of the account.
string
The wallet currency pair.
string
The wallet settlement unit.
float
The current balance with haircuts and any unrealized margin from open positions in settlement units.
float
The current balance in settlement units.
positive float
The maintenance margin for open positions.
float
The initial margin for open positions and open orders.
float
The current portfolio value minus initial margin.
positive float
The total unrealized funding for open positions.
positive float
The total profit and loss for open positions.
optional map of structures
A map from single collateral wallet names to collateral wallet structure.
Show properties
Show properties
string
The name of the account.
string
The wallet currency pair.
string
The wallet settlement unit.
float
The current balance with haircuts and any unrealized margin from open positions in settlement units.
float
The current balance in settlement units.
positive float
The maintenance margin for open positions.
float
The initial margin for open positions and open orders.
float
The current portfolio value minus initial margin.
positive float
The total unrealized funding for open positions.
positive float
The total profit and loss for open positions.
optional structure
The multi-collateral wallet structure.
Show properties
Show properties
float
The current USD balance of the account.
float
The current collateral value with unrealized margin from any open positions.
float
The current USD balance with haircuts.
float
The total initial margin for open positions and open orders.
float
The total initial margin for open positions.
float
The total maintenance margin for open positions.
float
The total profit and loss for open positions.
float
The total unrealized funding for open positions.
float
The total unrealized funding and pnl.
float
The total unrealized in USD.
float
The current collateral value and unrealized margin.
float
The margin equity minus initial margin.
float
Sum of all position sizes in USD.
boolean
True if the user has unified balances enabled, false if not.
map of structures
A map from collateral wallet names to collateral wallet structure.
Show properties
Show properties
float
The currency quantity.
float
The USD value of the currency balance.
float
The current USD balance with haircuts.
float
The total available margin valued in the wallet currency.
float
The rate of reduction in the value of a collateral asset that may be used as margin.
float
The conversion spread is used to calculate conversion fee for multi-collateral wallets.
map of structures
A map from collateral wallet names to collateral wallet structure.
Show properties
Show properties
map of structures
The current margin information for cross position(s).
Show properties
Show properties
float
Initial margin for all positions plus open orders.
float
Initial margin for all positions.
float
Maintenance margin for all positions.
float
Total profit and loss for all positions.
float
Unrealized funding for all positions.
float
Unrealized funding plus pnl.
float
Total unrealized as USD.
float
Total USD balance minus initial margin of isolated positions.
float
USD balance, but with haircuts applied.
float
USD balance plus total unrealized.
float
Collateral value plus total unrealized.
float
Margin equity minus initial margin of cross and isolated positions.
float
Ratio of position size to margin equity.
float
Sum of all cross position sizes in USD.
{
"feed": "balances",
"account": "7a641082-55c7-4411-a85f-930ec2e09617",
"holding": {
"USD": 5000.0
},
"futures": {},
"timestamp": 1640995200000,
"seq": 83
}
{
"feed": "balances",
"account": "7a641082-55c7-4411-a85f-930ec2e09617",
"flex_futures": {
"currencies": {
"USD": { "quantity": 5000.0, "value": 5000.0, "collateral_value": 5000.0, "available": 5000.0, "haircut": 0.0, "conversion_spread": 0.0 }
},
"balance_value": 5000.0,
"portfolio_value": 5000.0,
"collateral_value": 5000.0,
"initial_margin": 0.0,
"initial_margin_without_orders": 0.0,
"maintenance_margin": 0.0,
"pnl": 0.0,
"unrealized_funding": 0.0,
"total_unrealized": 0.0,
"total_unrealized_as_margin": 0.0,
"margin_equity": 5000.0,
"available_margin": 5000.0,
"isolated": {},
"cross": {
"balance": 0.0,
"portfolio_value": 0.0,
"collateral_value": 0.0,
"initial_margin": 0.0,
"initial_margin_without_orders": 0.0,
"maintenance_margin": 0.0,
"pnl": 0.0,
"unrealized_funding": 0,
"total_unrealized": 0.0,
"total_unrealized_as_margin": 0.0,
"margin_equity": 0.0,
"available_margin": 0.0,
"effective_leverage": 0.0
}
},
"timestamp": 1640995200000,
"seq": 1
}
{
"feed": "balances",
"account": "7a641082-55c7-4411-a85f-930ec2e09617",
"holding": {},
"futures": {
"F-XBT:USD": {
"name": "F-XBT:USD",
"pair": "XBT/USD",
"unit": "XBT",
"portfolio_value": 0.1219368845,
"balance": 0.1219368845,
"maintenance_margin": 0.0,
"initial_margin": 0.0,
"available": 0.1219368845,
"unrealized_funding": 0.0,
"pnl": 0.0
}
},
"timestamp": 1640995200000,
"seq": 2
}
Response Error
string
Value:
errorstring
One of:
Invalid feed, Json ErrorAn error message.{
"event": "error",
"message": "Invalid feed"
}