# Mark-to-market PnL of Repo

My understanding of repos, especially buy-sell-backs, is that the first and second leg amounts are set at the the trade date (with coupon adjustments taken into account should there be any). The mark-to-market of the repo beyond the first leg settlement date will then just be the discounted value of the second leg cashflow.

However, the mark-to-market PnL? How is it calculated? I assume it will be the discounted leg 2 cashflow less the first leg cashflow and the interest accrued on it to valuation date (accrued at the agreed upon repo rate), i.e.

$$\text{MtM PnL} = \text{NPV}\left(\text{Leg}_{2} \text{ Cashflow}\right) - \left[\text{Leg}_1 \text{ Cashflow + Repo Interest}\right]$$

Is this correct?

My other thought is that the mark-to-market PnL would just be the difference from the morning's opening MtM and the closing MtM.

Which is correct? Thanks in advance.