Gemini Crypto Exchange Logo
REST API

Margin Trading (1.0.0)

Endpoint

Get Margin Account Summary

POST
https://api.gemini.com
/v1/margin/account

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.

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.

Get Margin Account SummaryHeaders

  • 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
    Default: text/plain
  • Content-Lengthstring
    Default: 0
  • Cache-Controlstring
    Default: no-cache

Get Margin Account Summary Request Body

  • requeststring · required

    The literal string "/v1/margin/account"

  • noncerequired

    The nonce, as described in Private API Invocation

  • accountstring

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

Get Margin Account Summary Responses

Margin account summary with risk statistics

  • marginAssetValueobject · required

    The total value of all assets available in the margin account that can contribute to funding positions

  • availableCollateralobject · required

    The amount of collateral available for new positions or withdrawals

  • notionalValueobject · required

    The total value of all open positions

  • totalBorrowedobject · required

    The total amount currently borrowed across all currencies

  • leveragestring · decimal · required

    The current leverage ratio (notionalValue / marginAssetValue)

    Example: 1.5
  • buyingPowerobject · required

    The maximum value that can be purchased with available collateral

  • sellingPowerobject · required

    The maximum value that can be sold with available collateral

  • reservedBuyOrdersobject · required

    Collateral reserved for open buy orders

  • reservedSellOrdersobject · required

    Collateral reserved for open sell orders

  • liquidationRiskobject

    Liquidation risk information (only present if positions exist)

  • interestRateobject

    Current interest rate on borrowed amounts (only present if borrows exist)


Get Margin Interest Rates

POST
https://api.gemini.com
/v1/margin/rates

Retrieves current margin interest rates for all borrowable assets.

Returns hourly, daily, and annual borrow rates for each currency that can be borrowed on margin. Interest is charged on borrowed amounts at the hourly rate and compounds over time.

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.

Get Margin Interest RatesHeaders

  • 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
    Default: text/plain
  • Content-Lengthstring
    Default: 0
  • Cache-Controlstring
    Default: no-cache

Get Margin Interest Rates Request Body

  • requeststring · required

    The literal string "/v1/margin/rates"

  • noncerequired

    The nonce, as described in Private API Invocation

  • accountstring

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

Get Margin Interest Rates Responses

Current margin interest rates for all borrowable assets

  • ratesobject[] · required

    Array of interest rates for all borrowable currencies


Preview Margin Order Impact

POST
https://api.gemini.com
/v1/margin/order/preview

Previews the margin impact of a hypothetical spot order without actually placing it.

Returns both pre-order and post-order margin risk statistics, allowing you to understand how an order would affect your margin account before execution. This is useful for risk management and planning trades.

Roles

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

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

Account Type

This endpoint is only available for margin trading accounts.

Preview Margin Order ImpactHeaders

  • 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
    Default: text/plain
  • Content-Lengthstring
    Default: 0
  • Cache-Controlstring
    Default: no-cache

Preview Margin Order Impact Request Body

  • requeststring · required

    The literal string "/v1/margin/order/preview"

  • noncerequired

    The nonce, as described in Private API Invocation

  • symbolstring · required

    The trading pair symbol (e.g., "btcusd")

    Example: btcusd
  • sidestring · enum · required

    The order side

    Enum values:
    buy
    sell
    Example: buy
  • typestring · enum · required

    The order type

    Enum values:
    market
    limit
    Example: limit
  • amountstring · decimal

    The order amount in base currency (required for limit orders and sell market orders)

    Example: 0.5
  • pricestring · decimal

    The limit price (required for limit orders)

    Example: 50000.00
  • totalSpendstring · decimal

    Total spend in quote currency (required for buy market orders)

    Example: 25000.00
  • accountstring

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

Preview Margin Order Impact Responses

Pre-order and post-order margin risk statistics

  • preorderobject · required

    Margin risk statistics before the order would be executed

  • postorderobject · required

    Margin risk statistics after the order would be executed