Margin Trading

Get Margin Account Summary

Retrieves comprehensive margin account information including collateral, leverage, buying/selling power, and liquidation risk.

This endpoint provides real-time margin statistics for spot margin trading accounts, helping you monitor your account health and manage risk. Buying power and selling power are calculated for the requested trading pair and reflect the account's current collateral, positions, orders, and margin settings. All monetary risk values in the response are denominated in USD.

Roles

The API key you use to access this endpoint must have the Trader, Fund Manager or Auditor role assigned. See Roles for more information.

The OAuth scope must have balances:read assigned to access this endpoint. See OAuth Scopes for more information.

Account Type

This endpoint is only available for margin trading accounts. Standard exchange accounts will receive an error.

post/v1/margin/account

Request

  • Base URL
    https://api.gemini.com
  • URL
    https://api.gemini.com/v1/margin/account
  • Auth
    API key in header X-GEMINI-APIKEY and API key in header X-GEMINI-SIGNATURE and API key in header X-GEMINI-PAYLOAD

Headers

X-GEMINI-APIKEYstring required

Your API key

X-GEMINI-SIGNATUREstring required

HEX-encoded HMAC-SHA384 of payload signed with API secret

X-GEMINI-PAYLOADstring required

Base64-encoded JSON payload

Content-Typestring
Content-Lengthstring
Cache-Controlstring

Request body

requeststring required

The literal string "/v1/margin/account"

symbolstring required

The trading pair for which to calculate pair-specific buying and selling power (for example, "btcusd").

accountstring

Required for Master API keys as described in Private API Invocation. The name of the account within the subaccount group.

Example request

{
  "nonce": "1495127793000",
  "symbol": "btcusd"
}

Response

Margin account summary with risk statistics

leveragestring decimal required

The current leverage ratio (notionalValue / marginAssetValue)

Example response

{
  "marginAssetValue": {
    "currency": "USD",
    "value": "10000.00"
  },
  "availableCollateral": {
    "currency": "USD",
    "value": "10000.00"
  },
  "notionalValue": {
    "currency": "USD",
    "value": "10000.00"
  },
  "totalBorrowed": {
    "currency": "USD",
    "value": "10000.00"
  },
  "leverage": "1.5",
  "buyingPower": {
    "currency": "USD",
    "value": "10000.00"
  },
  "sellingPower": {
    "currency": "USD",
    "value": "10000.00"
  },
  "liquidationRisk": {
    "lossPercentage": "0.1550",
    "liquidationPrice": {
      "currency": "USD",
      "value": "10000.00"
    }
  },
  "interestRate": {
    "rate": "0.00001141552511",
    "interval": "hour"
  },
  "reservedBuyOrders": {
    "currency": "USD",
    "value": "10000.00"
  },
  "reservedSellOrders": {
    "currency": "USD",
    "value": "10000.00"
  }
}

Changes

No recorded changes to this operation across all 1 revision of this API.