get_margin
Retrieve current margin and optionally simulate position or collateral changes to validate trade impact and amount constraints before placing orders.
Instructions
Get current margin. Optionally simulate position/collateral changes before trading. Validates simulated amounts against instrument minimum_amount and amount_step — if amounts violate constraints, returns is_valid_trade=false with violations (the real order would reject). CRITICAL: Simulation evaluates all positions ATOMICALLY as a portfolio — but orders execute LEG BY LEG. A multi-leg spread may show is_valid_trade=true in simulation but FAIL on execution because each leg is margined independently. For multi-leg strategies: simulate EACH sell/short leg INDIVIDUALLY against current positions to verify it passes margin alone. Standard Margin (SM) does NOT net spreads — short options require full naked margin. Portfolio Margin (PM/PM2) does net spreads. Always check margin_type from get_subaccount before placing short option orders.
Tool call template
This tool declares no required parameters. Add optional parameters from the input schema as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {},
"name": "get_margin"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| subaccount_id | No | Subaccount ID (defaults to configured) | |
| simulated_position_changes | No | Simulate position changes to check margin impact | |
| simulated_collateral_changes | No | Simulate collateral changes |