Skip to main content

user.account_risk

CHANNEL 

wss://stream.crypto.com/exchange/v1/user

user.account_riskPrivate
Account risk snapshot on a regular basis. Subscribe with channels ["user.account_risk"].

Request

Body

required
    id integerrequired

    Request id

    method stringrequired

    Possible values: [subscribe]

    params objectrequired
    channels string[]required

    e.g. ["user.account_risk"]

    nonce integerrequired

    Current timestamp in milliseconds

WebSocket response
Schema
    id int64
    method string
    code int32
    result object
    account_id string
    subscription string
    channel string
    data object[]
  • Array [
  • instrument_name string

    Instrument name of the balance e.g. USD

    total_available_balance decimal

    Balance that user can open new order (Margin Balance - Initial Margin)

    total_margin_balance decimal

    Positive cash balance on eligible collateral tokens + Negative balance on all tokens + Unrealised PnL - Fee reserves

    total_initial_margin decimal

    Total margin requirement to support positions and all open orders IM and haircut from risk asset holdings. Total sum of total_position_im + total_haircut.

    total_maintenance_margin decimal

    Total maintenance margin requirement for all positions

    total_position_cost decimal

    Position value in USD

    total_cash_balance decimal

    Wallet Balance (Deposits - Withdrawals + Realized PnL - Fees)

    total_collateral_value decimal

    Collateral Value

    total_session_unrealized_pnl decimal

    Current unrealized profit and loss from all open positions (calculated with Mark Price and Avg Price)

    total_session_realized_pnl decimal

    Current realized profit and loss from all open positions (calculated with Mark Price and Avg Price)

    is_liquidating boolean

    Describes whether the account is under liquidation

    total_effective_leverage decimal

    The actual leverage used (all open positions combined), i.e. position size / margin balance.

    position_limit decimal

    Maximum position size allowed (for all open positions combined)

    used_position_limit decimal

    Combined position size of all open positions + order exposure on all instruments

    total_isolated_cash_balance decimal

    Sum of cash balance of the isolated positions

    total_position_im decimal

    Optional; present in isolated position items.

    total_haircut decimal

    Optional; present in isolated position items.

    total_risk_exposure decimal

    Total risk exposure. Optional.

    total_borrow decimal

    Total borrow. Optional.

    margin_score decimal

    Margin score. Optional.

    has_risk boolean

    Whether the account has risk. Optional.

    terminatable boolean

    Whether the account is terminatable. Optional.

    credit_limits array

    Credit limits; may be empty. Item shape TBD when non-empty. Optional.

    balances object[]
    Collateral balances (same structure as position_balances; user.account_risk uses this name).
  • Array [
  • instrument_name string

    Instrument name of the collateral e.g. USD

    quantity decimal

    Quantity of the collateral

    market_value decimal

    Market value of the collateral

    collateral_eligible boolean

    true or false

    haircut decimal

    Show haircut for eligible collateral token

    collateral_amount decimal

    Collateral amount derived by market_value minus haircut

    max_withdrawal_balance decimal

    Max withdrawal balance of the collateral

    reserved_qty decimal

    Fund/balance in use, not available for new orders or additional trading activities.

    hourly_interest_rate decimal

    Hourly interest rate for the collateral; e.g. "0". Optional.

  • ]
  • positions object[]
    Position-level data; same shape as WS user.positions.
  • Array [
  • account_id string

    Account ID.

    instrument_name string

    E.g. BTCUSD-PERP.

    type string

    E.g. PERPETUAL_SWAP.

    quantity decimal

    Position quantity.

    cost string

    Position cost or value in USD.

    open_position_pnl string

    Profit and loss for the open position.

    open_pos_cost string

    Open position cost.

    session_pnl string

    Profit and loss in the current trading session.

    update_timestamp_ms int64

    Updated time (Unix timestamp).

    isolation_id string

    Isolation ID of the isolated position.

    isolation_type WsIsolationType (string)

    Possible values: [ISOLATED_MARGIN]

    Isolation type

    session_unrealized_pnl string

    Session unrealized PnL.

    pos_initial_margin string

    Position initial margin.

    pos_maintenance_margin string

    Position maintenance margin.

    market_value string

    Market value.

    mark_price decimal

    Mark price.

    target_leverage decimal

    Target leverage.

    leverage decimal

    Leverage.

    liquidation_price decimal

    Liquidation price.

    isolated_margin_balance decimal

    Isolated margin balance.

    effective_leverage decimal

    Effective leverage; present in user.account_risk and some WS responses. Optional.

  • ]
  • isolated_positions object[]
    Isolated margin rows; each has isolation_id, leverage, isolation_type and no nested isolated_positions.
  • Array [
  • instrument_name string

    Instrument name of the balance e.g. USD

    total_available_balance decimal

    Balance that user can open new order (Margin Balance - Initial Margin)

    total_margin_balance decimal

    Positive cash balance on eligible collateral tokens + Negative balance on all tokens + Unrealised PnL - Fee reserves

    total_initial_margin decimal

    Total margin requirement to support positions and all open orders IM and haircut from risk asset holdings. Total sum of total_position_im + total_haircut.

    total_maintenance_margin decimal

    Total maintenance margin requirement for all positions

    total_position_cost decimal

    Position value in USD

    total_cash_balance decimal

    Wallet Balance (Deposits - Withdrawals + Realized PnL - Fees)

    total_collateral_value decimal

    Collateral Value

    total_session_unrealized_pnl decimal

    Current unrealized profit and loss from all open positions (calculated with Mark Price and Avg Price)

    total_session_realized_pnl decimal

    Current realized profit and loss from all open positions (calculated with Mark Price and Avg Price)

    is_liquidating boolean

    Describes whether the account is under liquidation

    total_effective_leverage decimal

    The actual leverage used (all open positions combined), i.e. position size / margin balance.

    position_limit decimal

    Maximum position size allowed (for all open positions combined)

    used_position_limit decimal

    Combined position size of all open positions + order exposure on all instruments

    total_isolated_cash_balance decimal

    Sum of cash balance of the isolated positions

    total_position_im decimal

    Optional; present in isolated position items.

    total_haircut decimal

    Optional; present in isolated position items.

    total_risk_exposure decimal

    Total risk exposure. Optional.

    total_borrow decimal

    Total borrow. Optional.

    margin_score decimal

    Margin score. Optional.

    has_risk boolean

    Whether the account has risk. Optional.

    terminatable boolean

    Whether the account is terminatable. Optional.

    credit_limits array

    Credit limits; may be empty. Item shape TBD when non-empty. Optional.

    isolation_id string

    Isolation ID of isolated position.

    leverage decimal

    The maximum leverage of the isolated position.

    isolation_type WsIsolationType (string)

    Possible values: [ISOLATED_MARGIN]

    Isolation type

    balances object[]
    Collateral balances (same structure as position_balances).
  • Array [
  • instrument_name string

    Instrument name of the collateral e.g. USD

    quantity decimal

    Quantity of the collateral

    market_value decimal

    Market value of the collateral

    collateral_eligible boolean

    true or false

    haircut decimal

    Show haircut for eligible collateral token

    collateral_amount decimal

    Collateral amount derived by market_value minus haircut

    max_withdrawal_balance decimal

    Max withdrawal balance of the collateral

    reserved_qty decimal

    Fund/balance in use, not available for new orders or additional trading activities.

    hourly_interest_rate decimal

    Hourly interest rate for the collateral; e.g. "0". Optional.

  • ]
  • positions object[]
    Position-level data; same shape as WS user.positions; items may include isolation_id, leverage, isolation_type.
  • Array [
  • account_id string

    Account ID.

    instrument_name string

    E.g. BTCUSD-PERP.

    type string

    E.g. PERPETUAL_SWAP.

    quantity decimal

    Position quantity.

    cost string

    Position cost or value in USD.

    open_position_pnl string

    Profit and loss for the open position.

    open_pos_cost string

    Open position cost.

    session_pnl string

    Profit and loss in the current trading session.

    update_timestamp_ms int64

    Updated time (Unix timestamp).

    isolation_id string

    Isolation ID of the isolated position.

    isolation_type WsIsolationType (string)

    Possible values: [ISOLATED_MARGIN]

    Isolation type

    session_unrealized_pnl string

    Session unrealized PnL.

    pos_initial_margin string

    Position initial margin.

    pos_maintenance_margin string

    Position maintenance margin.

    market_value string

    Market value.

    mark_price decimal

    Mark price.

    target_leverage decimal

    Target leverage.

    leverage decimal

    Leverage.

    liquidation_price decimal

    Liquidation price.

    isolated_margin_balance decimal

    Isolated margin balance.

    effective_leverage decimal

    Effective leverage; present in user.account_risk and some WS responses. Optional.

  • ]
  • ]
  • ]