VarianceSwap

VarianceSwap#

class sigtech.framework.instruments.variance_swap.VarianceSwap

Baseclasses: TradableInstrument

A class implementing a variance swap.

Keyword arguments:

  • start_date: Date the swap is traded.

  • strike_override: The variance strike of the swap. Defaults to the fair strike such that the swap is worth zero at initiation.

  • swap_start_date: The starting date of the underlying variance accounting (defaults to start_date).

  • maturity_date: The last date of the underlying variance accounting. Could also be specified as tenor, e.g. '1M', '3M', '1Y', etc.

  • underlying: Name of the underlying asset.

  • option_group: Name of the corresponding option group. Either the underlying or the option_group is required.

  • use_option_replication: If True, the variance is estimated using a basket of options.

  • lower_strike_fraction: The lower boundary of the strikes for replication (%ATM).

  • upper_strike_fraction: The upper boundary of the strikes for replication (%ATM).

  • one_sided_option_num: Number of replicating options in the basket on each side of ATM.

  • history_start Optional parameter, that allows to start computing swap history earlier than the start_date (in case the latter is used for maturity from tenor, or strike computation, but an earlier date value is needed by a strategy)

    Example creation:

group = sig.obj.get('SPX INDEX OTC OPTION GROUP')

vs = sig.VarianceSwap(
    currency='USD',
    start_date=dtm.date(2022, 1, 4),
    maturity_date=dtm.date(2023, 1, 4),
    option_group=group.name
)
property data_point: DataPoint

Field used when retrieving history.

property expiry_date

date contract expires, or last date on which we can trade

property greek_fields

Additional fields used for risk management.

history_start: Optional[date]
property holidays

List of holiday calendars for this instrument.

last_data_date_offset: Optional[str]
lower_strike_fraction: Optional[float]
maturity_date: Union[date, str]
one_sided_option_num: Optional[int]
option_group: Optional[str]
start_date: date
strike_override: Optional[float]
swap_start_date: Optional[date]
underlying: Optional[str]
upper_strike_fraction: Optional[float]
use_option_replication: Optional[bool]
variance_curve: Optional[str]
property vega_notional

Vega notional.

exchange()

Exchange object for this instrument.

get_replicating_basket(strike_rounding=False)

Generate a basket of options to replicate the variance swap. The output from this method can be used directly in the DynamicOptionsStrategy building block through the basket_creation_method attribute. The output is a dictionary with options as keys and their respective weights in the replicating basket as values. :param strike_rounding: Whether to round strikes according to option group’s rules (optional, False by default). :return: Replicating basket as dict.

greeks(field=None, data_point=None)

Return the greeks available for this instrument.

Parameters:
  • field – Input greek (optional, all greeks returned by default).

  • data_point – Point to evaluate the greeks (optional).

Returns:

pandas Series for an individual greek, DataFrame otherwise.

is_option()

The variance swap has the properties of an option if it is replicated or approximated.

metrics(fields: Optional[list] = None) DataFrame

Return a DataFrame of swap metrics.

static schedule_stub(env: ConfiguredEnvironment, group_name: str)

Returns a schedule stub for the variance swap.

settlement_value()

Cash settlement amount, or the value of the physical contract at settlement.

swap_metrics() DataFrame deprecated

Deprecated method returning a DataFrame of swap metrics.

trade_group()

Group used for specifying type of traded instruments.