OISSwapGroup#

class sigtech.framework.instruments.ois_swap.OISSwapGroup

A class implementing an ois swap group.

classmethod name_from_contract(fixing_source)

Create an ois swap group name from fixing source.

Parameters

fixing_source – Fixing source.

Returns

Default name of instance of InterestRateSwapGroup.

static get_group(currency: str)

Create on the fly OIS SWAP GROUP for given currency

Parameters

currency

Returns

static standard_fixings_object_name(currency, d: datetime.date = None, env=None)

Returns the name of the standard OIS fixings object for the given currency, e.g. 'SONIO/N INDEX' for 'GBP'. d parameter is optional, and needed for cases when the standard index changed for a currency, e.g. from 'FEDL01 INDEX' to 'SOFR INDEX' for 'USD'. env parameter is optional - in case object names are different in different environments.

property available_data_points: Optional[list[sigtech.framework.infra.data_adapter.common.DataPoint]]

Available data points for this object.

available_data_providers(entitled_only=True) Optional[List[str]]

Available data providers for this object. Bool to return entitled providers only

property cache_name: str

Cache name of this object.

property class_name

Class name of this object.

property class_short_name

Short name of the object class.

clear_cached_data()

Clear all the cached data of the object.

clone_object(params=None)

Return a clone of the object with amended parameters.

Parameters

params – Optional dictionary of parameters to override.

Returns

New object.

compute_dependencies(root_dependency: Optional[sigtech.framework.internal.infra.mu.graph.registry.factory.Dependency] = None)

Compute these dependencies - triggers MDS requests

static convert_dtypes(clz)

Class decorator to convert classes’ BaseType into variable annotations (PEP-526), and to generate __aliases__ based on BaseType.db_name when required.

data_df(tenor: str, trade_date: Optional[datetime.date] = None, start_date: Optional[datetime.date] = None, end_date: Optional[datetime.date] = None, fwd_tenor: Optional[str] = None, overrides: Optional[dict] = None, rate_only: bool = False, data_point: Optional[sigtech.framework.infra.data_adapter.common.DataPoint] = None, multi_index: bool = False, drop_nan_cols: bool = False, pretty_print=True) pandas.core.frame.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.

data_dict()

Return the object attributes in a dict.

property data_source: str

Field used when retrieving history.

property default_data_point: sigtech.framework.infra.data_adapter.common.DataPoint

Return the default data point.

dependencies(input_dependency: Optional[sigtech.framework.internal.infra.mu.graph.registry.factory.Dependency] = None, valuation_currency: Optional[str] = None, use_start: bool = True) list[sigtech.framework.internal.infra.mu.graph.registry.factory.Dependency]

Returns a list of Dependency

Parameters
  • input_dependency – A Dependency object representing the root of the dependency tree to be returned.

  • valuation_currency – If supplied, include the dependencies required to output the data in this currency.

  • use_start – If False, return only dependencies required to calculate an earliest start date - self.start_date will be None in this case.

Returns

List of Dependency objects representing the current level in the dependency tree.

property dependency_type

Should return GraphNodeType. Return None to autodetect based on result of dependencies()

property env: sigtech.framework.config.config.ConfiguredEnvironment

Return the configured environment.

env_date_change(old_env_dt: datetime.datetime, new_env_dt: datetime.datetime, live_data_update=None)

Routine called after the environment date is changed.

Parameters
  • old_env_dt – Old datetime (tz aware).

  • new_env_dt – New datetime (tz aware).

  • live_data_update – Live streaming data associated with the environment date change.

