In my quest for simulated data, I am trying to generate prices for Total Return Swaps by calculating the NPVs of the fixed and floating leg. My problem: Given the fixed leg, how do I set the spread on the floating leg so that the value of the swap at the beginning equals Zero?

On a more technical side: Using RQuantLib, I use FloatingRateBond to calculate the NPV. How exactly do I set the spread there? The documentation is a bit unclear at that point.


1 Answer 1


Not sure I understand your question. If I have a fixed stream of payments it has some value $V_{fixed}$ I can always solve for a spread to LIBOR by simply adding the spread $S$ to my calculated stream of LIBOR.

That is the value of the LIBOR + spread leg is
$$ V_{LIBOR}(S) = \sum_{n=1}^{N} D(t_{n}) \alpha(t_{n-1},t_{n}) [L(t_{n-1},t_{n}) + S] $$ where $D(t_{n})$ is the discount factor, $\alpha$ is the day count fraction, and $L$ is the LIBOR rate. I just solve $$ V_{LIBOR}(S) = V_{fixed} $$ for S.

Computing the value of the fixed leg for a TRS might be tricky, as you have to factor in the default probability. But you can hopefully get that from the CDS market.

  • $\begingroup$ Thanks for the reply, it certainly points me into the right direction. I just hoped there would be a shortcut. I'll try to solve that, but the problem got on the backburner. Will be back with comments or questions then. $\endgroup$
    – Owe Jessen
    May 9, 2011 at 14:44
  • $\begingroup$ I wonder in your answer, why the Libor leg is not influenced by default. Doesn't default also terminate the Libor leg. As such, the value of each Libor leg cash flow should be weighted by the survival prob, shouldn't it? $\endgroup$
    – user7609
    Mar 22, 2014 at 16:05

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.