Skip to content
Get started

Get Account Balances

AccountGetAccountBalancesResponse v1().accounts().getAccountBalances(AccountGetAccountBalancesParamsparams = AccountGetAccountBalancesParams.none(), RequestOptionsrequestOptions = RequestOptions.none())
GET/v1/accounts/{account_id}/balances

Fetch account balance information

ParametersExpand Collapse
AccountGetAccountBalancesParams params
Optional<Long> accountId
Optional<Long> topMarginContributorsLimit

Limit the number of top margin contributors returned by the engine.

formatint32
minimum1
ReturnsExpand Collapse
class AccountGetAccountBalancesResponse:

Represents the balance details for a trading account

long accountId

The unique identifier for the account

formatint64
String buyingPower

The total buying power available in the account.

String currency

Currency identifier for all monetary values.

String dailyRealizedPnl

Realized profit or loss since start of day.

String dailyTotalPnl

Total profit or loss since start of day.

String dailyUnrealizedPnl

Total unrealized profit or loss across all positions relative to prior close.

String equity

The total equity in the account.

String longMarketValue

The total market value of all long positions.

MarginType marginType

The applicable margin model for the account

One of the following:
OTHER("OTHER")
NONE("NONE")
PORTFOLIO_MARGIN("PORTFOLIO_MARGIN")
RISK_BASED_HAIRCUT_BROKER_DEALER("RISK_BASED_HAIRCUT_BROKER_DEALER")
REG_T("REG_T")
RISK_BASED_HAIRCUT_MARKET_MAKER("RISK_BASED_HAIRCUT_MARKET_MAKER")
CIRO("CIRO")
FUTURES_NLV("FUTURES_NLV")
FUTURES_TOT_EQ("FUTURES_TOT_EQ")
String openOrderAdjustment

Signed buying-power correction from open orders.

String settledCash

The amount of cash that is settled and available for withdrawal or trading.

Start-of-day snapshot balances.

String buyingPower

Start-of-day buying power.

String equity

Start-of-day equity.

String longMarketValue

Start-of-day long market value.

String shortMarketValue

Start-of-day short market value.

Optional<LocalDate> asof

Timestamp for the start-of-day values.

formatdate
Optional<String> dayTradeBuyingPower

Start-of-day day-trade buying power.

Optional<String> maintenanceMarginExcess

Start-of-day maintenance margin excess.

Optional<String> maintenanceMarginRequirement

Start-of-day maintenance margin requirement.

Optional<String> tradeCash

Start-of-day trade cash.

String tradeCash

Trade-date effective cash.

String unsettledCredits

Trade-date unsettled cash credits.

String unsettledDebits

Trade-date unsettled cash debits.

String withdrawableCash

The amount of cash currently available to withdraw.

Optional<MarginDetails> marginDetails

Margin-account-only details.

long dayTradeCount

The number of day trades executed over the 5 most recent trading days.

formatint32
minimum0
String initialMarginExcess

Initial margin excess for trade-date balances.

String initialMarginRequirement

Initial margin requirement for trade-date balances.

String maintenanceMarginExcess

Maintenance margin excess for trade-date balances.

String maintenanceMarginRequirement

Maintenance margin requirement for trade-date balances.

boolean patternDayTrader

true if the account is currently flagged as a PDT, otherwise false.

Optional<String> dayTradeBuyingPowerUsage

The amount of day-trade buying power used during the current trading day.

Optional<List<MarginTopContributor>> topContributors

Optional top margin contributors, returned only when explicitly requested.

String dayTradeBuyingPowerUsage

Day-trade buying power consumed by fills against this underlying on the current trade date. Populated only for pattern day trader accounts.

String initialMarginRequirement

Initial margin requirement attributable to this underlying.

String maintenanceMarginRequirement

Maintenance margin requirement attributable to this underlying.

String marketValue

Net market value attributable to this underlying.

String underlyingInstrumentId

