> ## Documentation Index
> Fetch the complete documentation index at: https://docs.kraken.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Balances

> Subscribe to balance information for holding, single collateral, and multi-collateral wallets

<div className="api-banner">
  <span className="api-protocol ws">WSS</span>
  <span className="api-detail">futures.kraken.com/ws/v1</span>
  <span className="api-tag">balances</span>
</div>

This feed returns balance information for holding wallets, single collateral wallets and multi-collateral wallets.

***

## Request

<ResponseField name="event" type="string" required>
  `subscribe` or `unsubscribe`
</ResponseField>

<ResponseField name="feed" type="string" required>
  The requested subscription feed. Value: `balances`
</ResponseField>

<ResponseField name="api_key" type="string" required>
  The user API key.
</ResponseField>

<ResponseField name="original_challenge" type="string" required>
  The message that is received from a challenge request.
</ResponseField>

<ResponseField name="signed_challenge" type="string" required>
  The signed challenge message with user API secret.
</ResponseField>

<CodeGroup>
  ```json Example theme={null}
  {
    "event": "subscribe",
    "feed": "balances",
    "api_key": "drUfSSmBbDpcIpwpqK0OBTcGLdAYZJU+NlPIsHaKspu/8feT2YSKl+Jw",
    "original_challenge": "c094497e-9b5f-40da-a122-3751c39b107f",
    "signed_challenge": "Ds0wtsHaXlAby/Vnoil59Q+yJIrJwZGUlgECD3+qEvFcTFfacJi2LrSRzAoqwBAeZk4pGXSmyyIW0uDymZ3olw=="
  }
  ```
</CodeGroup>

***

## Response Success

<ResponseField name="event" type="string">
  <span className="field-attr">One of:</span> `subscribed`, `subscribed_failed`, `unsubscribed`, `unsubscribed_failed`

  The result.
</ResponseField>

<ResponseField name="feed" type="string">
  The requested subscription feed. Value: `balances`
</ResponseField>

<ResponseField name="api_key" type="string">
  The user API key.
</ResponseField>

<ResponseField name="original_challenge" type="string">
  The message that is received from a challenge request.
</ResponseField>

<ResponseField name="signed_challenge" type="string">
  The signed challenge message with user API secret.
</ResponseField>

<CodeGroup>
  ```json Example theme={null}
  {
    "event": "subscribed",
    "feed": "balances"
  }
  ```
</CodeGroup>

***

## Balances Snapshot

<ResponseField name="feed" type="string">
  The subscribed feed.
</ResponseField>

<ResponseField name="account" type="string">
  The user account.
</ResponseField>

<ResponseField name="timestamp" type="positive integer">
  The unix timestamp of the balance state in milliseconds.
</ResponseField>

<ResponseField name="seq" type="positive integer">
  The subscription message sequence number.
</ResponseField>

<ResponseField name="holding" type="map of floats">
  A map from currency names to balance quantity.

  <Expandable title="properties">
    <ResponseField name="name" type="string">The name of the account.</ResponseField>
    <ResponseField name="pair" type="string">The wallet currency pair.</ResponseField>
    <ResponseField name="unit" type="string">The wallet settlement unit.</ResponseField>
    <ResponseField name="portfolio_value" type="float">The current balance with haircuts and any unrealized margin from open positions in settlement units.</ResponseField>
    <ResponseField name="balance" type="float">The current balance in settlement units.</ResponseField>
    <ResponseField name="maintenance_margin" type="positive float">The maintenance margin for open positions.</ResponseField>
    <ResponseField name="initial_margin" type="float">The initial margin for open positions and open orders.</ResponseField>
    <ResponseField name="available" type="float">The current portfolio value minus initial margin.</ResponseField>
    <ResponseField name="unrealized_funding" type="positive float">The total unrealized funding for open positions.</ResponseField>
    <ResponseField name="pnl" type="positive float">The total profit and loss for open positions.</ResponseField>
    <ResponseField name="cash_value" type="float">The cash value of the single collateral wallet in USD.</ResponseField>
  </Expandable>
