Calculating Daily Returns for Futures Contract

I am calculating daily returns for a position in a futures contract. I am a little stuck with margin and how to account for it. I specifically dont understand how return is calculated after Margin account falls below Maintenance Margin. I will ask my issue through an example , please help if you can :)

Lets say we have a position in the Nifty Index Future(the underlying is Nifty Index, Lot Size is 50, and lets say InitialMargin is 10% and Maintenance Margin is 85% and any extra money is kept in the MarginAccount and not removed). Ignore any transaction cost

Bought the IndexFuture at the price 6000, so Initial Margin is (6000*50*10/100) 30,000 and Maintenance Margin is 25,500.

Starting Futures Value(6000*50)=300,000; MarginAccount = 30,000
At end of Day 1, price of futures contract is 5900. So
New Futures Value(5900*50)=295,000
PnL =-5000
Return (PnL/Margin=-5000/30,000) =-16.67%
Margin Account (30,000 + -5000) = 25,000

Starting Futures Value(5900*50)=295,000; MarginAccount = 25,000
At the end of Day 2, price is 5800
New Futures Value(5800*50)=290,000
PnL =-5000
Return (PnL/Margin=-5000/25000) =-20%
Margin Account (25,000 + -5000) = 20,000

This is below the Maintenance Margin, so before the end of this day we add money(10,000) to make the Margin Account back to 30,000 (the initial margin)

Now, how do I calculate returns for day 3, should I use 30,000 (The Margin account value) or should I use 40,000 (which will be capital invested i.e. 30,000 + 10,000)

Please let me know what you guys think Thanks

Similar threads