Solution (source code)

= Solution

Each floating payment in the <interest rate swap> has initial value $P_0(t-1)-P_0(t)$ by the previous replication. Their sum telescopes to $1-P_0(T)$. The fixed leg pays $s$ at each of the same dates, so its initial value is $s\sum_{t=1}^T P_0(t)$. Consequently the <par swap rate> is
$$
\boxed{s=\frac{1-P_0(T)}{\sum_{t=1}^T P_0(t)}.}
$$
The denominator is positive. This is for unit accrual periods and the printed floating-minus-fixed payments. No extra exchange of principal occurs in the contract; the principal-like terms appear only because the floating-leg replication telescopes.