UUID of the underlying security contributing to margin requirement.

formatuuid
Optional<MarginDetailsUsage> usage

Current usage totals.

String total

The total margin available in the current model.

String used

The amount of margin that is currently being utilized.

Optional<String> multiplier

Applied multiplier for margin calculations.

Optional<String> shortMarketValue

The total market value of all short positions.

Get Account Balances

package com.clear_street.api.example;

import com.clear_street.api.client.ClearStreetClient;
import com.clear_street.api.client.okhttp.ClearStreetOkHttpClient;
import com.clear_street.api.models.v1.accounts.AccountGetAccountBalancesParams;
import com.clear_street.api.models.v1.accounts.AccountGetAccountBalancesResponse;

public final class Main {
    private Main() {}

    public static void main(String[] args) {
        ClearStreetClient client = ClearStreetOkHttpClient.builder()
            .fromEnv()
            .apiKey("My API Key")
            .build();

        AccountGetAccountBalancesResponse response = client.v1().accounts().getAccountBalances(0L);
    }
}
{
  "data": {
    "account_id": 19816,
    "buying_power": "45000.00",
    "currency": "USD",
    "daily_realized_pnl": "700.00",
    "daily_total_pnl": "1250.00",
    "daily_unrealized_pnl": "550.00",
    "equity": "100000.00",
    "long_market_value": "30000.00",
    "margin_type": "NONE",
    "open_order_adjustment": "-5000.00",
    "settled_cash": "60000.00",
    "sod": {
      "asof": "2023-09-27",
      "buying_power": "45000.00",
      "equity": "100000.00",
      "long_market_value": "30000.00"
    },
    "trade_cash": "60000.00",
    "unsettled_credits": "20000.00",
    "unsettled_debits": "10000.00",
    "withdrawable_cash": "55000.00"
  },
  "error": null,
  "metadata": {
    "request_id": "b7e2d3f4-a1b2-4c3d-8e4f-5a6b7c8d9e0f"
  }
}
{
  "data": {
    "account_id": 19816,
    "buying_power": "90000.00",
    "currency": "USD",
    "daily_realized_pnl": "700.00",
    "daily_total_pnl": "1250.00",
    "daily_unrealized_pnl": "550.00",
    "equity": "100000.00",
    "long_market_value": "40000.00",
    "margin_details": {
      "day_trade_buying_power_usage": "0.00",
      "day_trade_count": 2,
      "initial_margin_excess": "50000.00",
      "initial_margin_requirement": "50000.00",
      "maintenance_margin_excess": "75000.00",
      "maintenance_margin_requirement": "25000.00",
      "pattern_day_trader": false,
      "top_contributors": [
        {
          "initial_margin_requirement": "25000.00",
          "maintenance_margin_requirement": "15000.00",
          "market_value": "50000.00",
          "underlying_instrument_id": "a1a2a3a4-b1b2-c1c2-d1d2-d3d4d5d6d7d8"
        }
      ],
      "usage": {
        "total": "100000.00",
        "used": "5000.00"
      }
    },
    "margin_type": "REG_T",
    "multiplier": "2",
    "open_order_adjustment": "-10000.00",
    "settled_cash": "99775.05",
    "short_market_value": "10000.00",
    "sod": {
      "asof": "2023-09-27",
      "buying_power": "90000.00",
      "day_trade_buying_power": "200000.00",
      "equity": "100000.00",
      "long_market_value": "40000.00",
      "maintenance_margin_excess": "50000.00",
      "maintenance_margin_requirement": "50000.00",
      "short_market_value": "10000.00",
      "trade_cash": "70000.00"
    },
    "trade_cash": "70000.00",
    "unsettled_credits": "20000.00",
    "unsettled_debits": "10000.00",
    "withdrawable_cash": "75000.00"
  },
  "error": null,
  "metadata": {
    "request_id": "b7e2d3f4-a1b2-4c3d-8e4f-5a6b7c8d9e0f"
  }
}
{
  "error": {
    "code": 403,
    "message": "The caller does not have permission to execute the specified operation"
  },
  "metadata": {
    "request_id": "5518f0c6-58ff-4b4a-81a5-701556d41206"
  }
}
{
  "error": {
    "code": 404,
    "message": "Some requested entity was not found"
  },
  "metadata": {
    "request_id": "67e95eb4-93b9-4010-8c9b-7ada7c2be93f"
  }
}
Returns Examples
{
  "data": {
    "account_id": 19816,
    "buying_power": "45000.00",
    "currency": "USD",
    "daily_realized_pnl": "700.00",
    "daily_total_pnl": "1250.00",
    "daily_unrealized_pnl": "550.00",
    "equity": "100000.00",
    "long_market_value": "30000.00",
    "margin_type": "NONE",
    "open_order_adjustment": "-5000.00",
    "settled_cash": "60000.00",
    "sod": {
      "asof": "2023-09-27",
      "buying_power": "45000.00",
      "equity": "100000.00",
      "long_market_value": "30000.00"
    },
    "trade_cash": "60000.00",
    "unsettled_credits": "20000.00",
    "unsettled_debits": "10000.00",
    "withdrawable_cash": "55000.00"
  },
  "error": null,
  "metadata": {
    "request_id": "b7e2d3f4-a1b2-4c3d-8e4f-5a6b7c8d9e0f"
  }
}
{
  "data": {
    "account_id": 19816,
    "buying_power": "90000.00",
    "currency": "USD",
    "daily_realized_pnl": "700.00",
    "daily_total_pnl": "1250.00",
    "daily_unrealized_pnl": "550.00",
    "equity": "100000.00",
    "long_market_value": "40000.00",
    "margin_details": {
      "day_trade_buying_power_usage": "0.00",
      "day_trade_count": 2,
      "initial_margin_excess": "50000.00",
      "initial_margin_requirement": "50000.00",
      "maintenance_margin_excess": "75000.00",
      "maintenance_margin_requirement": "25000.00",
      "pattern_day_trader": false,
      "top_contributors": [
        {
          "initial_margin_requirement": "25000.00",
          "maintenance_margin_requirement": "15000.00",
          "market_value": "50000.00",
          "underlying_instrument_id": "a1a2a3a4-b1b2-c1c2-d1d2-d3d4d5d6d7d8"
        }
      ],
      "usage": {
        "total": "100000.00",
        "used": "5000.00"
      }
    },
    "margin_type": "REG_T",
    "multiplier": "2",
    "open_order_adjustment": "-10000.00",
    "settled_cash": "99775.05",
    "short_market_value": "10000.00",
    "sod": {
      "asof": "2023-09-27",
      "buying_power": "90000.00",
      "day_trade_buying_power": "200000.00",
      "equity": "100000.00",
      "long_market_value": "40000.00",
      "maintenance_margin_excess": "50000.00",
      "maintenance_margin_requirement": "50000.00",
      "short_market_value": "10000.00",
      "trade_cash": "70000.00"
    },
    "trade_cash": "70000.00",
    "unsettled_credits": "20000.00",
    "unsettled_debits": "10000.00",
    "withdrawable_cash": "75000.00"
  },
  "error": null,
  "metadata": {
    "request_id": "b7e2d3f4-a1b2-4c3d-8e4f-5a6b7c8d9e0f"
  }
}
{
  "error": {
    "code": 403,
    "message": "The caller does not have permission to execute the specified operation"
  },
  "metadata": {
    "request_id": "5518f0c6-58ff-4b4a-81a5-701556d41206"
  }
}
{
  "error": {
    "code": 404,
    "message": "Some requested entity was not found"
  },
  "metadata": {
    "request_id": "67e95eb4-93b9-4010-8c9b-7ada7c2be93f"
  }
}