Hi I'm trying to understand the response structure of the GET /portfolio/holdings API, specifically the meaning and differences between the following fields: quantity, t1_quantity, used_quantity, realised_quantity, and opening_quantity. Could you please clarify: What each of these fields represents, especially in the context of settlement timelines (T+1)? Which fields should be considered when calculating the total holdings for an account, to ensure the value is accurate and not overstated? Also there is quantity and used_quantity inside the field mtf. What to make of it?
It is not very clear from the documentation as to what fields to consider for calculating the actual holdings. From what you mentioned about quantity field, that it will only have T+2 quantity, I am getting correct results of holdings if I am adding quantity and t1_quantity fields. This means that the documentation has incorrect explanation of field `quantity`.
For my purpose - I am trying to determine the actual holdings for the account and I am adding up the below fields to get the response. totalUnits = resp.quantity + resp.t1_quantity + resp.used_quantity In most of the cases it is returning the correct response but then when there are values inside the mtf field, my holdings calculation is not matching the exact amount. Can you please shed more light on mtf.quantity and mtf.used_quantity and how I should use those fields for final holdings calculation? Also please verify if my above calculation for holdings is correct in normal case scenario where the mtf field has 0 quantity and used_quantity.
You can refer to the updated API documentation for details. To calculate the total quantity in your portfolio, you need to combine the quantity field, t_1 quantity field, and MTF quantity field.
https://kite.trade/docs/connect/v3/portfolio/#holdings
From what you mentioned about quantity field, that it will only have T+2 quantity, I am getting correct results of holdings if I am adding quantity and t1_quantity fields. This means that the documentation has incorrect explanation of field `quantity`.
For my purpose - I am trying to determine the actual holdings for the account and I am adding up the below fields to get the response.
totalUnits = resp.quantity + resp.t1_quantity + resp.used_quantity
In most of the cases it is returning the correct response but then when there are values inside the mtf field, my holdings calculation is not matching the exact amount.
Can you please shed more light on mtf.quantity and mtf.used_quantity and how I should use those fields for final holdings calculation?
Also please verify if my above calculation for holdings is correct in normal case scenario where the mtf field has 0 quantity and used_quantity.