IndexCashflow#

class rateslib.periods.IndexCashflow(*args, index_base, index_fixings=NoInput.blank, index_method=NoInput.blank, index_lag=NoInput.blank, index_only=False, end=NoInput.blank, **kwargs)#

Bases: IndexMixin, Cashflow

Create a cashflow defined with a real rate adjusted by an index.

When used with an inflation index this defines a real redemption with a cashflow adjusted upwards by the inflation index.

Parameters:
  • args (dict) – Required positional args to Cashflow.

  • index_base (float or None, optional) – The base index to determine the cashflow.

  • index_fixings (float, or Series, optional) – If a float scalar, will be applied as the index fixing for the whole period. If a datetime indexed Series will use the fixings that are available in that object, and derive the rest from the curve.

  • index_method (str) – Whether the indexing uses a daily measure for settlement or the most recently monthly data taken from the first day of month. Defined by default.

  • index_lag (int) – The number of months by which the index value is lagged. Used to ensure consistency between curves and forecast values. Defined by default.

  • index_only (bool) – If True deduct the real notional from the cashflow and produce only the indexed component.

  • end (datetime, optional) – The registered end of a period when the index value is measured. If None is set equal to the payment date.

  • kwargs (dict) – Required keyword arguments to Cashflow.

Notes

The real_cashflow is defined as follows;

\[C_{real} = -N\]

The cashflow is defined as follows;

\[C = C_{real}I(m) = -NI(m)\]

The npv() is defined as;

\[P = Cv(m) = -Nv(m)I(m)\]

The analytic_delta() is defined as;

\[A = 0\]

Example

In [1]: icf = IndexCashflow(
   ...:     notional=1e6,
   ...:     end=dt(2022, 8, 1),
   ...:     payment=dt(2022, 8, 3),
   ...:     currency="usd",
   ...:     stub_type="Loan Payment",
   ...:     index_base=100.25
   ...: )
   ...: 

In [2]: icf.cashflows(
   ...:     curve=IndexCurve({dt(2022, 1, 1): 1.0, dt(2022, 12, 31): 0.99}, index_base=100.0),
   ...:     disc_curve=Curve({dt(2022, 1, 1): 1.0, dt(2022, 12, 31): 0.98}),
   ...: )
   ...: 
Out[2]: 
{'Type': 'IndexCashflow',
 'Period': 'Loan Payment',
 'Ccy': 'USD',
 'Acc Start': None,
 'Acc End': datetime.datetime(2022, 8, 1, 0, 0),
 'Payment': datetime.datetime(2022, 8, 3, 0, 0),
 'Convention': None,
 'DCF': None,
 'Notional': 1000000.0,
 'DF': 0.988192842226477,
 'Rate': None,
 'Spread': None,
 'Cashflow': -1003374.5694593576,
 'NPV': -991527.5676118103,
 'FX Rate': 1.0,
 'NPV Ccy': -991527.5676118103,
 'Collateral': None,
 'Real Cashflow': -1000000.0,
 'Index Base': 100.25,
 'Index Val': 100.5883005883006,
 'Index Ratio': 1.0033745694593577}

Attributes Summary

real_cashflow

Methods Summary

analytic_delta(*args, **kwargs)

Return the analytic delta of the IndexCashflow.

cashflows([curve, disc_curve, fx, base])

Return the cashflows of the IndexCashflow.

npv(*args, **kwargs)

Return the NPV of the IndexCashflow.

Attributes Documentation

real_cashflow#

Methods Documentation

analytic_delta(*args, **kwargs)#

Return the analytic delta of the IndexCashflow. See BasePeriod.analytic_delta()

cashflows(curve=NoInput.blank, disc_curve=NoInput.blank, fx=NoInput.blank, base=NoInput.blank)#

Return the cashflows of the IndexCashflow. See BasePeriod.cashflows()

npv(*args, **kwargs)#

Return the NPV of the IndexCashflow. See BasePeriod.npv()