Unable to bootstrap USD 3M libor curve

classic Classic list List threaded Threaded
8 messages Options
Reply | Threaded
Open this post in threaded view
|

Unable to bootstrap USD 3M libor curve

sumit_uk1
Hi;

   I recently purchased the pdf book quantlib python cookbook by Luigi Ballabio

   I have been trying to bootstrap a USD 3M libor curve using a OIS (FF) discounting curve, but it keeps failing.

 Please see code attached.

  Can someone please help me?

Thanks
Sumit

-- 

------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
QuantLib-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/quantlib-users

usd_3m.py (7K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: Unable to bootstrap USD 3M libor curve

Luigi Ballabio
Hello Sumit,
    as far as I can see, you're using self.helpers to store the list of helpers for both bootstraps. When you bootstrap the OIS curve, you fill self.helpers with the OIS swap helpers.  When you bootstrap the Libor curve, you don't clean it up and add the Libor helpers (line 48, `self.helpers += [...]`).  This way, the second curve tries to bootstrap over both the Libor and OIS swaps and can't find rates that fit all of them.  To avoid mixups, I'd use two different variables for the two sets of helpers.

Hope this helps,
    Luigi


On Sun, May 28, 2017 at 11:37 PM Sumit Sengupta <[hidden email]> wrote:
Hi;

   I recently purchased the pdf book quantlib python cookbook by Luigi Ballabio

   I have been trying to bootstrap a USD 3M libor curve using a OIS (FF) discounting curve, but it keeps failing.

 Please see code attached.

  Can someone please help me?

Thanks
Sumit

-- 
------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot_______________________________________________
QuantLib-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/quantlib-users

------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
QuantLib-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/quantlib-users
Reply | Threaded
Open this post in threaded view
|

Re: Unable to bootstrap USD 3M libor curve

sumit_uk1
Thanks a lot Luigi. That works fine.

Can you please comment if I am doing the OIS (FF discounting) correctly? I am taking the basis swaps between O/N FF and 3M USD Libor and taking the:-

OIS rate = 3M USD Libor - spread

Is this as simple as this or do I need to do something else?

Thanks,
Sumit

On 29 May 2017 at 14:25, Luigi Ballabio <[hidden email]> wrote:
Hello Sumit,
    as far as I can see, you're using self.helpers to store the list of helpers for both bootstraps. When you bootstrap the OIS curve, you fill self.helpers with the OIS swap helpers.  When you bootstrap the Libor curve, you don't clean it up and add the Libor helpers (line 48, `self.helpers += [...]`).  This way, the second curve tries to bootstrap over both the Libor and OIS swaps and can't find rates that fit all of them.  To avoid mixups, I'd use two different variables for the two sets of helpers.

Hope this helps,
    Luigi


On Sun, May 28, 2017 at 11:37 PM Sumit Sengupta <[hidden email]> wrote:
Hi;

   I recently purchased the pdf book quantlib python cookbook by Luigi Ballabio

   I have been trying to bootstrap a USD 3M libor curve using a OIS (FF) discounting curve, but it keeps failing.

 Please see code attached.

  Can someone please help me?

Thanks
Sumit

-- 
------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot_______________________________________________
QuantLib-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/quantlib-users



--
Quant Strategist
(CFA, FRM)

mobile +44 (0)7961839363
1 Royal Exchange • EC3V 3DG London • UK

------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
QuantLib-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/quantlib-users
Reply | Threaded
Open this post in threaded view
|

Re: Unable to bootstrap USD 3M libor curve

Luigi Ballabio
Hello,
    it probably depends on the way the basis is quoted.  Is it a spread to add to the 3M leg in order to equal the OIS leg, or the other way around?

Luigi


On Mon, May 29, 2017 at 6:49 PM Sumit Sengupta <[hidden email]> wrote:
Thanks a lot Luigi. That works fine.

Can you please comment if I am doing the OIS (FF discounting) correctly? I am taking the basis swaps between O/N FF and 3M USD Libor and taking the:-

OIS rate = 3M USD Libor - spread

Is this as simple as this or do I need to do something else?

Thanks,
Sumit

On 29 May 2017 at 14:25, Luigi Ballabio <[hidden email]> wrote:
Hello Sumit,
    as far as I can see, you're using self.helpers to store the list of helpers for both bootstraps. When you bootstrap the OIS curve, you fill self.helpers with the OIS swap helpers.  When you bootstrap the Libor curve, you don't clean it up and add the Libor helpers (line 48, `self.helpers += [...]`).  This way, the second curve tries to bootstrap over both the Libor and OIS swaps and can't find rates that fit all of them.  To avoid mixups, I'd use two different variables for the two sets of helpers.

Hope this helps,
    Luigi


On Sun, May 28, 2017 at 11:37 PM Sumit Sengupta <[hidden email]> wrote:
Hi;

   I recently purchased the pdf book quantlib python cookbook by Luigi Ballabio

   I have been trying to bootstrap a USD 3M libor curve using a OIS (FF) discounting curve, but it keeps failing.

 Please see code attached.

  Can someone please help me?

Thanks
Sumit

-- 
------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot_______________________________________________
QuantLib-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/quantlib-users



--
Quant Strategist
(CFA, FRM)

mobile <a href="tel:+44%207961%20839363" value="+447961839363" target="_blank">+44 (0)7961839363
1 Royal Exchange • EC3V 3DG London • UK

------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
QuantLib-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/quantlib-users
Reply | Threaded
Open this post in threaded view
|

Re: Unable to bootstrap USD 3M libor curve

sumit_uk1
Hi Luigi;

  What I am doing currently is:

  OIS_Rate = USD_Libor_SwapRate - Basis

  But I am unsure how to modify this to take into account the difference in compounding (daily vs quarterly) using Quantlib.

Thanks
Sumit

On 1 June 2017 at 11:24, Luigi Ballabio <[hidden email]> wrote:
Hello,
    it probably depends on the way the basis is quoted.  Is it a spread to add to the 3M leg in order to equal the OIS leg, or the other way around?

Luigi


On Mon, May 29, 2017 at 6:49 PM Sumit Sengupta <[hidden email]> wrote:
Thanks a lot Luigi. That works fine.

Can you please comment if I am doing the OIS (FF discounting) correctly? I am taking the basis swaps between O/N FF and 3M USD Libor and taking the:-

OIS rate = 3M USD Libor - spread

Is this as simple as this or do I need to do something else?

Thanks,
Sumit

On 29 May 2017 at 14:25, Luigi Ballabio <[hidden email]> wrote:
Hello Sumit,
    as far as I can see, you're using self.helpers to store the list of helpers for both bootstraps. When you bootstrap the OIS curve, you fill self.helpers with the OIS swap helpers.  When you bootstrap the Libor curve, you don't clean it up and add the Libor helpers (line 48, `self.helpers += [...]`).  This way, the second curve tries to bootstrap over both the Libor and OIS swaps and can't find rates that fit all of them.  To avoid mixups, I'd use two different variables for the two sets of helpers.

Hope this helps,
    Luigi


On Sun, May 28, 2017 at 11:37 PM Sumit Sengupta <[hidden email]> wrote:
Hi;

   I recently purchased the pdf book quantlib python cookbook by Luigi Ballabio

   I have been trying to bootstrap a USD 3M libor curve using a OIS (FF) discounting curve, but it keeps failing.

 Please see code attached.

  Can someone please help me?

Thanks
Sumit

-- 
------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot_______________________________________________
QuantLib-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/quantlib-users



--
Quant Strategist
(CFA, FRM)

mobile <a href="tel:+44%207961%20839363" value="+447961839363" target="_blank">+44 (0)7961839363
1 Royal Exchange • EC3V 3DG London • UK



--
Quant Strategist
(CFA, FRM)

mobile +44 (0)7961839363
1 Royal Exchange • EC3V 3DG London • UK

------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
QuantLib-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/quantlib-users
Reply | Threaded
Open this post in threaded view
|

Re: Unable to bootstrap USD 3M libor curve

Luigi Ballabio
The OIS rate is a daily rate, and the 3M LIBOR rate is quarterly, but is the basis a daily or quarterly rate?


On Thu, Jun 1, 2017 at 1:33 PM Sumit Sengupta <[hidden email]> wrote:
Hi Luigi;

  What I am doing currently is:

  OIS_Rate = USD_Libor_SwapRate - Basis

  But I am unsure how to modify this to take into account the difference in compounding (daily vs quarterly) using Quantlib.

Thanks
Sumit

On 1 June 2017 at 11:24, Luigi Ballabio <[hidden email]> wrote:
Hello,
    it probably depends on the way the basis is quoted.  Is it a spread to add to the 3M leg in order to equal the OIS leg, or the other way around?

Luigi


On Mon, May 29, 2017 at 6:49 PM Sumit Sengupta <[hidden email]> wrote:
Thanks a lot Luigi. That works fine.

Can you please comment if I am doing the OIS (FF discounting) correctly? I am taking the basis swaps between O/N FF and 3M USD Libor and taking the:-

OIS rate = 3M USD Libor - spread

Is this as simple as this or do I need to do something else?

Thanks,
Sumit

On 29 May 2017 at 14:25, Luigi Ballabio <[hidden email]> wrote:
Hello Sumit,
    as far as I can see, you're using self.helpers to store the list of helpers for both bootstraps. When you bootstrap the OIS curve, you fill self.helpers with the OIS swap helpers.  When you bootstrap the Libor curve, you don't clean it up and add the Libor helpers (line 48, `self.helpers += [...]`).  This way, the second curve tries to bootstrap over both the Libor and OIS swaps and can't find rates that fit all of them.  To avoid mixups, I'd use two different variables for the two sets of helpers.

Hope this helps,
    Luigi


On Sun, May 28, 2017 at 11:37 PM Sumit Sengupta <[hidden email]> wrote:
Hi;

   I recently purchased the pdf book quantlib python cookbook by Luigi Ballabio

   I have been trying to bootstrap a USD 3M libor curve using a OIS (FF) discounting curve, but it keeps failing.

 Please see code attached.

  Can someone please help me?

Thanks
Sumit

-- 
------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot_______________________________________________
QuantLib-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/quantlib-users



--
Quant Strategist
(CFA, FRM)

mobile <a href="tel:+44%207961%20839363" value="+447961839363" target="_blank">+44 (0)7961839363
1 Royal Exchange • EC3V 3DG London • UK



--
Quant Strategist
(CFA, FRM)

mobile <a href="tel:+44%207961%20839363" value="+447961839363" target="_blank">+44 (0)7961839363
1 Royal Exchange • EC3V 3DG London • UK

------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
QuantLib-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/quantlib-users
Reply | Threaded
Open this post in threaded view
|

Re: Unable to bootstrap USD 3M libor curve

sumit_uk1
hi Luigi;

  it's a quarterly compounding rate (as per ICAP). So I guess we need to convert that to daily compounding?

Thanks,
Sumit

On 1 June 2017 at 13:50, Luigi Ballabio <[hidden email]> wrote:
The OIS rate is a daily rate, and the 3M LIBOR rate is quarterly, but is the basis a daily or quarterly rate?


On Thu, Jun 1, 2017 at 1:33 PM Sumit Sengupta <[hidden email]> wrote:
Hi Luigi;

  What I am doing currently is:

  OIS_Rate = USD_Libor_SwapRate - Basis

  But I am unsure how to modify this to take into account the difference in compounding (daily vs quarterly) using Quantlib.

Thanks
Sumit

On 1 June 2017 at 11:24, Luigi Ballabio <[hidden email]> wrote:
Hello,
    it probably depends on the way the basis is quoted.  Is it a spread to add to the 3M leg in order to equal the OIS leg, or the other way around?

Luigi


On Mon, May 29, 2017 at 6:49 PM Sumit Sengupta <[hidden email]> wrote:
Thanks a lot Luigi. That works fine.

Can you please comment if I am doing the OIS (FF discounting) correctly? I am taking the basis swaps between O/N FF and 3M USD Libor and taking the:-

OIS rate = 3M USD Libor - spread

Is this as simple as this or do I need to do something else?

Thanks,
Sumit

On 29 May 2017 at 14:25, Luigi Ballabio <[hidden email]> wrote:
Hello Sumit,
    as far as I can see, you're using self.helpers to store the list of helpers for both bootstraps. When you bootstrap the OIS curve, you fill self.helpers with the OIS swap helpers.  When you bootstrap the Libor curve, you don't clean it up and add the Libor helpers (line 48, `self.helpers += [...]`).  This way, the second curve tries to bootstrap over both the Libor and OIS swaps and can't find rates that fit all of them.  To avoid mixups, I'd use two different variables for the two sets of helpers.

Hope this helps,
    Luigi


On Sun, May 28, 2017 at 11:37 PM Sumit Sengupta <[hidden email]> wrote:
Hi;

   I recently purchased the pdf book quantlib python cookbook by Luigi Ballabio

   I have been trying to bootstrap a USD 3M libor curve using a OIS (FF) discounting curve, but it keeps failing.

 Please see code attached.

  Can someone please help me?

Thanks
Sumit

-- 
------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot_______________________________________________
QuantLib-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/quantlib-users



--
Quant Strategist
(CFA, FRM)

mobile <a href="tel:+44%207961%20839363" value="+447961839363" target="_blank">+44 (0)7961839363
1 Royal Exchange • EC3V 3DG London • UK



--
Quant Strategist
(CFA, FRM)

mobile <a href="tel:+44%207961%20839363" value="+447961839363" target="_blank">+44 (0)7961839363
1 Royal Exchange • EC3V 3DG London • UK



--
Quant Strategist
(CFA, FRM)

mobile +44 (0)7961839363
1 Royal Exchange • EC3V 3DG London • UK

------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
QuantLib-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/quantlib-users
Reply | Threaded
Open this post in threaded view
|

Re: Unable to bootstrap USD 3M libor curve

Luigi Ballabio
I don't think so.  The idea should be something like: the OIS rate R is the fair fixed rate paid by the fixed leg against which the overnight rate is paid.  The swap rate S is the fair fixed rate to be paid against the 3M LIBOR.  I'm not familiar with the conventions with which the basis swap is quoted (hence my original question): the basis B could be the spread that should be subtracted to the LIBOR or the spread that should be added to the OIS coupon so that the LIBOR leg equals the overnight-rate leg.  Assuming the first, we should have something like:

    OIS leg := R 
    OIS leg := LIBOR leg - B
    LIBOR leg := S

so you can find the OIS rate R from S and B --- assuming the fixed leg in the OIS and the one in the ordinary swap have the same conventions.  If one is quarterly and one is semiannual, for instance, the above needs to be adjusted accordingly.

That's just off the top of my head, though.  If anyone is more familiar with the US conventions, by all means step in.

Luigi



On Thu, Jun 1, 2017 at 4:34 PM Sumit Sengupta <[hidden email]> wrote:
hi Luigi;

  it's a quarterly compounding rate (as per ICAP). So I guess we need to convert that to daily compounding?

Thanks,
Sumit

On 1 June 2017 at 13:50, Luigi Ballabio <[hidden email]> wrote:
The OIS rate is a daily rate, and the 3M LIBOR rate is quarterly, but is the basis a daily or quarterly rate?


On Thu, Jun 1, 2017 at 1:33 PM Sumit Sengupta <[hidden email]> wrote:
Hi Luigi;

  What I am doing currently is:

  OIS_Rate = USD_Libor_SwapRate - Basis

  But I am unsure how to modify this to take into account the difference in compounding (daily vs quarterly) using Quantlib.

Thanks
Sumit

On 1 June 2017 at 11:24, Luigi Ballabio <[hidden email]> wrote:
Hello,
    it probably depends on the way the basis is quoted.  Is it a spread to add to the 3M leg in order to equal the OIS leg, or the other way around?

Luigi


On Mon, May 29, 2017 at 6:49 PM Sumit Sengupta <[hidden email]> wrote:
Thanks a lot Luigi. That works fine.

Can you please comment if I am doing the OIS (FF discounting) correctly? I am taking the basis swaps between O/N FF and 3M USD Libor and taking the:-

OIS rate = 3M USD Libor - spread

Is this as simple as this or do I need to do something else?

Thanks,
Sumit

On 29 May 2017 at 14:25, Luigi Ballabio <[hidden email]> wrote:
Hello Sumit,
    as far as I can see, you're using self.helpers to store the list of helpers for both bootstraps. When you bootstrap the OIS curve, you fill self.helpers with the OIS swap helpers.  When you bootstrap the Libor curve, you don't clean it up and add the Libor helpers (line 48, `self.helpers += [...]`).  This way, the second curve tries to bootstrap over both the Libor and OIS swaps and can't find rates that fit all of them.  To avoid mixups, I'd use two different variables for the two sets of helpers.

Hope this helps,
    Luigi


On Sun, May 28, 2017 at 11:37 PM Sumit Sengupta <[hidden email]> wrote:
Hi;

   I recently purchased the pdf book quantlib python cookbook by Luigi Ballabio

   I have been trying to bootstrap a USD 3M libor curve using a OIS (FF) discounting curve, but it keeps failing.

 Please see code attached.

  Can someone please help me?

Thanks
Sumit

-- 
------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot_______________________________________________
QuantLib-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/quantlib-users



--
Quant Strategist
(CFA, FRM)

mobile <a href="tel:+44%207961%20839363" value="+447961839363" target="_blank">+44 (0)7961839363
1 Royal Exchange • EC3V 3DG London • UK



--
Quant Strategist
(CFA, FRM)

mobile <a href="tel:+44%207961%20839363" value="+447961839363" target="_blank">+44 (0)7961839363
1 Royal Exchange • EC3V 3DG London • UK



--
Quant Strategist
(CFA, FRM)

mobile <a href="tel:+44%207961%20839363" value="+447961839363" target="_blank">+44 (0)7961839363
1 Royal Exchange • EC3V 3DG London • UK

------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
QuantLib-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/quantlib-users