GeminiGemini
SandboxGet API key
  • Crypto Trading
  • Prediction Markets
Changelog
Gemini Crypto Exchange LogoGemini Crypto Exchange Logo

© 2026 Gemini Space Station, Inc.

REST APIs
    Orders
    Market Data
    Derivatives
    Margin Trading
      Get Margin Account SummaryGet Margin Interest RatesPreview Margin Order Impact
    Staking
    Clearing
    Instant Orders
    Fund Management
WebSocket
    AuthenticationMessage Format
    Streams
      Book TickerL2 Partial DepthL2 Differential DepthTrade StreamOrder EventsBalance Updates
    Playground
      Overviewconninfopingtimesubscribeunsubscribelist_subscriptionsdepthorder.placeorder.cancelorder.cancel_allorder.cancel_session
Agentic
FIX

Preview Margin Order Impact

TradingMargin TradingPreview Margin Order Impact

Preview Margin Order Impact

POSThttps://api.gemini.com/v1/margin/order/preview

Previews the margin impact of a hypothetical spot order without placing it. Returns pre-order and post-order margin risk statistics.

Account Type

This endpoint is only available for margin trading accounts.

POSTv1/margin/order/preview
curl --request POST \
  --url https://api.gemini.com/v1/margin/order/preview \
  --header 'Content-Type: application/json' \
  --header 'X-GEMINI-APIKEY: <string>' \
  --header 'X-GEMINI-PAYLOAD: <string>' \
  --header 'X-GEMINI-SIGNATURE: <string>' \
  --data '
{
  "request": "/v1/margin/order/preview",
  "nonce": "<nonce>",
  "symbol": "btcusd",
  "side": "buy",
  "type": "limit",
  "amount": "0.5",
  "price": "50000.00"
}
'

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.

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

Request Body