</ResponseField>

<ResponseField name="futures" type="map of structures">
  A map from single collateral wallet names to collateral wallet structure.

  <Expandable title="properties">
    <ResponseField name="name" type="string">The name of the account.</ResponseField>
    <ResponseField name="pair" type="string">The wallet currency pair.</ResponseField>
    <ResponseField name="unit" type="string">The wallet settlement unit.</ResponseField>
    <ResponseField name="portfolio_value" type="float">The current balance with haircuts and any unrealized margin from open positions in settlement units.</ResponseField>
    <ResponseField name="balance" type="float">The current balance in settlement units.</ResponseField>
    <ResponseField name="maintenance_margin" type="positive float">The maintenance margin for open positions.</ResponseField>
    <ResponseField name="initial_margin" type="float">The initial margin for open positions and open orders.</ResponseField>
    <ResponseField name="available" type="float">The current portfolio value minus initial margin.</ResponseField>
    <ResponseField name="unrealized_funding" type="positive float">The total unrealized funding for open positions.</ResponseField>
    <ResponseField name="pnl" type="positive float">The total profit and loss for open positions.</ResponseField>
    <ResponseField name="cash_value" type="float">The cash value of the single collateral wallet in USD.</ResponseField>
  </Expandable>
</ResponseField>

<ResponseField name="flex_futures" type="structure">
  The multi-collateral wallet structure.

  <Expandable title="properties">
    <ResponseField name="balance_value" type="float">The current USD balance of the account.</ResponseField>
    <ResponseField name="portfolio_value" type="float">The current collateral value with unrealized margin from any open positions.</ResponseField>
    <ResponseField name="collateral_value" type="float">The current USD balance with haircuts.</ResponseField>
    <ResponseField name="initial_margin" type="float">The total initial margin for open positions and open orders.</ResponseField>
    <ResponseField name="initial_margin_without_orders" type="float">The total initial margin for open positions.</ResponseField>
    <ResponseField name="maintenance_margin" type="float">The total maintenance margin for open positions.</ResponseField>
    <ResponseField name="pnl" type="float">The total profit and loss for open positions.</ResponseField>
    <ResponseField name="unrealized_funding" type="float">The total unrealized funding for open positions.</ResponseField>
    <ResponseField name="total_unrealized" type="float">The total unrealized funding and pnl.</ResponseField>
    <ResponseField name="total_unrealized_as_margin" type="float">The total unrealized in USD.</ResponseField>
    <ResponseField name="margin_equity" type="float">The current collateral value and unrealized margin.</ResponseField>
    <ResponseField name="available_margin" type="float">The margin equity minus initial margin.</ResponseField>
    <ResponseField name="total_position_size" type="float">Sum of all position sizes in USD.</ResponseField>
    <ResponseField name="unified_balances" type="boolean">True if the user has unified balances enabled, false if not.</ResponseField>

    <ResponseField name="currencies" type="map of structures">
      A map from collateral wallet names to collateral wallet structure.

      <Expandable title="properties">
        <ResponseField name="quantity" type="float">The currency quantity.</ResponseField>
        <ResponseField name="value" type="float">The USD value of the currency balance.</ResponseField>
        <ResponseField name="collateral_value" type="float">The current USD balance with haircuts.</ResponseField>
        <ResponseField name="available" type="float">The total available margin valued in the wallet currency.</ResponseField>
        <ResponseField name="haircut" type="float">The rate of reduction in the value of a collateral asset that may be used as margin.</ResponseField>
        <ResponseField name="conversion_spread" type="float">The conversion spread is used to calculate conversion fee for multi-collateral wallets.</ResponseField>
      </Expandable>
    </ResponseField>

    <ResponseField name="isolated" type="map of structures">
      A map from collateral wallet names to collateral wallet structure.

      <Expandable title="properties">
        <ResponseField name="initial_margin" type="float">Initial margin for any position plus open orders.</ResponseField>
        <ResponseField name="initial_margin_without_orders" type="float">Initial margin for any position.</ResponseField>
        <ResponseField name="maintenance_margin" type="float">Maintenance margin for any position.</ResponseField>
        <ResponseField name="pnl" type="float">Total profit and loss for any position.</ResponseField>
        <ResponseField name="unrealized_funding" type="float">Unrealized funding for any position.</ResponseField>
        <ResponseField name="total_unrealized" type="float">Unrealized funding plus pnl.</ResponseField>
        <ResponseField name="total_unrealized_as_margin" type="float">Total unrealized as USD.</ResponseField>
      </Expandable>
    </ResponseField>

    <ResponseField name="cross" type="map of structures">
      The current margin information for cross position(s).

      <Expandable title="properties">
        <ResponseField name="initial_margin" type="float">Initial margin for all positions plus open orders.</ResponseField>
        <ResponseField name="initial_margin_without_orders" type="float">Initial margin for all positions.</ResponseField>
        <ResponseField name="maintenance_margin" type="float">Maintenance margin for all positions.</ResponseField>
        <ResponseField name="pnl" type="float">Total profit and loss for all positions.</ResponseField>
        <ResponseField name="unrealized_funding" type="float">Unrealized funding for all positions.</ResponseField>
        <ResponseField name="total_unrealized" type="float">Unrealized funding plus pnl.</ResponseField>
        <ResponseField name="total_unrealized_as_margin" type="float">Total unrealized as USD.</ResponseField>
        <ResponseField name="balance_value" type="float">Total USD balance minus initial margin of isolated positions.</ResponseField>
        <ResponseField name="collateral_value" type="float">USD balance, but with haircuts applied.</ResponseField>
        <ResponseField name="portfolio_value" type="float">USD balance plus total unrealized.</ResponseField>
        <ResponseField name="margin_equity" type="float">Collateral value plus total unrealized.</ResponseField>
        <ResponseField name="available_margin" type="float">Margin equity minus initial margin of cross and isolated positions.</ResponseField>
        <ResponseField name="effective_leverage" type="float">Ratio of position size to margin equity.</ResponseField>
        <ResponseField name="total_position_size" type="float">Sum of all cross position sizes in USD.</ResponseField>

        <ResponseField name="portfolio_margin_breakdown" type="map of structures">
          A breakdown of the portfolio margin calculation components.

          <Expandable title="properties">
            <ResponseField name="market_risk" type="float">Non-delta market risk of the portfolio.</ResponseField>
            <ResponseField name="abs_options_delta" type="float">Absolute options delta of the portfolio.</ResponseField>
            <ResponseField name="net_position_delta" type="float">Net position delta of the portfolio.</ResponseField>
            <ResponseField name="futures_maintenance_margin" type="float">Total maintenance margin of all futures positions in the portfolio.</ResponseField>
          </Expandable>
        </ResponseField>
      </Expandable>
    </ResponseField>
  </Expandable>
