3
$\begingroup$

As per the user guide of Python's RATESLIB package (https://rateslib.readthedocs.io/en/latest/i_guide.html#guide-doc), below example is provided to construct a Curve

from rateslib.curves import Curve

usd_curve = Curve(
    nodes={
        dt(2022, 1, 1): 1.0,
        dt(2022, 7, 1): 0.98,
        dt(2023, 1, 1): 0.95
    },
    calendar="nyc",
)

My question what is the type of the curve? Is it basically a discount curve? I dont seem to find any such definition in their User guide.

$\endgroup$
1

1 Answer 1

2
$\begingroup$

That is a curve parametrised by discount factors. The initial node date must be 1.0.

Including the defaults that curve is actually the same as

usd_curve = Curve(
    nodes={
        dt(2022, 1, 1): 1.0,
        dt(2022, 7, 1): 0.98,
        dt(2023, 1, 1): 0.95
    },
    calendar="nyc",
    interpolation="log_linear",
    modifier="MF",
    convention="ACT360",
)
usd_curve.plot("1b")

enter image description here

$\endgroup$
6
  • 1
    $\begingroup$ There is no "nyc" calendar, even if you.see one on a term aheet :) quant.stackexchange.com/questions/60330/… $\endgroup$ Commented Aug 15, 2023 at 20:24
  • $\begingroup$ Well it has to be called something. This "nyc" calendar's hols are listed here, and it is back tested against the prior publication dates of all the SOFR fixings. rateslib.readthedocs.io/en/latest/api/… $\endgroup$
    – Attack68
    Commented Aug 15, 2023 at 20:30
  • $\begingroup$ The new york bond calendar differs a little from the new york stock exchange calendar. Using the wrong new york calendar sometimes causes small differences. quant.stackexchange.com/questions/57666/… $\endgroup$ Commented Aug 15, 2023 at 20:40
  • $\begingroup$ Maybe it would be best to call this specific calendar referenced here the "sofr" calendar. Take your point. Sounds like a job in itself managing all these cals. $\endgroup$
    – Attack68
    Commented Aug 15, 2023 at 20:44
  • 3
    $\begingroup$ SOFR uses SIFMA calandar, in which, e.g., Good Friday is usually a holiday, but in a few rare cases just an early close. Yes, managing calendar data is complicated and not much fun, but at least referencing a right one would help - then d/l the dates feom Bbg CDR or a vendor like financialcalendar.com $\endgroup$ Commented Aug 15, 2023 at 20:55

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.