On 05/06/2018, 100 shares which you bought first on 01/01/2018 will move out of your demat account to Zerodha pledge account. The movement of shares for a pledge happens based on FIFO itself. So the remaining shares in your demat will be the 100 shares which you bought on 01/06/2018. Now any sale transaction will effect in shares being debited out of what is available in your demat account. Therefore, on 01/01/2019 the 100 shares available in your account which was bought on 01/06/2018 will be debited and you will be having 100 shares under pledge at Rs. 515 each.
I had a question. After the migration to the new pledge mechanism, as the pledged shares now remain within one’s Demat account itself, can it be said that the above example (mainly the part about shares bought at Rs.615 being debited) is no longer valid (leaving aside accounting / P&L computation which will always happen based on FIFO basis as you clarified in another thread)?
Yes, you are right. So in the above example, there’ll be a small change. After all transactions, the 100 shares available in your account under pledge will be at an average price of 615 each.