Skip to content

Funds

Users can get details about the fund requirements or available funds (with margin requirements) in their Trading Account.

POST /margincalculator Margin requirement for any order
GET /fundlimit Retrieve trading account fund information

Margin Calculator

Fetch span, exposure, var, brokerage, leverage, available margin values for any type of order and instrument that you want to place.

    curl --request POST \
    --url https://api.dhan.co/v2/margincalculator \
    --header 'Accept: application/json' \
    --header 'Content-Type: application/json' \
    --header 'access-token: ' \
    --data '{Request JSON}'

Request Structure

{
    "dhanClientId": "1000000132",
    "exchangeSegment": "NSE_EQ",
    "transactionType": "BUY",
    "quantity": 5,
    "productType": "CNC",
    "securityId": "1333",
    "price": 1428,
    "triggerPrice": 1427,
}


Parameters

Field Type Description
dhanClientId
required
string User specific identification generated by Dhan
exchangeSegment
required
enum string Exchange & Segment
NSE_EQ NSE_FNO  BSE_EQ BSE_FNO  MCX_COMM
transactionType
required
enum string The trading side of transaction
BUY  SELL
quantity
required
int Number of shares for the order
productType
required
enum string Product type
CNC  INTRADAY MARGIN MTF  CO BO
securityId
required
string Exchange standard id for each scrip. Refer here
price
required
float Price at which order is placed
triggerPrice
conditionally required
float Price at which the order is triggered, in case of SL-M & SL-L

Response Structure

{
    "totalMargin": -3.402823669209385e+38,
    "spanMargin": -3.402823669209385e+38,
    "exposureMargin": -3.402823669209385e+38,
    "availableBalance": -3.402823669209385e+38,
    "variableMargin": -3.402823669209385e+38,
    "insufficientBalance": -3.402823669209385e+38,
    "brokerage": -3.402823669209385e+38,
    "leverage": "string"
}

Parameters

Field Type Description
totalMargin float Total Margin required for placing the order successfully
spanMargin float SPAN margin required
exposureMargin float Exposure margin required
availableBalance float Available amount in trading account
variableMargin float VAR or Variable margin required
insufficientBalance float Insufficient amount in trading account (Available Balance - Total Margin)
brokerage float Brokerage charges for executing order
leverage string Margin leverage provided for the order as per product type

Fund Limit

Get all information of your trading account like balance, margin utilised, collateral, etc.

    curl --request GET \
    --url https://api.dhan.co/v2/fundlimit \
    --header 'Content-Type: application/json' \
    --header 'access-token: JWT'

Request Structure

No Body

Response Structure

{
    "dhanClientId":"1000000009",
    "availabelBalance": 98440.0,
    "sodLimit": 113642,
    "collateralAmount": 0.0,
    "receiveableAmount": 0.0,
    "utilizedAmount": 15202.0,
    "blockedPayoutAmount": 0.0,
    "withdrawableBalance": 98310.0
}

Parameters

Field Type Description
dhanClientId string User specific identification generated by Dhan
availabelBalance float Available amount to trade
sodLimit float Start of the day balance in account
collateralAmount float Amount received against collateral
receiveableAmount float Amount available against selling deliveries
utilizedAmount float Amount utilised in the day
blockedPayoutAmount float Amount blocked against payout request
withdrawableBalance float Amount available to withdraw in bank account


Note: For description of enum values, refer Annexure