InterestRateSwapGroup

InterestRateSwapGroup#

class sigtech.framework.instruments.ir_otc.InterestRateSwapGroup

Baseclasses: ContractGroup

Subclasses: OISSwapGroup

A class implementing an interest rate swap group.

description: Optional[str]
due_time: time
fixing_source: str
holidays: str
item_product_type: Optional[str]
timezone: str
valuation_time: time
data_df(tenor: str, trade_date: date = None, start_date: date = None, end_date: date = None, fwd_tenor: str = None, overrides: Optional[dict] = None, rate_only: bool = False, data_point: DataPoint = None, multi_index: bool = False, drop_nan_cols: bool = False, pretty_print=True) DataFrame

Return a DataFrame containing rolling swap rate, dv01 and p&l from holding the swap for 1 day for a given tenor and (optionally) forward starting tenor. The swap rate is returned in percent, i.e. 1.25 means 1.25%.

Example:

g = sig.obj.get('EUR INTEREST RATE SWAP GROUP')
g.data_df(
    tenor='5Y',
    start_date=dtm.date(2016, 12, 20),
    end_date=dtm.date(2017, 1, 3),
    fwd_tenor='3Y'
)

This will return for every day from 20/21/2016, fair 3Y forward starting 5Y swap rate, PV01 of such swap and P&L from entering a fair swap rate the previous business day and closing on the day at zero cost.

Parameters:
  • tenor – Swap tenor, e,g '5Y'.

  • trade_date – Trade date for the return history (optional).

  • start_date – Start date for the return history (optional, if omitted, the first date for which the curves are available will be used).

  • end_date – End date for the return history (optional, if omitted, the last date for which the forecasting curves are available will be used).

  • fwd_tenor – Forward start tenor, e.g. '5Y'. Optional, spot starting swap if omitted

  • overrides – Default swap parameters overrides, same as in the swap definition (Optional).

  • rate_only – Boolean flag. If set to True, only fair rate will be returned (faster).

  • data_point – Optional data point used to load the object history.

  • multi_index – If set to True, rows are uniquely indexed by a multi index (if applicable). Default is False.

  • drop_nan_cols – If set to True, all-NaN columns are dropped. Default is False.

  • pretty_print – Pretty print flag (unsupported as the DataFrame is generated by fair_rate_df()).

Returns:

pandas DataFrame.

classmethod fair_rate_df(currency: str, tenor: str, start_date: date = None, end_date: date = None, fwd_tenor: str = None, overrides: Optional[dict] = None, rate_only: bool = False, data_point: DataPoint = None)

Compute rolling swap rate, dv01 and p&l from holding the swap for 1 day for a given tenor and (optionally) forward starting tenor. The swap rate is returned in percent, i.e. 1.25 means 1.25%.

Parameters:
  • currency – Currency of the swap, e.g. 'USD'.

  • tenor – Swap tenor, e,g '5Y'.

  • start_date – Start date for the return history (optional, if omitted, the first date for which the curves are available will be used).

  • end_date – End date for the return history (optional, if omitted, the last date for which the forecasting curves are available will be used).

  • fwd_tenor – Forward start tenor, e.g. '5Y' (optional, spot starting swap if omitted).

  • overrides – Default swap parameters overrides (optional same as in the swap definition).

  • rate_only – Defaults to False (optional, if set to True, only fair rate will be returned, and the function will run faster).

  • data_point – Data point of the curves used (optional).

Returns:

DataFrame of daily values.

classmethod fair_swap_rate(currency: str, tenor: str, start_date: date = None, end_date: date = None, fwd_tenor: str = None, overrides: Optional[dict] = None, rate_only: bool = False, data_point: DataPoint = None) deprecated

Deprecated method to compute rolling swap rate, dv01 and p&l from holding the swap for 1 day for a given tenor and (optionally) forward starting tenor. The swap rate is returned in percent, i.e. 1.25 means 1.25%. Please use data_df (non-static method) or fair_rate_df (static method) instead.

classmethod from_contract(fixing_source, env: ConfiguredEnvironment)

Create an interest rate swap group from fixing source.

Parameters:
  • fixing_source – Fixing source.

  • env – Configured environment.

Returns:

Instance of InterestRateSwapGroup.

classmethod name_from_contract(fixing_source)

Create an interest rate swap group name from fixing source.

Parameters:

fixing_source – Fixing source.

Returns:

Default name of instance of InterestRateSwapGroup.