requeststring·required
The literal string "/v1/margin/order/preview"
nonceTimestampType | integer·required
timestampExample: 1495127793000
symbolstring·required
The trading pair symbol (e.g., "btcusd")Example: btcusd
sidestring·enum·required
The order sideEnum values: buysellExample: buy
typestring·enum·required
The order typeEnum values: marketlimitExample: 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](/authentication/api-key#private-api-invocation). The name of the account within the subaccount group.
Example request body
{
  "request": "/v1/margin/order/preview",
  "nonce": "<nonce>",
  "symbol": "btcusd",
  "side": "buy",
  "type": "limit",
  "amount": "0.5",
  "price": "50000.00"
}

Responses

Pre-order and post-order margin risk statistics

preorderobject·required
Margin risk statistics before the order would be executed
preorder.marginAssetValueobject·required
The total value of all assets available in the margin account
preorder.marginAssetValue.currencystring·required
The currency code (e.g., "USD", "BTC", "ETH")Example: USD
preorder.marginAssetValue.valuestring (decimal)·required
The amount in the specified currencyExample: 10000.00
preorder.availableCollateralobject·required
The amount of collateral available for new positions
preorder.availableCollateral.currencystring·required
The currency code (e.g., "USD", "BTC", "ETH")Example: USD
preorder.availableCollateral.valuestring (decimal)·required
The amount in the specified currencyExample: 10000.00
preorder.notionalValueobject·required
The total value of all open positions
preorder.notionalValue.currencystring·required
The currency code (e.g., "USD", "BTC", "ETH")Example: USD
preorder.notionalValue.valuestring (decimal)·required
The amount in the specified currencyExample: 10000.00
preorder.totalBorrowedobject·required
The total amount currently borrowed
preorder.totalBorrowed.currencystring·required
The currency code (e.g., "USD", "BTC", "ETH")Example: USD
preorder.totalBorrowed.valuestring (decimal)·required
The amount in the specified currencyExample: 10000.00
preorder.leveragestring (decimal)·required
The leverage ratioExample: 1.5
preorder.reservedBuyOrdersobject·required
Collateral reserved for open buy orders
preorder.reservedBuyOrders.currencystring·required
The currency code (e.g., "USD", "BTC", "ETH")Example: USD
preorder.reservedBuyOrders.valuestring (decimal)·required
The amount in the specified currencyExample: 10000.00
preorder.reservedSellOrdersobject·required
Collateral reserved for open sell orders
preorder.reservedSellOrders.currencystring·required
The currency code (e.g., "USD", "BTC", "ETH")Example: USD
preorder.reservedSellOrders.valuestring (decimal)·required
The amount in the specified currencyExample: 10000.00
preorder.buyingPowerobject·required
The maximum value that can be purchased
preorder.buyingPower.currencystring·required
The currency code (e.g., "USD", "BTC", "ETH")Example: USD
preorder.buyingPower.valuestring (decimal)·required
The amount in the specified currencyExample: 10000.00
preorder.sellingPowerobject·required
The maximum value that can be sold
preorder.sellingPower.currencystring·required
The currency code (e.g., "USD", "BTC", "ETH")Example: USD
preorder.sellingPower.valuestring (decimal)·required
The amount in the specified currencyExample: 10000.00
preorder.liquidationRiskobject
Liquidation risk information (only present if applicable)
preorder.liquidationRisk.lossPercentagestring (decimal)·required
The percentage loss from current value that would trigger liquidation, formatted as decimal (e.g., "0.1550" = 15.50%)Example: 0.1550
preorder.liquidationRisk.liquidationPriceobject
The estimated price at which liquidation would occur (optional, may not be present for all positions)
preorder.liquidationRisk.liquidationPrice.currencystring·required
The currency code (e.g., "USD", "BTC", "ETH")Example: USD
preorder.liquidationRisk.liquidationPrice.valuestring (decimal)·required
The amount in the specified currencyExample: 10000.00
postorderobject·required
Margin risk statistics after the order would be executed
postorder.marginAssetValueobject·required
The total value of all assets available in the margin account
postorder.marginAssetValue.currencystring·required
The currency code (e.g., "USD", "BTC", "ETH")Example: USD
postorder.marginAssetValue.valuestring (decimal)·required
The amount in the specified currencyExample: 10000.00
postorder.availableCollateralobject·required
The amount of collateral available for new positions
postorder.availableCollateral.currencystring·required
The currency code (e.g., "USD", "BTC", "ETH")Example: USD
postorder.availableCollateral.valuestring (decimal)·required
The amount in the specified currencyExample: 10000.00
postorder.notionalValueobject·required
The total value of all open positions
postorder.notionalValue.currencystring·required
The currency code (e.g., "USD", "BTC", "ETH")Example: USD
postorder.notionalValue.valuestring (decimal)·required
The amount in the specified currencyExample: 10000.00
postorder.totalBorrowedobject·required
The total amount currently borrowed
postorder.totalBorrowed.currencystring·required
The currency code (e.g., "USD", "BTC", "ETH")Example: USD
postorder.totalBorrowed.valuestring (decimal)·required
The amount in the specified currencyExample: 10000.00
postorder.leveragestring (decimal)·required
The leverage ratioExample: 1.5
postorder.reservedBuyOrdersobject·required
Collateral reserved for open buy orders
postorder.reservedBuyOrders.currencystring·required
The currency code (e.g., "USD", "BTC", "ETH")Example: USD
postorder.reservedBuyOrders.valuestring (decimal)·required
The amount in the specified currencyExample: 10000.00
postorder.reservedSellOrdersobject·required
Collateral reserved for open sell orders
postorder.reservedSellOrders.currencystring·required
The currency code (e.g., "USD", "BTC", "ETH")Example: USD
postorder.reservedSellOrders.valuestring (decimal)·required
The amount in the specified currencyExample: 10000.00
postorder.buyingPowerobject·required
The maximum value that can be purchased
postorder.buyingPower.currencystring·required
The currency code (e.g., "USD", "BTC", "ETH")Example: USD
postorder.buyingPower.valuestring (decimal)·required
The amount in the specified currencyExample: 10000.00
postorder.sellingPowerobject·required
The maximum value that can be sold
postorder.sellingPower.currencystring·required
The currency code (e.g., "USD", "BTC", "ETH")Example: USD
postorder.sellingPower.valuestring (decimal)·required
The amount in the specified currencyExample: 10000.00
postorder.liquidationRiskobject
Liquidation risk information (only present if applicable)
postorder.liquidationRisk.lossPercentagestring (decimal)·required
The percentage loss from current value that would trigger liquidation, formatted as decimal (e.g., "0.1550" = 15.50%)Example: 0.1550
postorder.liquidationRisk.liquidationPriceobject
The estimated price at which liquidation would occur (optional, may not be present for all positions)
postorder.liquidationRisk.liquidationPrice.currencystring·required
The currency code (e.g., "USD", "BTC", "ETH")Example: USD
postorder.liquidationRisk.liquidationPrice.valuestring (decimal)·required
The amount in the specified currencyExample: 10000.00
Example Responses
{
  "preorder": {
    "marginAssetValue": {
      "currency": "USD",
      "value": "10000.00"
    },
    "availableCollateral": {
      "currency": "USD",
      "value": "8500.00"
    },
    "notionalValue": {
      "currency": "USD",
      "value": "15000.00"
    },
    "totalBorrowed": {
      "currency": "USD",
      "value": "5000.00"
    },
    "leverage": "1.5",
    "reservedBuyOrders": {
      "currency": "USD",
      "value": "0.00"
    },
    "reservedSellOrders": {
      "currency": "USD",
      "value": "0.00"
    },
    "buyingPower": {
      "currency": "USD",
      "value": "8500.00"
    },
    "sellingPower": {
      "currency": "USD",
      "value": "8500.00"
    }
  },
  "postorder": {
    "marginAssetValue": {
      "currency": "USD",
      "value": "10000.00"
    },
    "availableCollateral": {
      "currency": "USD",
      "value": "6000.00"
    },
    "notionalValue": {
      "currency": "USD",
      "value": "40000.00"
    },
    "totalBorrowed": {
      "currency": "USD",
      "value": "30000.00"
    },
    "leverage": "4.0",
    "reservedBuyOrders": {
      "currency": "USD",
      "value": "0.00"
    },
    "reservedSellOrders": {
      "currency": "USD",
      "value": "0.00"
    },
    "buyingPower": {
      "currency": "USD",
      "value": "6000.00"
    },
    "sellingPower": {
      "currency": "USD",
      "value": "6000.00"
    },
    "liquidationRisk": {
      "lossPercentage": "0.6000",
      "liquidationPrice": {
        "currency": "USD",
        "value": "30000.00"
      }
    }
  }
}
PreviousGet Margin Interest RatesNextStaking
Last modified on May 5, 2026