How do you calculate the discount margin of a floating rate bond using flat yield? What is the formula?


2 Answers 2


I think you mean this:

enter image description here enter image description here

Another DM variant is this: enter image description here


enter image description here

This document has numerical examples.

  • 1
    $\begingroup$ Thank you very much! $\endgroup$
    – arnis
    Commented Dec 30, 2020 at 19:08

I am a co-author of that paper. You may want to check out FinancePy which is a beta version of a finance library where I have implemented the code for calculating the discount margin. Here is an example Jupyter notebook that reproduces (almost exactly) a Bloomberg example.


The underlying code is in


Contact me at [email protected] if you have any issues or questions regarding FinancePy.

  • $\begingroup$ Can your library also be used for bonds with irregular cashflows? Eg if I have modelled the cashflows from an ABS / RMBS / bespoke investment separately (I don't want your library to do that), can I use your library to calculate the DM of those cashflows? $\endgroup$ Commented Feb 9, 2021 at 23:09
  • $\begingroup$ It should be possible - you would need to set the internal date and flow schedule (one is a list of dates and the other is a list of floats) - as everything is open in Python this should be possible. Can you add this as a request on github issues github.com/domokane/FinancePy/issues and I can see if I can add a method which makes it easier to do and has some validation checks. Or contact me via [email protected] $\endgroup$
    – Dom
    Commented Feb 10, 2021 at 9:30
  • $\begingroup$ Could you elaborate on what $L_{\text{stub}}$ is or how it is calculated? $\endgroup$
    – Deane Yang
    Commented Apr 30, 2023 at 3:29

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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