Skip to main content
POST
private/get_margin

Authorizations

X-DeriveWallet
string
header
required

The wallet the request acts for.

X-DeriveTimestamp
string
header
required

The current time in milliseconds, as a decimal string.

X-DeriveSignature
string
header
required

EIP-191 signature of the timestamp, by the wallet or one of its session keys.

Body

application/json
subaccount_id
integer<uint64>
required
Required range: x >= 0
is_delayed_liquidation
boolean
default:false

true margins under the subaccount's delayed-liquidation override, as order checks do. Rejected for a subaccount without one.

simulated_collateral_changes
object[] | null

Optional collateral deltas to simulate deposits / withdrawals / spot trades.

simulated_position_changes
object[] | null

Optional position deltas to simulate perp / option trades.

Response

Success

Result of public/get_margin / private/get_margin: net margin (MtM minus requirement; positive = healthy) before and after the simulated changes, as USD decimal strings.

is_valid_trade
boolean
required

true when post-change initial margin passes, or the change is risk-reducing while maintenance margin stays healthy.

post_initial_margin
string
required
post_maintenance_margin
string
required
pre_initial_margin
string
required
pre_maintenance_margin
string
required
subaccount_id
integer<uint64>
required

0 for the public simulated-portfolio variant.

Required range: x >= 0