|
From: Luigi B. <lui...@gm...> - 2024-05-20 13:25:11
|
Agreed. May you open an issue on GitHub? It's the best way to ensure this
stays on people's radars.
Thanks,
Luigi
On Sat, May 18, 2024 at 10:45 PM Quant <qua...@gm...> wrote:
> Hi Marcin,
>
> It worked, thanks. I did make two proxy Ibor indices which I then used in
> my bootstrapping process as shown below:
>
> sofr_3m = ql.IborIndex('SOFR', ql.Period('3m'), 0, ql.USDCurrency(),
> ql.UnitedStates(ql.UnitedStates.FederalReserve), ql.Following, False, ql.Actual360(),
> sofr_ts)
>
> sonia_3m = ql.IborIndex('SONIA', ql.Period('3m'), 0, ql.GBPCurrency(), ql.UnitedKingdom(),
> ql.Following, False, ql.Actual365Fixed(), sonia_ts)
>
> ccbs_helpers = [
> ql.ConstNotionalCrossCurrencyBasisSwapRateHelper(ql.QuoteHandle(ql.SimpleQuote(basis / 10000)), ql.Period(*tenor),
> 2, calendar, ql.Following, False,
> sofr_3m, sonia_3m, sofr_ts, True,
> False)
> for basis, tenor in [(-5.375, (3, ql.Months)), (-6.875, (6, ql.Months)),
> (-13.375, (9, ql.Months)), (-12.75, (1, ql.Years)),
> (-14.875, (2, ql.Years)), (-17.25, (3, ql.Years)),
> (-19.25, (4, ql.Years)), (-20.25, (5, ql.Years)),
> (-20.625, (6, ql.Years)), (-20.75, (7, ql.Years)),
> (-20.75, (8, ql.Years)), (-20.875, (9, ql.Years)),
> (-21, (10, ql.Years)), (-21.75, (12, ql.Years)),
> (-24.625, (15, ql.Years)), (-30, (20, ql.Years)),
> (-36.25, (30, ql.Years)), (-38.75, (40, ql.Years)),
> (-37.75, (50, ql.Years))]]
>
> basis_adj_sonia_curve = ql.YieldTermStructureHandle(
> ql.PiecewiseLogCubicDiscount(0, calendar, ccbs_helpers, day_counter))
>
> basis_adj_sonia_curve.enableExtrapolation()
>
>
> Thanks all for the help and contribution. I do agree that we need to
> consider improving the helpers
> ql.ConstNotionalCrossCurrencyBasisSwapRateHelper and
> ql.MtMCrossCurrencyBasisSwapRateHelper
>
> Cheers,
> Nk
>
> On Sat, May 18, 2024 at 9:39 PM Marcin Rybacki <mry...@gm...>
> wrote:
>
>> Hi everyone,
>>
>> As already pointed out by Peter and Ioannis, the helper utilizes the fact
>> that, for a par instrument, the ratio of foreign vs domestic notionals is
>> equal to the market spot rate. Hence, they cancel each other out and the FX
>> spot rate is not really needed.
>>
>> Nk, to make your example work for a SOFR-SONIA swap you will have to
>> create two proxy Ibor indices (instead of using overnight ones) with 3m
>> period each for SOFR and SONIA, respectively. Given that both SOFR and
>> SONIA legs use compounded rate averaging, they collapse to Ibor-type
>> coupons anyway - this property will apply to coupons that have not started
>> accruing yet, which for a par instrument applies to all. This should result
>> in a GBP curve under USD collateralization you’re looking for.
>>
>> We might consider improving the helper by adding a constructor that takes
>> an overnight index and payment frequency as parameters.
>>
>> Hope this helps.
>>
>> Regards,
>> Marcin
>>
>> On Sat, 18 May 2024 at 21:08, Ioannis Rigopoulos <qua...@de...>
>> wrote:
>>
>>> The baseCurrencyIndex and quoteCurrencyIndex imply the frequency per
>>> each floating leg.
>>> On 5/18/2024 8:53 PM, Quant wrote:
>>>
>>> Thanks loannis, what about the payment frequency is it not required in
>>> ql.ConstNotionalCrossCurrencyBasisSwapRateHelper() for bootstrapping?
>>>
>>> Thanks,
>>> Nk
>>>
>>> On Sat, 18 May 2024 at 20:25, Ioannis Rigopoulos <qua...@de...>
>>> wrote:
>>>
>>>> Hi Peter and NK
>>>>
>>>> For some reason, the email I sent quite some time ago did not go
>>>> through. Perhaps because of the link insertion. I repeat it below:
>>>>
>>>> The spot rate is not needed. Explanation at
>>>> https://www.deriscope.com/products/Key_Yield_Curve_Fxb__Spot.html that
>>>> describes the spot rate input in the construction of a curve out of xccy
>>>> basis spreads.
>>>> In effect, any assumed spot rate cancels out due to for any given two
>>>> currencies SRC and TGT, the corresponding legs in a currency swap have
>>>> differing notionals Nˢʳᶜ and Nᵗᵍᵗ that satisfy:
>>>>
>>>> Nˢʳᶜ/Nᵗᵍᵗ = s := spot fx rate TGT/SRC
>>>>
>>>> Ioannis
>>>> On 5/18/2024 8:12 PM, Quant wrote:
>>>>
>>>> Hi Peter,
>>>>
>>>> So do you agree that we need to have the following additional arguments
>>>> in
>>>> ql.ConstNotionalCrossCurrencyBasisSwapRateHelper();
>>>>
>>>> 1. quote FX rate - so that 1 is used as the notional of one leg and the
>>>> quote FX rate is used as notional on the other leg
>>>>
>>>> 2. payment frequency - so that the number of payment frequency is known
>>>> for each leg during the bootstrapping process.
>>>>
>>>> Happy to get your opinion on this.
>>>>
>>>> Thanks & regards,
>>>> Nk
>>>>
>>>> On Sat, 18 May 2024 at 19:57, Peter Caspers <pca...@gm...>
>>>> wrote:
>>>>
>>>>> It does make sense, I was confused as well.
>>>>>
>>>>> I think both the domestic and foreign leg are set up with the same
>>>>> notional 1.0. I.e. the conversion of the foreign leg’s npv to domestic
>>>>> currency is done implicitly by using identical nationals. I.e. we exploit
>>>>> the fact that the fx spot rate is the same as the ratio of nationals of the
>>>>> two legs. Therefore the fx spot is not needed to set up the helper. Smart.
>>>>>
>>>>> On 18. May 2024, at 18:41, Quant <qua...@gm...> wrote:
>>>>>
>>>>> Hi Peter,
>>>>>
>>>>> No, the spot fx is not declared anywhere in the bootstrapping hence my
>>>>> first question was why we don’t have an argument for the quote FX rate
>>>>> which would be used as the implied notional. Not sure if it’s making sense.
>>>>>
>>>>> Thanks & regards,
>>>>> Nk
>>>>>
>>>>> On Sat, 18 May 2024 at 18:28, Peter Caspers <pca...@gm...>
>>>>> wrote:
>>>>>
>>>>>> I guess spot fx is somewhat implicit in the (initial) notionals of
>>>>>> the two legs?
>>>>>> Peter
>>>>>>
>>>>>> On Fri, 17 May 2024 at 03:34, Ben Watson <
>>>>>> ben...@ma...> wrote:
>>>>>> >
>>>>>> > cross currency basis is a spread over a floating index. We use this
>>>>>> to bootstrap curves. It is a direct quote, and no need for a spot FX rate.
>>>>>> >
>>>>>> > The contrast is when we imply a basis over a floating index from
>>>>>> forward fx pips. In this case we need spot fx.
>>>>>> >
>>>>>> > Ben
>>>>>> >
>>>>>> > On Fri, 17 May 2024, 6:16 am Quant, <qua...@gm...>
>>>>>> wrote:
>>>>>> >>
>>>>>> >> Hi Quantlib users,
>>>>>> >>
>>>>>> >> When using ql.ConstNotionalCrossCurrencySwapRateHelper() shown
>>>>>> below, are we not supposed to have an argument for the quote FX rate? If
>>>>>> not how do we adjust for the spot FX rate when bootstrapping the basis
>>>>>> adjusted discount curve? Not sure if my question makes sense
>>>>>> >>
>>>>>> >>
>>>>>> https://rkapl123.github.io/QLAnnotatedSource/d6/d3d/class_quant_lib_1_1_const_notional_cross_currency_basis_swap_rate_helper.html
>>>>>> >>
>>>>>> >> Thanks & regards,
>>>>>> >> Nk
>>>>>> >> _______________________________________________
>>>>>> >> QuantLib-users mailing list
>>>>>> >> Qua...@li...
>>>>>> >> https://lists.sourceforge.net/lists/listinfo/quantlib-users
>>>>>> >
>>>>>> > _______________________________________________
>>>>>> > QuantLib-users mailing list
>>>>>> > Qua...@li...
>>>>>> > https://lists.sourceforge.net/lists/listinfo/quantlib-users
>>>>>>
>>>>>
>>>>>
>>>>
>>>> _______________________________________________
>>>> QuantLib-users mailing lis...@li...://lists.sourceforge.net/lists/listinfo/quantlib-users
>>>>
>>>>
>>>>
>>>> <https://www.avast.com/sig-email?utm_medium=email&utm_source=link&utm_campaign=sig-email&utm_content=emailclient>
>>>> Virus-free.www.avast.com
>>>> <https://www.avast.com/sig-email?utm_medium=email&utm_source=link&utm_campaign=sig-email&utm_content=emailclient>
>>>> <#m_4982175542612521208_m_5754262361892313513_m_-1964979119827994335_m_4381154520716188394_DAB4FAD8-2DD7-40BB-A1B8-4E2AA1F9FDF2>
>>>>
>>> _______________________________________________
>>> QuantLib-users mailing list
>>> Qua...@li...
>>> https://lists.sourceforge.net/lists/listinfo/quantlib-users
>>>
>> _______________________________________________
> QuantLib-users mailing list
> Qua...@li...
> https://lists.sourceforge.net/lists/listinfo/quantlib-users
>
|