Portfolio positions API returning realized Pnl as unrealized Pnl

Abid
I am using https://kite.trade/docs/connect/v3/portfolio/#positions API to fetch the realized & unrealized Pnl for instruments for the day at the end of the day.
But, even if I call the API as late as 11:30 PM I am seeing the instruments realized PnL is coming as unrealized PnL.

Example response for one of the options instrument which i tried today at around 11:40 PM.

{
"status": "success",
"data": {
"day": [
{
"tradingsymbol": "SENSEX2581980500PE",
"exchange": "BFO",
"instrument_token": 216814597,
"product": "MIS",
"segment": "FO",
"quantity": 0,
"overnight_quantity": 0,
"overnight_price": 0,
"overnight_value": 0,
"multiplier": 1,
"average_price": 0,
"close_price": 265.45,
"last_price": 24,
"value": 140,
"pnl": -140,
"m2m": -140,
"unrealised": -140,
"realised": 0,
"buy_quantity": 240,
"buy_price": 25.716666666666665,
"buy_value": 6172,
"buy_m2m": 6172,
"sell_quantity": 240,
"sell_price": 25.133333333333333,
"sell_value": 6032,
"sell_m2m": 6032,
"day_buy_quantity": 240,
"day_buy_price": 25.716666666666665,
"day_buy_value": 6172,
"day_sell_quantity": 240,
"day_sell_price": 25.133333333333333,
"day_sell_value": 6032
},
{
"tradingsymbol": "SENSEX2581980600CE",
"exchange": "BFO",
"instrument_token": 216831237,
"product": "MIS",
"segment": "FO",
"quantity": 0,
"overnight_quantity": 0,
"overnight_price": 0,
"overnight_value": 0,
"multiplier": 1,
"average_price": 0,
"close_price": 382.35,
"last_price": 857.75,
"value": 2023,
"pnl": -2023,
"m2m": -2023,
"unrealised": -2023,
"realised": 0,
"buy_quantity": 20,
"buy_price": 1084.55,
"buy_value": 21691,
"buy_m2m": 21691,
"sell_quantity": 20,
"sell_price": 983.4,
"sell_value": 19668,
"sell_m2m": 19668,
"day_buy_quantity": 20,
"day_buy_price": 1084.55,
"day_buy_value": 21691,
"day_sell_quantity": 20,
"day_sell_price": 983.4,
"day_sell_value": 19668
},
{
"tradingsymbol": "SENSEX2581981700CE",
"exchange": "BFO",
"instrument_token": 216886789,
"product": "MIS",
"segment": "FO",
"quantity": 0,
"overnight_quantity": 0,
"overnight_price": 0,
"overnight_value": 0,
"multiplier": 1,
"average_price": 0,
"close_price": 56.45,
"last_price": 111,
"value": 1090,
"pnl": -1090,
"m2m": -1090,
"unrealised": -1090,
"realised": 0,
"buy_quantity": 40,
"buy_price": 137.85,
"buy_value": 5514,
"buy_m2m": 5514,
"sell_quantity": 40,
"sell_price": 110.6,
"sell_value": 4424,
"sell_m2m": 4424,
"day_buy_quantity": 40,
"day_buy_price": 137.85,
"day_buy_value": 5514,
"day_sell_quantity": 40,
"day_sell_price": 110.6,
"day_sell_value": 4424
},
{
"tradingsymbol": "NIFTY2582125200CE",
"exchange": "NFO",
"instrument_token": 12097538,
"product": "NRML",
"segment": "FO",
"quantity": 0,
"overnight_quantity": 0,
"overnight_price": 0,
"overnight_value": 0,
"multiplier": 1,
"average_price": 0,
"close_price": 12.35,
"last_price": 25.45,
"value": 768.75,
"pnl": -768.75,
"m2m": -768.75,
"unrealised": -768.75,
"realised": 0,
"buy_quantity": 75,
"buy_price": 64.5,
"buy_value": 4837.5,
"buy_m2m": 4837.5,
"sell_quantity": 75,
"sell_price": 54.25,
"sell_value": 4068.75,
"sell_m2m": 4068.75,
"day_buy_quantity": 75,
"day_buy_price": 64.5,
"day_buy_value": 4837.5,
"day_sell_quantity": 75,
"day_sell_price": 54.25,
"day_sell_value": 4068.75
}
],
"net": [
{
"tradingsymbol": "SENSEX2581980500PE",
"exchange": "BFO",
"instrument_token": 216814597,
"product": "MIS",
"segment": "FO",
"quantity": 0,
"overnight_quantity": 0,
"overnight_price": 0,
"overnight_value": 0,
"multiplier": 1,
"average_price": 0,
"close_price": 265.45,
"last_price": 24,
"value": 140,
"pnl": -140,
"m2m": -140,
"unrealised": -140,
"realised": 0,
"buy_quantity": 240,
"buy_price": 25.716666666666665,
"buy_value": 6172,
"buy_m2m": 6172,
"sell_quantity": 240,
"sell_price": 25.133333333333333,
"sell_value": 6032,
"sell_m2m": 6032,
"day_buy_quantity": 240,
"day_buy_price": 25.716666666666665,
"day_buy_value": 6172,
"day_sell_quantity": 240,
"day_sell_price": 25.133333333333333,
"day_sell_value": 6032
},
{
"tradingsymbol": "SENSEX2581980600CE",
"exchange": "BFO",
"instrument_token": 216831237,
"product": "MIS",
"segment": "FO",
"quantity": 0,
"overnight_quantity": 0,
"overnight_price": 0,
"overnight_value": 0,
"multiplier": 1,
"average_price": 0,
"close_price": 382.35,
"last_price": 857.75,
"value": 2023,
"pnl": -2023,
"m2m": -2023,
"unrealised": -2023,
"realised": 0,
"buy_quantity": 20,
"buy_price": 1084.55,
"buy_value": 21691,
"buy_m2m": 21691,
"sell_quantity": 20,
"sell_price": 983.4,
"sell_value": 19668,
"sell_m2m": 19668,
"day_buy_quantity": 20,
"day_buy_price": 1084.55,
"day_buy_value": 21691,
"day_sell_quantity": 20,
"day_sell_price": 983.4,
"day_sell_value": 19668
},
{
"tradingsymbol": "SENSEX2581981700CE",
"exchange": "BFO",
"instrument_token": 216886789,
"product": "MIS",
"segment": "FO",
"quantity": 0,
"overnight_quantity": 0,
"overnight_price": 0,
"overnight_value": 0,
"multiplier": 1,
"average_price": 0,
"close_price": 56.45,
"last_price": 111,
"value": 1090,
"pnl": -1090,
"m2m": -1090,
"unrealised": -1090,
"realised": 0,
"buy_quantity": 40,
"buy_price": 137.85,
"buy_value": 5514,
"buy_m2m": 5514,
"sell_quantity": 40,
"sell_price": 110.6,
"sell_value": 4424,
"sell_m2m": 4424,
"day_buy_quantity": 40,
"day_buy_price": 137.85,
"day_buy_value": 5514,
"day_sell_quantity": 40,
"day_sell_price": 110.6,
"day_sell_value": 4424
},
{
"tradingsymbol": "NIFTY2582125200CE",
"exchange": "NFO",
"instrument_token": 12097538,
"product": "NRML",
"segment": "FO",
"quantity": 0,
"overnight_quantity": 0,
"overnight_price": 0,
"overnight_value": 0,
"multiplier": 1,
"average_price": 0,
"close_price": 12.35,
"last_price": 25.45,
"value": 768.75,
"pnl": -768.75,
"m2m": -768.75,
"unrealised": -768.75,
"realised": 0,
"buy_quantity": 75,
"buy_price": 64.5,
"buy_value": 4837.5,
"buy_m2m": 4837.5,
"sell_quantity": 75,
"sell_price": 54.25,
"sell_value": 4068.75,
"sell_m2m": 4068.75,
"day_buy_quantity": 75,
"day_buy_price": 64.5,
"day_buy_value": 4837.5,
"day_sell_quantity": 75,
"day_sell_price": 54.25,
"day_sell_value": 4068.75
}
]
}
}
Sign In or Register to comment.