Recently I started dealing with the xVA and the associated EPE and ENE concepts.
In a numerical example of an FX Forward, after simulating the underlying FX spot $S_t$ (units of domestic per unit of foreign) using GBM ($S_{t} = S_{t-1}e^{(\mu-\frac{\sigma^{2}}{2})dt +\sigma\sqrt{dt}Z_{t-1}}$) the present value of the FX Forward contract for each time point and simulation node is calculated by the following equation:
$V_{t} = S_{t}e^{-r_{for}(T-t)} - Ke^{-r_{dom}(T-t)}$ (1)
In the above equation $S_{t}$ is the simulated underlying FX sport, $r_{for}$ is the interest rate of the foreign currency, $r_{dom}$ is the interest rate of the domestic currency, $T$ maturity, $t$ the time point and finally, $K$ the strike level which was determined at the inception of the contract as the forward exchange rate at maturity (i.e., no-arbitrage opportunities): $K = F_{0,T} = S_{0}e^{(r_{dom} - r_{for})T} $
How equation (1) is derived (I presume that the interest rate parity should be used)?