Preview Margin Order Impact
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.
Request
- Base URLhttps://api.gemini.com
- URLhttps://api.gemini.com/v1/margin/order/preview
- AuthAPI key in header X-GEMINI-APIKEY and API key in header X-GEMINI-SIGNATURE and API key in header X-GEMINI-PAYLOAD
Headers
Your API key
HEX-encoded HMAC-SHA384 of payload signed with API secret
Base64-encoded JSON payload
Request body
Example request
{
"nonce": "1495127793000",
"symbol": "btcusd",
"side": "buy",
"type": "limit",
"amount": "0.5",
"price": "50000.00",
"totalSpend": "25000.00"
}Response
Pre-order and post-order margin risk statistics
Example response
{
"preorder": {
"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",
"reservedBuyOrders": {
"currency": "USD",
"value": "10000.00"
},
"reservedSellOrders": {
"currency": "USD",
"value": "10000.00"
},
"buyingPower": {
"currency": "USD",
"value": "10000.00"
},
"sellingPower": {
"currency": "USD",
"value": "10000.00"
},
"liquidationRisk": {
"lossPercentage": "0.1550",
"liquidationPrice": {
"currency": "USD",
"value": "10000.00"
}
}
},
"postorder": {
"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",
"reservedBuyOrders": {
"currency": "USD",
"value": "10000.00"
},
"reservedSellOrders": {
"currency": "USD",
"value": "10000.00"
},
"buyingPower": {
"currency": "USD",
"value": "10000.00"
},
"sellingPower": {
"currency": "USD",
"value": "10000.00"
},
"liquidationRisk": {
"lossPercentage": "0.1550",
"liquidationPrice": {
"currency": "USD",
"value": "10000.00"
}
}
}
}Changes
No recorded changes to this operation across all 1 revision of this API.