HomeDocumentationAPI Reference
Log In
API Reference

Get Margin

Calculates margin for a given portfolio and (optionally) a simulated state change.
Does not take into account open orders margin requirements.public/withdraw_debug

Body Params
string
enum
required

PM (Portfolio Margin), PM2 (Portfolio Margin 2), or SM` (Standard Margin))

Allowed:
string | null
Defaults to null

Must be defined for Portfolio Margin

simulated_collateral_changes
array of objects | null
Defaults to null

Optional, add collaterals to simulate deposits / withdrawals / spot trades

simulated_collateral_changes
simulated_collaterals
array of objects
required

List of collaterals in a simulated portfolio

simulated_collaterals*
simulated_position_changes
array of objects | null
Defaults to null

Optional, add positions to simulate perp / option trades

simulated_position_changes
simulated_positions
array of objects
required

List of positions in a simulated portfolio

simulated_positions*
Response

Language
URL
Response
Click Try It! to start a request and see the response here! Or choose an example:
application/json