# Curve construction with Python's RATESLIB package

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.

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")


• There is no "nyc" calendar, even if you.see one on a term aheet :) quant.stackexchange.com/questions/60330/… Commented Aug 15, 2023 at 20:24
• 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/…
– Attack68
Commented Aug 15, 2023 at 20:30
• 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/… Commented Aug 15, 2023 at 20:40
• 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.
– Attack68
Commented Aug 15, 2023 at 20:44
• 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 Commented Aug 15, 2023 at 20:55