FinancePy

FinancePy API Reference

Ibor Curve Risk Engine

financepy.products.rates.ibor_curve_risk_engine

Functions

carry_rolldown_report

carry_rolldown_report(base_curve: financepy.market.curves.discount_curve.DiscountCurve, grid_last_date: financepy.utils.date.Date, grid_bucket_tenor: str | financepy.utils.tenor.Tenor, trades: list, trade_labels: list = None, bump_size=0.0001)
Generate carry and rolldown risk report based on the sensitivity of trades to bucketed shocks of the instantaneous (ON) forward rates. Here shock_i is applied to the ON forward rates over [t_i, t_{i+1}] where {t_i} is a time grid from base_curve.value_date to grid_last_date with buckets of size grid_bucket_tenor Args: base_curve (DiscountCurve): base curve to apply bumps to grid_last_date: the last date for the grid that defines shocks grid_bucket_tenor (str): spacing of grid points as tenor string e.g'3M' trades (list): a list of trades to calculate deltas of trade_labels (list, optional): trade labels to identify trades in the output. Defaults to None in which case these are auto generted bump_size (float, optional): How big of a bump to apply to bechmarks. Output always expressed as change in value per 1 bp. Defaults to 1.0*G_BASIS_POINT. Returns: (dict, Dataframe): (base_values, risk_report) base_value is a dictionary with trade_labels as keys and base trade values as values risk_report is a dataframe with time buickets for rows and carry/rolldown and DV01 columns per trade, and a total for all trades for each measure. Columns marked 'ROLL' have carry in the first row and rolldown in all the others

forward_rate_risk_report

forward_rate_risk_report(base_curve: financepy.market.curves.discount_curve.DiscountCurve, grid_last_date: financepy.utils.date.Date, grid_bucket_tenor: str, trades: list, trade_labels: list = None, bump_size=0.0001)
Generate forward rate deltas (forward delta ladder) risk report, which is the sensitivity of trades to bucketed shocks of the instantaneous (ON) forward rates. Here shock_i is applied to the ON forward rates over [t_i, t_{i+1}] where {t_i} is a time grid from base_curve.value_date to grid_last_date with buckets of size grid_bucket_tenor Args: base_curve (DiscountCurve): base curve to apply bumps to grid_last_date: the last date for the grid that defines shocks grid_bucket_tenor (str): spacing of grid points as tenor string eg '3M' trades (list): a list of trades to calculate deltas of trade_labels (list, optional): trade labels to identify trades in output. Defaults to None in which case these are auto generted bump_size (float, optional): How big of a bump to apply to bechmarks. Output always expressed as change in value per 1 bp. Defaults to 1.0*G_BASIS_POINT. Returns: (dict, Dataframe): (base_values, risk_report) base_value is a dictionary with trade_labels as keys and base trade values as values risk_report is a dataframe with bump details for rows and a column of forward rate deltas per trade, and a total for all trades

forward_rate_risk_report_custom_grid

forward_rate_risk_report_custom_grid(base_curve: financepy.market.curves.discount_curve.DiscountCurve, grid: List[financepy.utils.date.Date], trades: list, grid_labels: list = None, trade_labels: list = None, bump_size=0.0001)
Generate forward rate deltas risk report, which is the sensitivity of trades to bucketed shocks of the instantaneous (ON) forward rates. Here shock_i is applied to the ON forward rates over [t_i, t_{i+1}] where {t_i} is the 'grid' argument Args: base_curve (DiscountCurve): base curve to apply bumps to grid: Date grid that defines ON forward rate bumps. Note that curve.value_date must be explictly included (if so desired) trades (list): a list of trades to calculate deltas of trade_labels (list, optional): trade labels to identify trades in the output. Defaults to None in which case these are auto generted bump_size (float, optional): How big of a bump to apply to bechmarks. Output always expressed as change in value per 1 bp. Defaults to 1.0*G_BASIS_POINT. Returns: (dict, Dataframe): (base_values, risk_report) base_value is a dictionary with trade_labels as keys and base trade values as values risk_report is a dataframe with bump details for rows and a column of forward rate deltas per trade, and a total for all trades

par_rate_risk_report

par_rate_risk_report(base_curve: financepy.products.rates.ibor_single_curve.IborSingleCurve, trades: list, trade_labels: list = None, bump_size=0.0001)
Calculate deltas (change in value to 1bp bump) of the trades to all benchmarks in the base curve. Supported trades are depos, fras, swaps. trade_labels are used to identify trades in the output, if not provided simple ones are generated Args: base_curve (IborSingleCurve): Base curve to be bumped trades (list): a list of trades to calculate deltas of trade_labels (list, optional): trade labels to identify trades in the output. Defaults to None in which case these are auto generted bump_size (float, optional): How big of a bump to apply to bechmarks. Output always expressed as change in value per 1 bp. Defaults to 1.0*G_BASIS_POINT. Returns: (base_values, risk_report): base_value is a dictionary with trade_labels as keys and base trade values as values risk_report is a dataframe with benchmarks as rows and a column of par deltas per trade, and a total for all trades

parallel_shift_ladder_report

parallel_shift_ladder_report(base_curve: financepy.market.curves.discount_curve.DiscountCurve, curve_shifts: numpy.ndarray, trades: list, trade_labels: list = None)

No description available.

Generated automatically from the FinancePy source code. Do not edit this file manually.