Skip to content

Commit fe33375

Browse files
authored
ENH: add NDF component (#155) (#1078)
1 parent 2972f15 commit fe33375

File tree

5 files changed

+445
-21
lines changed

5 files changed

+445
-21
lines changed

python/rateslib/instruments/components/__init__.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
from rateslib.instruments.components.fx_vol_value import FXVolValue
55
from rateslib.instruments.components.iirs import IIRS
66
from rateslib.instruments.components.irs import IRS
7+
from rateslib.instruments.components.ndf import NDF
78
from rateslib.instruments.components.portfolio import Portfolio
89
from rateslib.instruments.components.sbs import SBS
910
from rateslib.instruments.components.spread import Spread
@@ -18,6 +19,7 @@
1819
"IIRS",
1920
"CDS",
2021
"SBS",
22+
"NDF",
2123
"Portfolio",
2224
"Fly",
2325
"Spread",

python/rateslib/instruments/components/fx_exchange.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ class FXExchange(_BaseInstrument):
4141
settlement : datetime
4242
The date of the currency exchange.
4343
pair: str
44-
The curreny pair of the exchange, e.g. "eurusd", using 3-digit iso codes.
44+
The currency pair of the exchange, e.g. "eurusd", using 3-digit iso codes.
4545
fx_rate : float, optional
4646
The FX rate used to derive the notional exchange on *Leg2*.
4747
notional : float
@@ -114,11 +114,11 @@ def _parse_curves(self, curves: CurveOption_) -> _Curves:
114114
)
115115
else:
116116
raise ValueError(
117-
f"{type(self).__name__} requires 3 curve types. Got {len(curves)}."
117+
f"{type(self).__name__} requires 2 curve types. Got {len(curves)}."
118118
)
119119

120120
else: # `curves` is just a single input which is copied across all curves
121-
raise ValueError(f"{type(self).__name__} requires 3 curve types. Got 1.")
121+
raise ValueError(f"{type(self).__name__} requires 2 curve types. Got 1.")
122122

123123
def __init__(
124124
self,

0 commit comments

Comments
 (0)