BRLSwapUtils#

class sigtech.framework.instruments.brazil_swap.BRLSwapUtils

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

static holidays()

List of holiday calendars.

static get_cdi_history(start_date: datetime.date, end_date: datetime.date)

Get (percentage) CDI fixings from start_date to end_date

static get_onshore_swap_rate_history(month_year: datetime.date)

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

static get_offshore_swap_rate_history(month_year: datetime.date)

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

static maturity_from_month(date_in_month: datetime.date) datetime.date

Maturity date of DI future maturing in the input month.

static get_maturity(start_date: datetime.date, tenor: Union[str, datetime.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_zero_coupon_prices(month_year: datetime.date, data_dates: Optional[list[datetime.date]] = None, onshore: bool = False) list[float]

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

static get_swap_group()

Load or create group for offshore Brazil swaps.

static get_offshore_swap(start_date: datetime.date, tenor: Union[str, datetime.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 schedule_stub()

Schedule stub for all offshore BRL swap instruments.