Swaption#
-
class sigtech.framework.instruments.swaption.Swaption
Baseclasses:
OTCVolBasedBase
Subclasses:
OISSwaption
A class representing a swaption.
Example object creation:
import datetime as dtm group = sig.SwaptionGroup.get_group("USD") s = sig.Swaption( start_date=dtm.date(2019, 12, 19), strike='ATM+10bp', expiry='3M', swap_tenor='5Y', option_type='Receiver', swaption_group=group.name, currency='USD' )
The strike could be specified as a plain value,
'ATM'
or a basis point offset from ATM, e.g.,'ATM-5bp'
.None
is interpreted as'ATM'
.The premium is paid by default on the
start_date
, but this can be reset by settingforward_premium
parameter either toTrue
to imply it from the option value, or directly to the pre-set premium value, to be paid at the option expiry date.end_date
is an optional parameter, used purely for calculation optimisation. (Date when the option position is closed).history_start
is another optional parameter, that allows to start computing option history earlier than thestart_date
(in case the latter is used for maturity from tenor, or strike computation, but an earlier date value is needed by a strategy)-
property all_data_dates
Return all the dates that should have actual history values.
-
property available_data_points
Available data points
-
cash_settled_with_swap_rate: Optional[bool]
-
property default_data_point
Default data point
-
end_date: Optional[date]
-
expiry: Union[date, str]
-
property expiry_date
date contract expires, or last date on which we can trade
-
forward_premium: Optional[Union[bool, float]]
-
property greek_fields
Additional fields used for risk management
-
history_start: Optional[date]
-
property holidays
List of holiday calendars for this instrument.
-
option_type: Literal['Payer', 'Receiver']
-
start_date: date
-
strike: Optional[Union[float, str]]
-
swap_tenor: str
-
swaption_group: Optional[str]
-
property underlying
Name of the underlying of this swaption.
-
property valuation_time
Valuation time for the instrument.
-
dollar_greeks(field, data_point=None, **kwargs) deprecated
Deprecated method returning the dollar timeseries for this option instrument.
- Parameters:
field – Input greek.
data_point – Input data point (optional).
- Returns:
pandas series.
-
get_forwards(data_dates, data_point=None, discount_curves=None, forecast_curves=None)
discount and forecast curves should correspond to the data_dates and data_point if passed in.
-
greeks(field=None, data_point=None, dollar_greeks=False)
Return the greeks available for this option instrument.
- Parameters:
field – Input greek (optional, all greeks returned by default).
data_point – Input data point (optional).
dollar_greeks – Provide dollar greeks, defaults to False.
- Returns:
pandas Series for an individual greek, DataFrame otherwise.
-
metrics(fields=None, data_dates=None, data_point=None)
Get time series of standard swaption metrics, including option Greeks and/or NPV, determined by the
fields
parameter.- Parameters:
fields – Name of a Greek or
'NPV'
to output. Can be a list, e.g. ['NPV'
,'Delta'
,'Vega'
]. If None is passed, all available metrics are returned. A list of Greeks can be obtained using the propertygreek_fields
. In addition,'Delta_numeric'
and'Gamma_numeric'
can be passed for proper numeric discounting and forecasting curves shift sensitivity, or'Delta_simple'
and'Gamma_simple'
for sensitivity only to swap rate shift, assuming discounting stays the same. (Default'Delta'
and'Gamma'
give quicker approximation for the numeric shifted Delta and Gamma).data_dates – (Optional) Date or list of dates for which the option metrics are needed. If
None
is passed, the full time series is returned.data_point – (Optional) Valuation data point.
- Returns:
Time series of the requested metrics.
-
par_rates(data_point=None)
Par rates history of the instrument.
- Parameters:
data_point – Input data pint (optional).
- Returns:
pandas series.
-
pnl_explain(fields=None, data_point=None)
A breakdown of the actual pnl and greeks pnl over time for a list of fields.
- Parameters:
fields – Input fields (optional).
data_point – Input data point (optional).
- Returns:
pandas DataFrame.
-
settlement_value(data_point=None)
Need to be careful with data_point - for physical settlement it should be the swap start data_point, as we are switching from option to the swap. For cash settled - it should be the settlement time specified in the contract, as we use the market data as of that time to compute the cash settlement amount.
-
swaption_metrics(fields=None, data_dates=None, data_point=None) deprecated
Deprecated method to get time series of standard swaption metrics, including option Greeks and/or NPV.
-
trade_group()
Option group used for specifying type of traded options.
-
vol_surfaces()
Return the vol surface of the swaption.