> ## 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 Margin Information

> Gets real-time evaluation of the margin model based on current positions and spot rates.

### Supported Products

* Portfolio Margin


## OpenAPI

````yaml GET /v1/entities/{entity_id}/margin
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:
  /v1/entities/{entity_id}/margin:
    get:
      tags:
        - Financing
      summary: Get Margin Information
      description: >-
        Gets real-time evaluation of the margin model based on current positions
        and spot rates.
      operationId: PrimeRESTAPI_GetMarginInformation
      parameters:
        - name: entity_id
          in: path
          description: The unique ID of the entity
          required: true
          schema:
            type: string
      responses:
        '200':
          description: A successful response.
          content:
            application/json:
              schema:
                $ref: >-
                  #/components/schemas/coinbase.public_rest_api.GetMarginInformationResponse
components:
  schemas:
    coinbase.public_rest_api.GetMarginInformationResponse:
      type: object
      properties:
        margin_information:
          $ref: '#/components/schemas/coinbase.public_rest_api.MarginInformation'
    coinbase.public_rest_api.MarginInformation:
      type: object
      properties:
        margin_call_records:
          type: array
          description: The current margin call records
          items:
            $ref: '#/components/schemas/coinbase.public_rest_api.MarginCallRecord'
        margin_summary:
          $ref: '#/components/schemas/coinbase.public_rest_api.MarginSummary'
    coinbase.public_rest_api.MarginCallRecord:
      type: object
      properties:
        margin_call_id:
          type: string
          description: The unique ID of the margin call
          example: e8bbed13-fa33-41de-86d5-4335d8f08122
        initial_notional_amount:
          type: string
          description: The initial margin call amount in notional value
          example: '123.45'
        outstanding_notional_amount:
          type: string
          description: The outstanding margin call amount in notional value
          example: '122.45'
        created_at:
          type: string
          description: The time the margin call is created in RFC3330 format
          example: 2023-01-01T00:00:00Z5
        due_at:
          type: string
          description: The time the margin call is due in RFC3339 format
          example: '2023-01-01T00:00:00.000Z'
    coinbase.public_rest_api.MarginSummary:
      type: object
      properties:
        entity_id:
          type: string
          description: The unique ID of the entity
          example: e8bbed13-fa33-41de-86d5-4335d8f08166
        margin_equity:
          type: string
          description: >-
            The margin equity at the entity level. Margin Equity = LMV + SMV +
            Trading Cash Balance + Short Collateral - Pending Withdrawals
          example: '2539231.5903575355'
        margin_requirement:
          type: string
          description: USD notional value of required equity in entity portfolios
          example: '15131.725279884091'
        excess_deficit:
          type: string
          description: margin_equity - margin_requirement
          example: '2524099.865077651'
        pm_credit_consumed:
          type: string
          description: The raw amount of portfolio margin credit used
          example: '10000'
        tf_credit_limit:
          type: string
          description: >-
            The maximum trade finance credit limit. This field is deprecated and
            will be removed in the future.
          example: '2000000'
        tf_credit_consumed:
          type: string
          description: >-
            The amount of trade finance credit used (USD). This field is
            deprecated and will be removed in the future.
          example: '20000'
        tf_adjusted_asset_value:
          type: string
          description: >-
            TF Asset Adjusted Value (USD). This field is deprecated and will be
            removed in the future.
          example: '40000'
        tf_adjusted_liability_value:
          type: string
          description: >-
            TF Adjusted Liability Value (USD). This field is deprecated and will
            be removed in the future.
          example: '40000'
        tf_adjusted_credit_consumed:
          type: string
          description: >-
            The amount of adjusted credit used. This field is deprecated and
            will be removed in the future.
          example: '30000'
        tf_adjusted_equity:
          type: string
          description: >-
            The amount of adjusted equity. This field is deprecated and will be
            removed in the future.
          example: '30000'
        frozen:
          type: boolean
          description: >-
            Whether or not a entity is frozen due to balance outstanding or
            other reason
          example: false
        frozen_reason:
          type: string
          description: The reason why a entity is frozen
        tf_enabled:
          type: boolean
          description: >-
            Whether TF is enabled for the entity. This field is deprecated and
            will be removed in the future.
          example: true
        pm_enabled:
          type: boolean
          description: Whether PM is enabled for the entity
          example: true
        market_rates:
          type: array
          description: Market rates for the list of assets
          items:
            $ref: '#/components/schemas/coinbase.public_rest_api.MarketRate'
        asset_balances:
          type: array
          description: Asset Balances across portfolios
          items:
            $ref: '#/components/schemas/coinbase.public_rest_api.AssetBalance'
        tf_loans:
          type: array
          description: >-
            Trade finance debit loan amounts. This field is deprecated and will
            be removed in the future.
          items:
            $ref: '#/components/schemas/coinbase.public_rest_api.LoanInfo'
        pm_loans:
          type: array
          description: Portfolio Margin debit loan amounts
          items:
            $ref: '#/components/schemas/coinbase.public_rest_api.LoanInfo'
        short_collateral:
          type: array
          description: Short collateral amounts
          items:
            $ref: '#/components/schemas/coinbase.public_rest_api.LoanInfo'
        gross_market_value:
          type: string
          description: Gross market value (GMV) = LMV + Abs (SMV)
        net_market_value:
          type: string
          description: Net Market Value (NMV) = LMV + SMV
        long_market_value:
          type: string
          description: Long Market Value (LMV) = Sum of positive notional for all assets
        non_marginable_long_market_value:
          type: string
          description: >-
            Non_Marginable LMV: Sum of positive notional for each non-margin
            eligible coin
        short_market_value:
          type: string
          description: >-
            Short Market Value (SMV) = Sum of negative notional for each margin
            eligible coin
        gross_leverage:
          type: string
          description: Gross Leverage = GMV / Margin Requirement
        net_exposure:
          type: string
          description: Net Exposure = (LMV + SMV) / GMV
        portfolio_stress_triggered:
          $ref: '#/components/schemas/coinbase.public_rest_api.MarginAddOn'
        pm_asset_info:
          type: array
          description: PM asset info netted across the entity
          items:
            $ref: '#/components/schemas/coinbase.public_rest_api.PMAssetInfo'
        pm_credit_limit:
          type: string
          description: PM limit that monitors gross notional borrowings (crypto + fiat)
          example: '1000000'
        pm_margin_limit:
          type: string
          description: PM limit that monitors excess deficit
          example: '200000'
        pm_margin_consumed:
          type: string
          description: >-
            The amount of the margin limit that is consumed by the excess
            deficit
          example: '5000'
    coinbase.public_rest_api.MarketRate:
      type: object
      properties:
        symbol:
          type: string
          description: The currency symbol
          example: BTC
        rate:
          type: string
          description: The current market rate of currency
          example: 27,123
    coinbase.public_rest_api.AssetBalance:
      type: object
      properties:
        portfolio_id:
          type: string
          description: The unique ID of the portfolio
          example: e8bbed13-fa33-41de-86d5-4335d8f08166
        symbol:
          type: string
          description: The currency symbol
          example: BTC
        amount:
          type: string
          description: Balance amount
          example: '4000'
        notional_amount:
          type: string
          description: Notional balance amount
          example: '4000'
        conversion_rate:
          type: string
          description: Conversion rate
          example: '1000'
    coinbase.public_rest_api.LoanInfo:
      type: object
      properties:
        portfolio_id:
          type: string
          description: The unique ID of the portfolio
          example: e8bbed13-fa33-41de-86d5-4335d8f08166
        symbol:
          type: string
          description: The currency symbol
          example: BTC
        amount:
          type: string
          description: Balance amount
          example: '150000'
        notional_amount:
          type: string
          description: Notional balance amount
          example: '250000'
        due_date:
          type: string
          description: Settlement due date
          example: '1000'
    coinbase.public_rest_api.MarginAddOn:
      type: object
      properties:
        amount:
          type: string
          description: margin add on amount
        add_on_type:
          $ref: '#/components/schemas/coinbase.public_rest_api.MarginAddOnType'
    coinbase.public_rest_api.PMAssetInfo:
      type: object
      properties:
        symbol:
          type: string
          description: The currency symbol
        amount:
          type: string
          description: Nominal amount of the currency
        price:
          type: string
          description: Spot price for the currency
        notional_amount:
          type: string
          description: Notional amount of the currency
        asset_tier:
          type: string
          description: Asset tier of the currency
        margin_eligible:
          type: boolean
          description: Whether the currency is margin eligible
        base_margin_requirement:
          type: string
          description: Base margin requirement of the currency
        base_margin_requirement_notional:
          type: string
          description: Notional amount of the currency's base margin requirement
        adv_30d:
          type: string
          description: The 30d adv of the currency
        hist_5d_vol:
          type: string
          description: Historic 5d volatility of the currency
        hist_30d_vol:
          type: string
          description: Historic 30d volatility of the currency
        hist_90d_vol:
          type: string
          description: Historic 90d volatility of the currency
        volatility_addon:
          type: string
          description: Volatility margin addon of the currency position
        liquidity_addon:
          type: string
          description: Liquidity margin addon of the currency position
        total_position_margin:
          type: string
          description: Total position margin of the currency
        short_nominal:
          type: string
          description: Nominal short position of the currency
        long_nominal:
          type: string
          description: Nominal long position of the currency
    coinbase.public_rest_api.MarginAddOnType:
      type: string
      default: MARGIN_ADD_ON_TYPE_UNSPECIFIED
      enum:
        - MARGIN_ADD_ON_TYPE_UNSPECIFIED
        - SINGLE_COIN_STRESS
        - CONCENTRATION_STRESS
        - MACRO_STRESS
        - SHORT_BIASED_STRESS

````