BRLSwapUtils

BRLSwapUtils#

class sigtech.framework.instruments.brazil_swap.BRLSwapUtils

Generic common functionality for BRL on-shore and off-shore swaps

static get_cdi_history(start_date: date, end_date: date)

Get (percentage) CDI fixings from start_date to end_date

static get_maturity(start_date: date, tenor: Union[str, date])

Get standard maturity of DI Future starting on a start_date. tenor can be date in the maturity month, offset from start, or future like ticker

static get_offshore_swap(start_date: date, tenor: Union[str, date], fixed_rate=None, initial_notional=None, adjust_maturity=True, use_next_available_curve_maturity=True)

Get BrazilOffshoreSwap instrument, with more flexibility on the maturity (tenor) input - can be actual physical settlement date (e.g. dtm.date(2018, 7, 2), offset from start_date, with the next valid onshore future maturity date being the maturity (e.g. '11M' or '1Y'), or future style ticker for maturity month and year (e.g. ‘Z20’ for December-2020). adjust_maturity is a Boolean flag (True by default) indicating if tenor should be used as swap maturity_date as it is - False, or adjusted to the valid maturity in the same month (True, default). use_next_available_curve_maturity is a flag saying to move to the next available maturity for which there is data (True), or use the resulting input swap maturity (False), even though we can’t price the swap on start_date.

static get_offshore_swap_rate_history(month_year: date)

Percentage rate history for a zero swap, equivalent to onshore future maturing in the month_year month.

static get_onshore_swap_rate_history(month_year: date)

Percentage rate history for a future maturing in the month_year month.

static get_swap_group()

Load or create group for offshore Brazil swaps.

static get_zero_coupon_prices(month_year: date, data_dates: list[datetime.date] = None, onshore: bool = False) list[float]

Zero coupon prices/notionals obtained from fair market rates for DI future/offshore swap.

static holidays()

List of holiday calendars.

static maturity_from_month(date_in_month: date) date

Maturity date of DI future maturing in the input month.

static schedule_stub()

Schedule stub for all offshore BRL swap instruments.