</ResponseField>

<ResponseField name="futures_cash_value" type="float">
  Cash value sum total of the single collateral wallets in USD.
</ResponseField>

<ResponseField name="futures_upnl_cash_value" type="float">
  Cash value sum total with unrealized pnl of the single collateral wallets in USD.
</ResponseField>

<CodeGroup>
  ```json Example theme={null}
  {
    "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
  }
  ```
</CodeGroup>

***

## Balances Delta

<ResponseField name="feed" type="string">
  The subscribed feed.
</ResponseField>

<ResponseField name="account" type="string">
  The user account.
</ResponseField>

<ResponseField name="timestamp" type="positive integer">
  The unix timestamp of the balance state in milliseconds.
</ResponseField>

<ResponseField name="seq" type="positive integer">
  The subscription message sequence number.
</ResponseField>

<ResponseField name="holding" type="optional map of floats">
  A map from currency names to balance quantity.

  <Expandable title="properties">
    <ResponseField name="name" type="string">The name of the account.</ResponseField>
    <ResponseField name="pair" type="string">The wallet currency pair.</ResponseField>
    <ResponseField name="unit" type="string">The wallet settlement unit.</ResponseField>
    <ResponseField name="portfolio_value" type="float">The current balance with haircuts and any unrealized margin from open positions in settlement units.</ResponseField>
    <ResponseField name="balance" type="float">The current balance in settlement units.</ResponseField>
    <ResponseField name="maintenance_margin" type="positive float">The maintenance margin for open positions.</ResponseField>
    <ResponseField name="initial_margin" type="float">The initial margin for open positions and open orders.</ResponseField>
    <ResponseField name="available" type="float">The current portfolio value minus initial margin.</ResponseField>
    <ResponseField name="unrealized_funding" type="positive float">The total unrealized funding for open positions.</ResponseField>
    <ResponseField name="pnl" type="positive float">The total profit and loss for open positions.</ResponseField>
  </Expandable>
