Margin
This guide describes how to calculate required margin for orders and get available user margin using the SDK.
Get Available User Margin
Easily retrieve your available margin details for equity, F&O, and commodity segments using this get_available_margin_details method.
Python SDK Usage
Response Payload
All prices in rupees.
Note: Commodity orders require SPAN and Exposure margins. The margin requirement varies by:
- Product type (MIS for intraday, NRML for carry forward)
- Contract value and volatility
- Exchange regulations
Response Schema
| Name | Type | Description |
|---|---|---|
| clear_cash | float | Clear cash available |
| net_margin_used | float | Net margin used |
| brokerage_and_charges | float | Brokerage and charges |
| collateral_used | float | Collateral used |
| collateral_available | float | Collateral available |
| adhoc_margin | float | Adhoc margin available |
| net_fno_margin_used | float | Net FnO margin used |
| span_margin_used | float | Span Margin Used (for F&O) |
| exposure_margin_used | float | Exposure Margin Used (for F&O) |
| future_balance_available | float | Future Balance Available |
| option_buy_balance_available | float | Option Buy Balance Available |
| option_sell_balance_available | float | Option Sell Balance Available |
| net_equity_margin_used | float | Net equity margin used |
| cnc_margin_used | float | CNC margin used |
| mis_margin_used | float | MIS margin used |
| cnc_balance_available | float | CNC balance available |
| mis_balance_available | float | MIS balance available |
| commodity_span_margin | float | SPAN margin used for commodity trading |
| commodity_exposure_margin | float | Exposure margin used for commodity trading |
| commodity_tender_margin | float | Tender margin for commodity contracts nearing delivery |
| commodity_special_margin | float | Special margin levied during high volatility in commodities |
| commodity_additional_margin | float | Additional margin requirements for commodity positions |
| commodity_unrealised_m2m | float | Unrealised mark-to-market profit/loss for commodity positions |
| commodity_realised_m2m | float | Realised mark-to-market profit/loss for commodity positions |
Required Margin For Order
Calculate the required margin for a single order or basket of orders using this get_order_margin_details method. Basket orders are only supported for FNO Segment.
Python SDK Usage
Request Schema
| Name | Type | Description |
|---|---|---|
trading_symbol * | string | Trading Symbol of the instrument as defined by the exchange |
quantity * | integer | Quantity of instrument to order |
| price | decimal | Price of the instrument in rupees case of Limit order |
exchange * | string | Stock exchange |
segment * | string | Segment of the instrument such as CASH, FNO and COMMODITY. |
product * | string | Product type |
order_type * | string | Order type |
transaction_type * | string | Transaction type of the trade |
*required parameters
Response Payload
All prices in rupees.
Response Schema
| Name | Type | Description |
|---|---|---|
| exposure_required | float | Margin required to cover the exposure for the trade. |
| span_required | float | SPAN margin required for F&O trades (not applicable for equity cash segment). |
| option_buy_premium | float | Premium amount required for buying options contracts. |
| brokerage_and_charges | float | Total brokerage and other exchange-related charges for the order. |
| total_requirement | float | Total margin requirement including all charges and margin components. |
| cash_cnc_margin_required | float | Margin required for CNC (Cash & Carry) orders in the cash segment. |
| cash_mis_margin_required | float | Margin required for MIS (Margin Intraday Square-off) orders in the cash segment. |
| physical_delivery_margin_requirement | float | Additional margin required for physical settlement of derivative contracts. |