Margins & Risk FAQs¶
Below are the most common questions related to margin calculations, real-time updates, collateral pledging, and interpreting aggressor limit errors. Click any question to expand the detailed answer.
Margin Calculation & Funds¶
How do I calculate margin requirements using Nubra’s APIs?
You can calculate margin requirements using the Funds API (portfolio.funds()), which provides a live breakdown of cash, collateral, and margin usage across all segments. :contentReference[oaicite:0]{index=0}
From the response:
margin_used_deriv_traded→ margin used for executed derivative positionsmargin_block_deriv_open_order→ margin blocked for open derivative ordersmargin_used_eq_iday→ margin used for intraday equity positionsmargin_blocked_eq_iday_open→ margin blocked for open intraday equity orderstotal_margin_blocked→ total margin blocked (sum of all segments)net_margin_available→ free margin available for new orders
Can I retrieve user-specific margin or collateral details?
Use the Funds API (portfolio.funds()) — it returns detailed, user-specific cash and collateral information tied to your trading account (client_code). :contentReference[oaicite:1]{index=1}
Key fields:
total_collateral→ total value of pledged or margin-eligible holdingsstart_of_day_collateral→ starting pledged margin at market openiday_collateral_pledge→ intraday margin received from new pledgesiday_collateral_pledge_sell→ margin released from pledged holdings sold during the daynet_margin_available→ effective margin available to trade after accounting for all usage
Additionally, the Holdings API (portfolio.holdings()) provides per-stock collateral details:
margin_benefit→ margin value contributed by a specific pledged stockhaircut→ percentage reduction applied when calculating eligible collateralavailable_to_pledge/is_pledgeable→ shows what more can be pledged for margin benefit
How does Nubra handle margin updates during live trading sessions?
Nubra’s margin and funds data are updated in real time during the session: :contentReference[oaicite:2]{index=2}
- As new orders are placed →
margin_block_deriv_open_orderandmargin_blocked_eq_iday_openincrease. - When orders execute →
margin_used_deriv_tradedincreases. - When positions are squared off or MTM changes →
mtm_deriv,net_margin_available, andtotal_collateraladjust immediately. - If you pledge or unpledge stocks intraday →
iday_collateral_pledgeandiday_collateral_pledge_sellreflect live updates.
The Funds API gives a real-time snapshot every time it’s called, and you can refresh it periodically or trigger it after trade executions.
Collateral & Pledging¶
How can I confirm whether MTF or pledged margins are available via API?
Yes — Nubra exposes pledged and margin details through the Holdings and Funds APIs: :contentReference[oaicite:3]{index=3}
From Holdings API:
is_pledgeable→ indicates if a holding is eligible for margin (MTF or collateral)margin_benefit→ amount of margin derived from pledged sharesavailable_to_pledge→ how much more can be pledgedhaircut→ reduction applied to the pledged value
From Funds API:
total_collateral→ total pledged collateral marginstart_of_day_collateral/iday_collateral_pledge→ confirm pledged margin statusnet_margin_available→ total tradable margin after adding pledged + cash
These two APIs allow you to verify MTF/pledged margin availability and utilization in real time.
Risk & Errors¶
How do I interpret “above aggressor limit” errors in UAT or LIVE?
An “above aggressor limit” error means your order price is too far away from the prevailing market price, violating NSE’s price band or aggressor threshold. :contentReference[oaicite:4]{index=4}
Typical causes:
- Limit buy placed too far above LTP
- Limit sell placed too far below LTP
Cross-check using:
last_traded_price(Holdings/Positions)LTPfrom Market Quotes API
If the price exceeds allowed aggressor limits, the order is rejected in both UAT and LIVE.
Continue exploring related FAQs¶
Click any category to navigate directly to its FAQ group.
Market Data & WebSocket
Snapshot vs streaming, tick frequency, depth, and subscriptions.
Historical Data & Analytics
Intervals, corporate actions, adjustments, gaps, candle logic.
Orders & Execution
Order types, flexi & basket orders, modify/cancel, common errors.
Margins & Risk
Margin checks, aggressor limits, live updates, and risk rules.
Positions & Holdings
Day vs net, conversions, holding logic, and reconciliation.
Options Greeks & Strategy APIs
Real-time Greeks, IV/Delta strategies, multi-leg logic.