</ResponseField>

<ResponseField name="futures" type="optional map of structures">
  A map from single collateral wallet names to collateral wallet structure.

  <Expandable title="properties">
    <ResponseField name="name" type="string">The name of the account.</ResponseField>
    <ResponseField name="pair" type="string">The wallet currency pair.</ResponseField>
    <ResponseField name="unit" type="string">The wallet settlement unit.</ResponseField>
    <ResponseField name="portfolio_value" type="float">The current balance with haircuts and any unrealized margin from open positions in settlement units.</ResponseField>
    <ResponseField name="balance" type="float">The current balance in settlement units.</ResponseField>
    <ResponseField name="maintenance_margin" type="positive float">The maintenance margin for open positions.</ResponseField>
    <ResponseField name="initial_margin" type="float">The initial margin for open positions and open orders.</ResponseField>
    <ResponseField name="available" type="float">The current portfolio value minus initial margin.</ResponseField>
    <ResponseField name="unrealized_funding" type="positive float">The total unrealized funding for open positions.</ResponseField>
    <ResponseField name="pnl" type="positive float">The total profit and loss for open positions.</ResponseField>
  </Expandable>
</ResponseField>

<ResponseField name="flex_futures" type="optional structure">
  The multi-collateral wallet structure.

  <Expandable title="properties">
    <ResponseField name="balance_value" type="float">The current USD balance of the account.</ResponseField>
    <ResponseField name="portfolio_value" type="float">The current collateral value with unrealized margin from any open positions.</ResponseField>
    <ResponseField name="collateral_value" type="float">The current USD balance with haircuts.</ResponseField>
    <ResponseField name="initial_margin" type="float">The total initial margin for open positions and open orders.</ResponseField>
    <ResponseField name="initial_margin_without_orders" type="float">The total initial margin for open positions.</ResponseField>
    <ResponseField name="maintenance_margin" type="float">The total maintenance margin for open positions.</ResponseField>
    <ResponseField name="pnl" type="float">The total profit and loss for open positions.</ResponseField>
    <ResponseField name="unrealized_funding" type="float">The total unrealized funding for open positions.</ResponseField>
    <ResponseField name="total_unrealized" type="float">The total unrealized funding and pnl.</ResponseField>
    <ResponseField name="total_unrealized_as_margin" type="float">The total unrealized in USD.</ResponseField>
    <ResponseField name="margin_equity" type="float">The current collateral value and unrealized margin.</ResponseField>
    <ResponseField name="available_margin" type="float">The margin equity minus initial margin.</ResponseField>
    <ResponseField name="total_position_size" type="float">Sum of all position sizes in USD.</ResponseField>
    <ResponseField name="unified_balances" type="boolean">True if the user has unified balances enabled, false if not.</ResponseField>

    <ResponseField name="currencies" type="map of structures">
      A map from collateral wallet names to collateral wallet structure.

      <Expandable title="properties">
        <ResponseField name="quantity" type="float">The currency quantity.</ResponseField>
        <ResponseField name="value" type="float">The USD value of the currency balance.</ResponseField>
        <ResponseField name="collateral_value" type="float">The current USD balance with haircuts.</ResponseField>
        <ResponseField name="available" type="float">The total available margin valued in the wallet currency.</ResponseField>
        <ResponseField name="haircut" type="float">The rate of reduction in the value of a collateral asset that may be used as margin.</ResponseField>
        <ResponseField name="conversion_spread" type="float">The conversion spread is used to calculate conversion fee for multi-collateral wallets.</ResponseField>
      </Expandable>
    </ResponseField>

    <ResponseField name="isolated" type="map of structures">
      A map from collateral wallet names to collateral wallet structure.

      <Expandable title="properties">
        <ResponseField name="initial_margin" type="float">Initial margin for any position plus open orders.</ResponseField>
        <ResponseField name="initial_margin_without_orders" type="float">Initial margin for any position.</ResponseField>
        <ResponseField name="maintenance_margin" type="float">Maintenance margin for any position.</ResponseField>
        <ResponseField name="pnl" type="float">Total profit and loss for any position.</ResponseField>
        <ResponseField name="unrealized_funding" type="float">Unrealized funding for any position.</ResponseField>
        <ResponseField name="total_unrealized" type="float">Unrealized funding plus pnl.</ResponseField>
        <ResponseField name="total_unrealized_as_margin" type="float">Total unrealized as USD.</ResponseField>
      </Expandable>
    </ResponseField>

    <ResponseField name="cross" type="map of structures">
      The current margin information for cross position(s).

      <Expandable title="properties">
        <ResponseField name="initial_margin" type="float">Initial margin for all positions plus open orders.</ResponseField>
        <ResponseField name="initial_margin_without_orders" type="float">Initial margin for all positions.</ResponseField>
        <ResponseField name="maintenance_margin" type="float">Maintenance margin for all positions.</ResponseField>
        <ResponseField name="pnl" type="float">Total profit and loss for all positions.</ResponseField>
        <ResponseField name="unrealized_funding" type="float">Unrealized funding for all positions.</ResponseField>
        <ResponseField name="total_unrealized" type="float">Unrealized funding plus pnl.</ResponseField>
        <ResponseField name="total_unrealized_as_margin" type="float">Total unrealized as USD.</ResponseField>
        <ResponseField name="balance_value" type="float">Total USD balance minus initial margin of isolated positions.</ResponseField>
        <ResponseField name="collateral_value" type="float">USD balance, but with haircuts applied.</ResponseField>
        <ResponseField name="portfolio_value" type="float">USD balance plus total unrealized.</ResponseField>
        <ResponseField name="margin_equity" type="float">Collateral value plus total unrealized.</ResponseField>
        <ResponseField name="available_margin" type="float">Margin equity minus initial margin of cross and isolated positions.</ResponseField>
        <ResponseField name="effective_leverage" type="float">Ratio of position size to margin equity.</ResponseField>
        <ResponseField name="total_position_size" type="float">Sum of all cross position sizes in USD.</ResponseField>
      </Expandable>
    </ResponseField>
  </Expandable>
</ResponseField>

<CodeGroup>
  ```json Example: Holding Wallet Delta theme={null}
  {
    "feed": "balances",
    "account": "7a641082-55c7-4411-a85f-930ec2e09617",
    "holding": {
      "USD": 5000.0
    },
    "futures": {},
    "timestamp": 1640995200000,
    "seq": 83
  }
  ```

  ```json Example: Multi-Collateral Delta theme={null}
  {
    "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
  }
  ```

  ```json Example: Single-Collateral Delta theme={null}
  {
    "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
  }
  ```
</CodeGroup>

***

## Response Error

<ResponseField name="event" type="string">
  Value: `error`
</ResponseField>

<ResponseField name="message" type="string">
  <span className="field-attr">One of:</span> `Invalid feed`, `Json Error`

  An error message.
</ResponseField>

<CodeGroup>
  ```json Example theme={null}
  {
    "event": "error",
    "message": "Invalid feed"
  }
  ```
</CodeGroup>
