Get holdings (demat, T+1+)
"Holdings" are equity shares that have settled into your demat account — i.e. bought via CNC and held past T+1 settlement. This is distinct from "positions" (chapter 16), which includes same-day and unsettled trades.
holdings = kite.holdings()
for h in holdings:
print(h["tradingsymbol"], h["quantity"], h["average_price"], h["last_price"])
Key fields per holding:
{
"tradingsymbol": "INFY",
"exchange": "NSE",
"isin": "INE009A01021",
"quantity": 10, # settled, freely sellable quantity
"t1_quantity": 5, # bought today/yesterday, not yet settled
"average_price": 1450.20,
"last_price": 1478.90,
"pnl": 287.0,
"collateral_quantity": 0, # pledged as collateral, not sellable
}
quantity vs t1_quantity — matters for selling
You can only sell quantity shares without special handling; t1_quantity is bought but not yet settled (T+1 rolling settlement in India). Some brokers allow selling T+1 holdings same-day via a specific product code (BTST — Buy Today Sell Tomorrow — carries its own auction/short-delivery risk if the sale doesn't line up with settlement). If your strategy churns positions quickly, don't assume quantity includes everything you recently bought.
def sellable_quantity(holding: dict) -> int:
return holding["quantity"] - holding.get("collateral_quantity", 0)
Use case: reconciliation
Before your bot manages a long-term equity book, always reconcile its internal state against kite.holdings() on startup — never trust that your local database matches reality after a crash, manual intervention, or partial fill you didn't handle (chapter 56).