Sell share pledge / unpledge category

Dear Zerodha,
Lets say I buy 1000 quantity niftybees and pledge. Then I buy again 50 quantity of nitfybees and those are NOT pledged. If niftybees moves up then I sell those 50 quanitity of niftybees which are not pledged, then which quantity exactly gets sold? Can you please confirm it will be latest 50 quantity and not from those 1000 pledged quantity? In other words, is the first buy first sell principal is not applicable in this case, right? Thanks.

Pledged shares cannot be sold without unpledging them. So the quantity sold will be the 50 shares you hold, which aren’t pledged. But the average price will be updated on a FIFO basis. Please check out this post for more info: Sell a pledged scrip - #4 by Nakul