classmethod fair_rate_df(currency: str, tenor: str, start_date: Optional[datetime.date] = None, end_date: Optional[datetime.date] = None, fwd_tenor: Optional[str] = None, overrides: Optional[dict] = None, rate_only: bool = False, data_point: Optional[sigtech.framework.infra.data_adapter.common.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: datetime.date = None, end_date: datetime.date = None, fwd_tenor: str = None, overrides: Optional[dict] = None, rate_only: bool = False, data_point: sigtech.framework.infra.data_adapter.common.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.

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

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

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

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

  • fwd_tenor – (Optional) forward start tenor, e.g. '5Y'. Spot starting swap if omitted

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

  • rate_only – (Optional) boolean flag - if set to True, only fair rate will be returned, and the function will run faster

  • data_point – (Optional) data point of the curves used

Returns

DataFrame of daily values

finalize_for_comparison()

Method to call to ensure all data dict values are finalized prior to doing object comparisons.

classmethod from_contract(fixing_source, env: sigtech.framework.config.config.ConfiguredEnvironment)

Create an interest rate swap group from fixing source.

Parameters
  • fixing_source – Fixing source.

  • env – Configured environment.

Returns

Instance of InterestRateSwapGroup.

classmethod from_dictionary(dct: dict[str, Any], cache: bool = True, identifier: Optional[sigtech.framework.infra.data_adapter.identifier.Identifier] = None, env: Optional[sigtech.framework.config.config.ConfiguredEnvironment] = None, **kwargs)

Factory method to create object using data dictionary

classmethod get_names(sort_by_group: Optional[bool] = False, include_db: Optional[bool] = True, include_local: Optional[bool] = True, include_children: Optional[bool] = False, ignore_unmapped: Optional[bool] = True) list[str]

Return an ordered list of object names associated with the class.

Parameters
  • sort_by_group – If set, the list is first ordered by sector/group, if applies, e.g. commodity or index futures (default is False).

  • include_db – If set, include objects available from the database (default is True).

  • include_local – If set, include objects available in the local environment (default is True).

  • include_children – If set, include objects available from child classes (default is False).

  • ignore_unmapped – If set, ignore errors due to unmapped database objects (default is True).

Returns

List of object names.

property identifier: sigtech.framework.infra.data_adapter.identifier.Identifier

Return the object identifier.

info() dict

Return a dictionary with useful object information.

property input_parameters

Values of initial input parameters entered when creating the instance.

property internal_id

Ticker - i.e. part of name determining content of the class. For types with saved reference data - ticker will be self._ticker. For software types - ticker should be calculated.

property is_unmapped

Check if the object is not mapped.

property live_supported: bool

Flag for live supported objects.

property name

Primary name by which the FrameworkObject is identified. If reference information (or e.g. corresponding time series) are stored in the DB, then this name will be used.

print_dependencies(root_dependency: Optional[sigtech.framework.internal.infra.mu.graph.registry.factory.Dependency] = None, resolve_future_dependencies: bool = True, fields: Optional[list] = None)

Pretty print dependency tree :param root_dependency: starting dependency of the tree. :param resolve_future_dependencies: resolve future dependencies before printing. If ‘false’ nothing get printed. :param fields: additional fields to extract from dependencies object. Default fields are product_type, currency, frequency and data_source. To get the list of available fields for an object you can use the data_dict() method.

property product_type

Return the product_type property of this object.

property publication_delay: str

Publication delay of data for this group.

query_instrument_names() list[str]

Generic doc store query to retrieve names of objects meeting filter criteria. :return: List of object names meeting filter criteria.

query_instruments() list[sigtech.framework.internal.infra.objects.core.framework_object.FrameworkObject]

Generic doc store query to retrieve objects meeting filter criteria. :return: List of objects meeting filter criteria

property sector

Sector used on BBG, or the class ID for SIG instruments.

session_data()

Returns the raw Copp-Clarke trading sessions data for this group

static sort_key_static(name)

Convert a name to the sort key as of Portfolio Presentation Guidelines for performance reasons.

Parameters

name – Input name.

Returns

Tuple (sort key, length of sort key, input name).

textual_representation()

Return a printable representation of this object.

validate()

Validation routine adding checks that will be run on object creation.

holidays: str
due_time: datetime.time
valuation_time: datetime.time
timezone: str
description: Optional[str]
fixing_source: str
item_product_type: Optional[str]
data_source_all: Optional[list[str]]
instrument_id: Optional[int]