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

# Get Prime Cross Margin Overview

> Returns real time risk data from the cross margin model.



## OpenAPI

````yaml get /v2/entities/{entity_id}/cross_margin/prime
openapi: 3.0.1
info:
  title: REST API
  description: >-
    The Coinbase Prime REST API provides programmatic access to trading,
    custody, staking, market data, and account management functionality.
  version: '0.1'
servers:
  - url: https://api.prime.coinbase.com/
security: []
tags:
  - name: PrimeRESTAPI
paths:
  /v2/entities/{entity_id}/cross_margin/prime:
    get:
      tags:
        - Financing
      summary: Get Prime Cross Margin Overview
      description: Returns real time risk data from the cross margin model.
      operationId: PrimeRESTAPI_GetCrossMarginPrimeOverview
      parameters:
        - name: entity_id
          in: path
          description: Prime entity ID for the XM (cross-margin) customer.
          required: true
          schema:
            type: string
      responses:
        '200':
          description: A successful response.
          content:
            application/json:
              schema:
                $ref: >-
                  #/components/schemas/coinbase.public_rest_api.GetCrossMarginPrimeOverviewResponse
components:
  schemas:
    coinbase.public_rest_api.GetCrossMarginPrimeOverviewResponse:
      type: object
      properties:
        control_status:
          $ref: '#/components/schemas/coinbase.public_rest_api.XMControlStatus'
        margin_level:
          $ref: '#/components/schemas/coinbase.public_rest_api.XMMarginLevel'
        evaluated_at:
          type: string
          description: When margin metrics were evaluated.
          format: date-time
          example: '2023-11-07T05:31:56.000Z'
        margin_summary:
          $ref: >-
            #/components/schemas/coinbase.public_rest_api.CrossMarginPrimeMarginSummary
    coinbase.public_rest_api.XMControlStatus:
      title: >-
        XMControlStatus is a summarization of XM customer controls for trades
        and withdrawals
      type: string
      description: >-
        - TRADES_AND_WITHDRAWALS: Allowed to trade and withdraw. See XM Margin
        Methodology for full description of when trading and withdrawals are
        enabled or disabled.
         - TRADES_ONLY: Allowed to trade but not withdraw. See XM Margin Methodology for full description of when trading and withdrawals are enabled or disabled.
         - SESSION_LOCKED: Not allowed to trade or withdraw. See XM Margin Methodology for full description of when trading and withdrawals are enabled or disabled.
      default: XM_CONTROL_STATUS_UNSPECIFIED
      enum:
        - XM_CONTROL_STATUS_UNSPECIFIED
        - TRADES_AND_WITHDRAWALS
        - TRADES_ONLY
        - SESSION_LOCKED
    coinbase.public_rest_api.XMMarginLevel:
      title: >-
        XMMarginLevel is the realtime state of EQ/MR and MR-EQ monitored against
        XM thresholds as defined in the methodology
      type: string
      description: |-
        - HEALTHY_THRESHOLD: Margin level is healthy
         - DEFICIT_THRESHOLD: Margin level is breaching the deficit threshold (DT) which will result in the issuance of a Margin Call if this is still the case by the scheduled next Margin Call time (as defined in the margin methodology)
         - WARNING_THRESHOLD: Margin level is breaching the warning threshold (WT) which will result in the issuance of a Margin Call if this is still the case by the scheduled next Margin Call (as defined in the margin methodology). WT is differentiated from DT in that it means margin health is approaching the UMCT
         - URGENT_MARGIN_CALL_THRESHOLD: Margin level is breaching the UMCT and, as defined in the margin methodology, this will trigger an urgent margin call
         - LIQUIDATION_THRESHOLD: Margin level is breaching the liquidation threshold (LT) and, as defined in the margin methodology, this will trigger the SESSION_LOCKED control status and liquidation may commence.
      default: XM_MARGIN_LEVEL_UNSPECIFIED
      enum:
        - XM_MARGIN_LEVEL_UNSPECIFIED
        - HEALTHY_THRESHOLD
        - DEFICIT_THRESHOLD
        - WARNING_THRESHOLD
        - URGENT_MARGIN_CALL_THRESHOLD
        - LIQUIDATION_THRESHOLD
    coinbase.public_rest_api.CrossMarginPrimeMarginSummary:
      type: object
      properties:
        margin_requirement:
          type: string
          description: Cross Margin Margin Requirement (XMMR) notional.
          example: '10362.72'
        margin_requirement_type:
          $ref: >-
            #/components/schemas/coinbase.public_rest_api.PrimeXMMarginRequirementType
        account_equity:
          type: string
          description: Equity notional.
          example: '-21542.63'
        margin_excess_shortfall:
          type: string
          description: Equity - XMMR (margin excess is > 0).
          example: '-31891.67'
        consumed_credit:
          type: string
          description: Credit consumed from Cross Margin Credit Limit (XMCL).
          example: '22906.34'
        xm_credit_limit:
          type: string
          description: >-
            XM Credit Limit (XMCL) is the maximum notional USD of total fiat and
            digital asset loans.
          example: '1222322.00'
        xm_margin_limit:
          type: string
          description: XM Margin Limit (XMML) is the maximum notional USD deficit.
          example: '22123.00'
        consumed_margin_limit:
          type: string
          description: Amount of the XM margin limit consumed by excess deficit.
          example: '15000.00'
        spot_equity:
          type: string
          description: Equity attributed by spot.
          example: '-21505.91'
        futures_equity:
          type: string
          description: Equity attributed by futures.
          example: '-36.71'
        gross_market_value:
          type: string
          description: Gross market value.
          example: '160000.00'
        net_market_value:
          type: string
          description: Net market value.
          example: '45000.00'
        net_exposure:
          type: string
          description: Net exposure.
          example: '12000.00'
        gross_leverage:
          type: string
          description: Gross leverage.
          example: '2.35'
        spot_equity_breakdown:
          $ref: >-
            #/components/schemas/coinbase.public_rest_api.CrossMarginPrimeSpotEquityBreakdown
        derivatives_equity_breakdown:
          $ref: >-
            #/components/schemas/coinbase.public_rest_api.CrossMarginPrimeDerivativesEquityBreakdown
        risk_netting_info:
          $ref: >-
            #/components/schemas/coinbase.public_rest_api.CrossMarginPrimeRiskNettingInfo
        health_status:
          $ref: '#/components/schemas/coinbase.public_rest_api.PrimeXMHealthStatus'
        equity_ratio:
          type: string
          description: Equity ratio.
          example: '1.02'
        deficit_ratio:
          type: string
          description: Deficit ratio.
          example: '0.15'
        margin_thresholds:
          $ref: >-
            #/components/schemas/coinbase.public_rest_api.PrimeXMMarginCallThresholds
        fcm_excess_available_to_return:
          type: string
          description: FCM excess available to return.
          example: '5000.00'
      description: Cross-margin account summary and nested breakdowns.
    coinbase.public_rest_api.PrimeXMMarginRequirementType:
      type: string
      description: |2-
         - MARGIN_REQUIREMENT_TYPE_DMR_PLUS_PMR: Integrated (netted) cross-margin requirement for spot assets and all derivatives contracts.
         - MARGIN_REQUIREMENT_TYPE_IPMR_PLUS_IFMR: Combined cross-margin requirement: Integrated Portfolio Margin (IPMR) plus Ineligible Futures Margin (IFMR).
      default: MARGIN_REQUIREMENT_TYPE_UNSPECIFIED
      enum:
        - MARGIN_REQUIREMENT_TYPE_UNSPECIFIED
        - MARGIN_REQUIREMENT_TYPE_DMR_PLUS_PMR
        - MARGIN_REQUIREMENT_TYPE_IPMR_PLUS_IFMR
    coinbase.public_rest_api.CrossMarginPrimeSpotEquityBreakdown:
      type: object
      properties:
        cash_balance:
          type: string
          description: PM cash balance component of spot equity.
          example: '56166.60'
        long_market_value:
          type: string
          description: Long market value component of spot equity.
          example: '85268.31'
        short_market_value:
          type: string
          description: Short market value component of spot equity.
          example: '0.00'
        short_collateral:
          type: string
          description: Short collateral component of spot equity.
          example: '0.00'
        pending_transfers:
          type: string
          description: Pending transfers affecting spot equity.
          example: '15303.77'
      description: Breakdown of the components of spot equity.
    coinbase.public_rest_api.CrossMarginPrimeDerivativesEquityBreakdown:
      type: object
      properties:
        cash_balance:
          type: string
          description: Derivatives cash balance component.
          example: '1000.00'
        unrealized_pnl:
          type: string
          description: Unrealized PnL component of derivatives equity.
          example: '-252.40'
        realized_pnl:
          type: string
          description: Realized PnL component of derivatives equity.
          example: '123.65'
        accrued_funding_pnl:
          type: string
          description: Accrued funding PnL component of derivatives equity.
          example: '-1.08'
      description: Breakdown of the components of derivatives equity.
    coinbase.public_rest_api.CrossMarginPrimeRiskNettingInfo:
      type: object
      properties:
        dco_margin_requirement:
          type: string
          description: >-
            Derivatives Clearing Organization Margin Requirement (DMR) is the
            margin requirement for all futures positions, derived from the
            Derivatives Clearing Organization model
          example: '9243.25'
        portfolio_margin_requirement:
          type: string
          description: >-
            Portfolio Margin Requirement (PMR) is the margin requirement for all
            spot positions, derived from the XM model
          example: '9003.67'
        integrated_portfolio_margin_requirement:
          type: string
          description: >-
            Integrated Portfolio Margin Requirement (IPMR) is the margin
            requirement for all spot positions + futures positions with
            underlying assets eligible in Portfolio Margin.
          example: '10154.67'
        ineligible_futures_margin_requirement:
          type: string
          description: >-
            Ineligible Futures Margin Requirement (IFMR) is the margin
            requirement for IPMR-ineligible futures contracts
          example: '194.36'
        pmr_breakdown:
          $ref: >-
            #/components/schemas/coinbase.public_rest_api.PrimeXMMarginRequirementBreakdown
        ipmr_breakdown:
          $ref: >-
            #/components/schemas/coinbase.public_rest_api.PrimeXMMarginRequirementBreakdown
        portfolio_margin_offset_credit_breakdown:
          $ref: >-
            #/components/schemas/coinbase.public_rest_api.PrimeXMOffsetCreditBreakdown
        integrated_portfolio_margin_offset_credit_breakdown:
          $ref: >-
            #/components/schemas/coinbase.public_rest_api.PrimeXMOffsetCreditBreakdown
        xm_positions:
          type: array
          description: Netted positions used in the model calculation.
          items:
            $ref: >-
              #/components/schemas/coinbase.public_rest_api.CrossMarginPrimeXMPosition
      description: >-
        Groups XM margin requirement components, offset credits, and per-asset
        rows.
    coinbase.public_rest_api.PrimeXMHealthStatus:
      type: string
      description: |2-
         - HEALTH_STATUS_HEALTHY: Margin level is healthy.
         - HEALTH_STATUS_WARNING: Margin level is breaching the warning threshold (WT) which will result in the issuance of a Margin Call if this is still the case by the scheduled next Margin Call (as defined in the margin methodology). WT is differentiated from DT in that it means margin health is approaching the UMCT.
         - HEALTH_STATUS_CRITICAL: Margin level is breaching the UMCT and, as defined in the margin methodology, this will trigger an urgent margin call.
         - HEALTH_STATUS_SUSPENDED: Trading and withdrawals are suspended per XM margin methodology.
         - HEALTH_STATUS_RESTRICTED: Account is in a restricted state per XM margin methodology.
         - HEALTH_STATUS_PRE_LIQUIDATION: Margin level is breaching the liquidation threshold (LT) and, as defined in the margin methodology, this will trigger the SESSION_LOCKED control status and liquidation may commence.
         - HEALTH_STATUS_LIQUIDATING: Liquidation has commenced.
         - HEALTH_STATUS_IN_DEFICIT: Margin level is breaching the deficit threshold (DT) which will result in the issuance of a Margin Call if this is still the case by the scheduled next Margin Call time (as defined in the margin methodology).
      enum:
        - HEALTH_STATUS_HEALTHY
        - HEALTH_STATUS_WARNING
        - HEALTH_STATUS_CRITICAL
        - HEALTH_STATUS_SUSPENDED
        - HEALTH_STATUS_RESTRICTED
        - HEALTH_STATUS_PRE_LIQUIDATION
        - HEALTH_STATUS_LIQUIDATING
        - HEALTH_STATUS_IN_DEFICIT
    coinbase.public_rest_api.PrimeXMMarginCallThresholds:
      type: object
      properties:
        deficit_threshold:
          type: string
          description: Deficit threshold (DT).
          example: '0.8'
        warning_threshold:
          type: string
          description: Warning threshold (WT).
          example: '0.8'
        critical_threshold:
          type: string
          description: Urgent margin call threshold (UMCT).
          example: '1.0'
        liquidation_threshold:
          type: string
          description: Liquidation threshold (LT).
          example: '1.5'
        margin_thresholds:
          type: array
          description: Structured margin thresholds by margin level.
          items:
            $ref: >-
              #/components/schemas/coinbase.public_rest_api.PrimeXMMarginThreshold
    coinbase.public_rest_api.PrimeXMMarginRequirementBreakdown:
      type: object
      properties:
        base_margin:
          type: string
          description: Base margin requirement component.
          example: '30188.41'
        volatility_addon:
          type: string
          description: Volatility add-on component.
          example: '0.00'
        liquidity_addon:
          type: string
          description: Liquidity add-on component.
          example: '0.49'
        offset_credit:
          type: string
          description: Credits that offset margin charges due to portfolio composition.
          example: '-20.29'
        futures_margin:
          type: string
          description: >-
            Futures margin charge applied for any futures trades of the opposing
            direction but of the same underlying.
          example: '0.00'
    coinbase.public_rest_api.PrimeXMOffsetCreditBreakdown:
      type: object
      properties:
        basis_credit:
          type: string
          description: Basis offset credit component.
          example: '0'
        long_short_credit:
          type: string
          description: Long/short tier-pair offset credit.
          example: '0'
        long_long_credit:
          type: string
          description: Long/long tier-pair offset credit.
          example: '-1.15'
        short_short_credit:
          type: string
          description: Short/short tier-pair offset credit.
          example: '0'
        same_tier_credit:
          type: string
          description: Same-tier offset credit.
          example: '-19.13'
        total_credit:
          type: string
          description: Total offset credit.
          example: '-20.29'
    coinbase.public_rest_api.CrossMarginPrimeXMPosition:
      type: object
      properties:
        currency:
          type: string
          description: Position currency
          example: BTC
        market_price:
          type: string
          description: Current market price
          example: '114531.73'
        spot_balance:
          type: string
          description: XM spot balance nominal
          example: '-0.19652944'
        spot_balance_notional:
          type: string
          description: XM spot balance notional
          example: '-22508.85'
        futures_balance:
          type: string
          description: XM futures balance nominal
          example: '-0.19652944'
        futures_balance_notional:
          type: string
          description: XM futures balance notional
          example: '-22508.85'
        base_requirement:
          type: string
          description: Base margin requirement notional
          example: '8925.50'
        total_position_margin:
          type: string
          description: Total margin required
          example: '9100.00'
        basis_credit:
          type: string
          description: Basis offset credit applied to this asset row.
          example: '-5.25'
        futures_netted_notional:
          type: string
          description: Post-netting USD notional for futures on this asset
          example: '11510.00'
        futures_netting_margin:
          type: string
          description: Margin attributed to futures netting for this asset row.
          example: '120.00'
        long_amount:
          type: string
          description: Per-asset long amount from position_summary.
          example: '0.75539174'
        short_amount:
          type: string
          description: Per-asset short amount from position_summary.
          example: '0.95292118'
        volatility_addon:
          type: string
          description: Volatility margin add-on for this asset.
          example: '0.00'
        liquidity_addon:
          type: string
          description: Liquidity margin add-on for this asset.
          example: '0.49'
      description: >-
        CrossMarginPrimeXMPosition is a single per-asset XM row (proto-backed
        fields from XMPositionDetails).
    coinbase.public_rest_api.PrimeXMMarginThreshold:
      type: object
      properties:
        margin_level:
          $ref: '#/components/schemas/coinbase.public_rest_api.XMMarginLevel'
        threshold_type:
          $ref: >-
            #/components/schemas/coinbase.public_rest_api.PrimeXMMarginThresholdType
        threshold_value:
          type: string
          example: '0.8'
    coinbase.public_rest_api.PrimeXMMarginThresholdType:
      type: string
      description: |2-
         - MARGIN_THRESHOLD_EQUITY_RATIO: Threshold based on equity ratio EQ / MR; triggers when EQ / MR >= threshold_value.
         - MARGIN_THRESHOLD_DEFICIT_RATIO: Threshold based on deficit ratio (MR - EQ) / XMML; triggers when (MR - EQ) / XMML > threshold_value.
      default: MARGIN_THRESHOLD_TYPE_UNSPECIFIED
      enum:
        - MARGIN_THRESHOLD_TYPE_UNSPECIFIED
        - MARGIN_THRESHOLD_EQUITY_RATIO
        - MARGIN_THRESHOLD_DEFICIT_RATIO
        - MARGIN_THRESHOLD_NONE

````