Discussion:
[Quantlib-users] Unable to bootstrap USD 3M libor curve
Sumit Sengupta
2017-05-28 20:30:24 UTC
Permalink
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

--
Luigi Ballabio
2017-05-29 13:25:50 UTC
Permalink
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
Post by Sumit Sengupta
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
https://lists.sourceforge.net/lists/listinfo/quantlib-users
Sumit Sengupta
2017-05-29 16:49:04 UTC
Permalink
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
Post by 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
Post by Sumit Sengupta
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
https://lists.sourceforge.net/lists/listinfo/quantlib-users
--
Quant Strategist
(CFA, FRM)

mobile +44 (0)7961839363
***@mosaicsmartdata.com
1 Royal Exchange • EC3V 3DG London • UK
www.mosaicsmartdata.com
Luigi Ballabio
2017-06-01 10:24:12 UTC
Permalink
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
Post by Sumit Sengupta
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
Post by 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 <
Post by Sumit Sengupta
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
https://lists.sourceforge.net/lists/listinfo/quantlib-users
--
Quant Strategist
(CFA, FRM)
mobile +44 (0)7961839363 <+44%207961%20839363>
1 Royal Exchange • EC3V 3DG London • UK
www.mosaicsmartdata.com
Sumit Sengupta
2017-06-01 11:33:47 UTC
Permalink
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
Post by 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
Post by Sumit Sengupta
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
Post by 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 <
Post by Sumit Sengupta
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
https://lists.sourceforge.net/lists/listinfo/quantlib-users
--
Quant Strategist
(CFA, FRM)
mobile +44 (0)7961839363 <+44%207961%20839363>
1 Royal Exchange • EC3V 3DG London • UK
www.mosaicsmartdata.com
--
Quant Strategist
(CFA, FRM)

mobile +44 (0)7961839363
***@mosaicsmartdata.com
1 Royal Exchange • EC3V 3DG London • UK
www.mosaicsmartdata.com
Luigi Ballabio
2017-06-01 12:50:17 UTC
Permalink
The OIS rate is a daily rate, and the 3M LIBOR rate is quarterly, but is
the basis a daily or quarterly rate?
Post by Sumit Sengupta
Hi Luigi;
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
Post by 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
Post by Sumit Sengupta
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
Post by 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 <
Post by Sumit Sengupta
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
https://lists.sourceforge.net/lists/listinfo/quantlib-users
--
Quant Strategist
(CFA, FRM)
mobile +44 (0)7961839363 <+44%207961%20839363>
1 Royal Exchange • EC3V 3DG London • UK
www.mosaicsmartdata.com
--
Quant Strategist
(CFA, FRM)
mobile +44 (0)7961839363 <+44%207961%20839363>
1 Royal Exchange • EC3V 3DG London • UK
www.mosaicsmartdata.com
Sumit Sengupta
2017-06-01 14:34:15 UTC
Permalink
hi Luigi;

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

Thanks,
Sumit
Post by 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?
Post by Sumit Sengupta
Hi Luigi;
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
Post by 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 <
Post by Sumit Sengupta
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
Post by 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 <
Post by Sumit Sengupta
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
https://lists.sourceforge.net/lists/listinfo/quantlib-users
--
Quant Strategist
(CFA, FRM)
mobile +44 (0)7961839363 <+44%207961%20839363>
1 Royal Exchange • EC3V 3DG London • UK
www.mosaicsmartdata.com
--
Quant Strategist
(CFA, FRM)
mobile +44 (0)7961839363 <+44%207961%20839363>
1 Royal Exchange • EC3V 3DG London • UK
www.mosaicsmartdata.com
--
Quant Strategist
(CFA, FRM)

mobile +44 (0)7961839363
***@mosaicsmartdata.com
1 Royal Exchange • EC3V 3DG London • UK
www.mosaicsmartdata.com
Luigi Ballabio
2017-06-01 15:43:40 UTC
Permalink
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
Post by Sumit Sengupta
hi Luigi;
it's a quarterly compounding rate (as per ICAP). So I guess we need to
convert that to daily compounding?
Thanks,
Sumit
Post by 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?
Post by Sumit Sengupta
Hi Luigi;
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
Post by 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 <
Post by Sumit Sengupta
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
Post by 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 <
Post by Sumit Sengupta
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
https://lists.sourceforge.net/lists/listinfo/quantlib-users
--
Quant Strategist
(CFA, FRM)
mobile +44 (0)7961839363 <+44%207961%20839363>
1 Royal Exchange • EC3V 3DG London • UK
www.mosaicsmartdata.com
--
Quant Strategist
(CFA, FRM)
mobile +44 (0)7961839363 <+44%207961%20839363>
1 Royal Exchange • EC3V 3DG London • UK
www.mosaicsmartdata.com
--
Quant Strategist
(CFA, FRM)
mobile +44 (0)7961839363 <+44%207961%20839363>
1 Royal Exchange • EC3V 3DG London • UK
www.mosaicsmartdata.com
Loading...