NonDeliverableCashflow#
- class rateslib.periods.NonDeliverableCashflow(notional, currency, payment, settlement_currency, fixing_date, fx_fixing=NoInput.blank, reversed=False)#
Bases:
objectCreate a cashflow amount associated with a non-deliverable FX forward.
- Parameters:
notional (float, Dual, Dual2) – The notional amount of the cashflow expressed in units of the
currency,currency (str) – The non-deliverable reference currency (3-digit code), e.g. “brl”.
payment (datetime) – The settlement date of the exchange.
settlement_currency (str) – The currency of the deliverable currency (3-digit code), e.g. “usd” or “eur”.
fixing_date (datetime) – The date on which the FX fixings will be recorded.
fx_fixing (float, Dual, Dual2, optional) – The FX fixing to determine the settlement amount. The reference
currencyshould be the left hand side, e.g. BRLUSD, unlessreversedin which case should be right hand side, e.g. USDBRL.reversed (bool, optional) – If True reverses the FX rate, as shown above.
Notes
The
cashflowis defined as follows;\[C = - N f\]where \(f\) is the
fx_fixing(or derivable FX fixing ifreversed) or market forecast rate at settlement. This amount is expressed in units ofsettlement_currency.The
npv()is defined insettlement_currencyterms as;\[P = Cv(m) = - N f v(m)\]The
analytic_delta()is defined as;\[A = 0\]Example
In [1]: ndc = NonDeliverableCashflow( ...: notional=10e6, # <- this is BRL amount ...: currency="brl", ...: payment=dt(2025, 6, 1), ...: settlement_currency="usd", ...: fixing_date=dt(2025, 5, 29), # <- for the BRLUSD FX rate ...: ) ...: In [2]: ndc.cashflows() Out[2]: {'Type': 'NonDeliverableCashflow', 'Period': 'BRLUSD', 'Ccy': 'USD', 'Payment': datetime.datetime(2025, 6, 1, 0, 0), 'Notional': 10000000.0, 'DF': None, 'Rate': None, 'Cashflow': None, 'NPV': None, 'FX Rate': 1.0, 'NPV Ccy': None, 'Collateral': None} In [3]: ndc = NonDeliverableCashflow( ...: notional=2e6, # <- this is USD amount ...: currency="brl", ...: payment=dt(2025, 6, 1), ...: settlement_currency="usd", ...: fixing_date=dt(2025, 5, 29), # <- this is USDBRL FX rate ...: reversed=True, ...: ) ...: In [4]: ndc.cashflows() Out[4]: {'Type': 'NonDeliverableCashflow', 'Period': 'USDBRL', 'Ccy': 'USD', 'Payment': datetime.datetime(2025, 6, 1, 0, 0), 'Notional': 2000000.0, 'DF': None, 'Rate': None, 'Cashflow': None, 'NPV': None, 'FX Rate': 1.0, 'NPV Ccy': None, 'Collateral': None}
Methods Summary
analytic_delta([curve, disc_curve, fx, base])Return the analytic delta of the NonDeliverableCashflow.
cashflow(fx)Determine the cashflow amount, expressed in the
settlement_currency.cashflows([curve, disc_curve, fx, base])Return the cashflows of the NonDeliverableCashflow.
npv([curve, disc_curve, fx, base, local])Return the NPV of the NonDeliverableCashflow.
rate(fx)Methods Documentation
- analytic_delta(curve=NoInput.blank, disc_curve=NoInput.blank, fx=NoInput.blank, base=NoInput.blank)#
Return the analytic delta of the NonDeliverableCashflow. See
BasePeriod.analytic_delta()
- cashflow(fx)#
Determine the cashflow amount, expressed in the
settlement_currency.- Parameters:
fx (FXForwards, optional) – Required to forecast the FX rate at settlement, if an
fx_fixingis not known.- Return type:
- cashflows(curve=NoInput.blank, disc_curve=NoInput.blank, fx=NoInput.blank, base=NoInput.blank)#
Return the cashflows of the NonDeliverableCashflow. See
BasePeriod.cashflows()
- npv(curve=NoInput.blank, disc_curve=NoInput.blank, fx=NoInput.blank, base=NoInput.blank, local=False)#
Return the NPV of the NonDeliverableCashflow. See
BasePeriod.npv()
- rate(fx)#