Funds and Margin
Check available funds, estimate margin, and review charges and ledger entries. Ask your AI client in plain language; it picks the tool.
get_funds
Get available funds and margin information for different market segments, essential for checking buying power before orders. Use to check balance, verify buying power, display account balance, and calculate maximum order size across market segments.
Example prompts
- “How much margin do I have available?”
- “What is my available balance for equity trading?”
calculate_span_margin
Calculate SPAN and exposure margin for a basket of positions or planned orders before placing them. Use when user asks how much margin is needed for a strategy.
Example prompts
- “How much margin do I need to sell one lot of NIFTY futures?”
- “Calculate the margin for a short straddle on BANKNIFTY.”
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
positions | string | yes | JSON array of positions. Each: {“symbol”:“NSE:NIFTY…”,“qty”:50,“side”:1,“type”:2,“productType”:“INTRADAY”,“limitPrice”:0.0,“stopLoss”:0.0}. side: 1=Buy, -1=Sell. type: 1=Limit, 2=Market, 3=Stop, 4=StopLimit. |
get_charges_history
Fetch brokerage, taxes, STT, and charges for a date range. Auto-paginates all records. Returns per-day breakdown and yearly totals. Defaults to current financial year.
Example prompts
- “How much brokerage and taxes did I pay this financial year?”
- “Show my STT and charges for last month.”
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
exchange_type | string | no | 0=All, 1=NSE, 2=BSE, 3=MCX (default: 0) |
from_date | string | no | Start date in YYYY-MM-DD format (default: start of current financial year) |
report_type | string | no | 1=Date-wise, 2=Summarised segment-wise (default: 1) |
segment_type | string | no | 0=All, 1=Equity, 2=Equity Derivatives, 3=Mutual Funds, 4=Currency Derivatives, 5=Commodity Derivatives (default: 0) |
to_date | string | no | End date in YYYY-MM-DD format (default: today) |
get_ledger_history
Fetch account ledger transactions. Auto-paginates all records. Returns credits, debits, running balance, and fund flow summary. Defaults to current financial year.
Example prompts
- “Show my ledger entries for this month.”
- “List all fund additions and withdrawals this year.”
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
exchange_type | string | no | 0=All, 1=NSE, 2=BSE, 3=MCX (default: 0) |
from_date | string | no | Start date in YYYY-MM-DD format (optional) |
segment_type | string | no | 0=All, 1=Equity, 2=Equity Derivatives, 3=Mutual Funds, 4=Currency Derivatives, 5=Commodity Derivatives (default: 0) |
to_date | string | no | End date in YYYY-MM-DD format (optional) |
transaction_type | string | no | 0=All, 1=BR/Funds Added, 2=BP/Funds Withdrawn, 3=SJ/Trading, 4=JV/Non Trading, 5=MTF (default: 0) |