Class Swaption
- java.lang.Object
-
- com.opengamma.strata.product.swaption.Swaption
-
- All Implemented Interfaces:
Resolvable<ResolvedSwaption>
,Product
,Serializable
,org.joda.beans.Bean
,org.joda.beans.ImmutableBean
public final class Swaption extends Object implements Product, Resolvable<ResolvedSwaption>, org.joda.beans.ImmutableBean, Serializable
An option on an underlying swap.A swaption is a financial instrument that provides an option based on the future value of a swap. The underlying swap must be a single currency, Fixed-Float swap with a single index. The index may be Ibor or Overnight.
Strata supports European swaptions for pricing. However, the trade model supports Bermudan and American exercise.
- See Also:
- Serialized Form
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
Swaption.Builder
The bean-builder forSwaption
.static class
Swaption.Meta
The meta-bean forSwaption
.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description ImmutableSet<Currency>
allCurrencies()
Returns the set of currencies the product refers to.static Swaption.Builder
builder()
Returns a builder used to create an instance of the bean.boolean
equals(Object obj)
Swap
exercise(LocalDate exerciseDate, ReferenceData refData)
Exercises the swaption into a swap at one of the optional exercise dates.Currency
getCurrency()
Gets the currency of the swaption.Optional<SwaptionExercise>
getExerciseInfo()
Gets the exercise information, optional.ZonedDateTime
getExpiry()
Gets the expiry date-time.AdjustableDate
getExpiryDate()
Gets the expiry date of the option.LocalTime
getExpiryTime()
Gets the expiry time of the option.ZoneId
getExpiryZone()
Gets the time-zone of the expiry time.RateIndex
getIndex()
Gets the index of the underlying swap.LongShort
getLongShort()
Gets whether the option is long or short.SwaptionSettlement
getSwaptionSettlement()
Gets settlement method.Swap
getUnderlying()
Gets the underlying swap.int
hashCode()
static Swaption.Meta
meta()
The meta-bean forSwaption
.Swaption.Meta
metaBean()
ResolvedSwaption
resolve(ReferenceData refData)
Resolves this object using the specified reference data.Swaption
selectExerciseDate(LocalDate exerciseDate, ReferenceData refData)
Selects one of the exercise dates.Swaption.Builder
toBuilder()
Returns a builder that allows this bean to be mutated.String
toString()
-
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface com.opengamma.strata.product.Product
allPaymentCurrencies, isCrossCurrency
-
-
-
-
Method Detail
-
getExpiry
public ZonedDateTime getExpiry()
Gets the expiry date-time.The option expires at this date and time.
The result is returned by combining the expiry date, time and time-zone.
- Returns:
- the expiry date and time
-
getCurrency
public Currency getCurrency()
Gets the currency of the swaption.This is the currency of the underlying swap, which is not allowed to be cross-currency.
- Returns:
- the expiry date and time
-
allCurrencies
public ImmutableSet<Currency> allCurrencies()
Description copied from interface:Product
Returns the set of currencies the product refers to.This returns the complete set of currencies, not just the payment currencies. For example, the sets will differ when one of the currencies is non-deliverable.
- Specified by:
allCurrencies
in interfaceProduct
- Returns:
- the set of currencies the product refers to
-
getIndex
public RateIndex getIndex()
Gets the index of the underlying swap.- Returns:
- the index of the underlying swap
-
selectExerciseDate
public Swaption selectExerciseDate(LocalDate exerciseDate, ReferenceData refData)
Selects one of the exercise dates.This returns a swaption with the
exerciseInfo
removed. The expiry date and underlying swap will be set in accordance with the selected exercise date. If the swaption has no exercise information, this checks that the exercise date matches the expiry date.The date is matched as an adjusted date first, then as an unadjusted date. If the date can only be an adjusted date, the result will use
BusinessDayAdjustment.NONE
.- Parameters:
exerciseDate
- the exercise date, which must be valid for the swaptionrefData
- the reference data- Returns:
- the swaption in European form with the specified exercise date
- Throws:
IllegalArgumentException
- if the proposed exercise date is not valid
-
exercise
public Swap exercise(LocalDate exerciseDate, ReferenceData refData)
Exercises the swaption into a swap at one of the optional exercise dates.The start date of the swap will be set in accordance with the selected exercise date. See
selectExerciseDate(LocalDate, ReferenceData)
for more info.- Parameters:
exerciseDate
- the exercise date, which must be valid for the swaptionrefData
- the reference data- Returns:
- the exercised swap
- Throws:
IllegalArgumentException
- if the proposed exercise date is not valid
-
resolve
public ResolvedSwaption resolve(ReferenceData refData)
Description copied from interface:Resolvable
Resolves this object using the specified reference data.This converts the object implementing this interface to the equivalent resolved form. All
ReferenceDataId
identifiers in this instance will be resolved. The resolved form will typically be a type that is optimized for pricing.Resolved objects may be bound to data that changes over time, such as holiday calendars. If the data changes, such as the addition of a new holiday, the resolved form will not be updated. Care must be taken when placing the resolved form in a cache or persistence layer.
- Specified by:
resolve
in interfaceResolvable<ResolvedSwaption>
- Parameters:
refData
- the reference data to use when resolving- Returns:
- the resolved instance
-
meta
public static Swaption.Meta meta()
The meta-bean forSwaption
.- Returns:
- the meta-bean, not null
-
builder
public static Swaption.Builder builder()
Returns a builder used to create an instance of the bean.- Returns:
- the builder, not null
-
metaBean
public Swaption.Meta metaBean()
- Specified by:
metaBean
in interfaceorg.joda.beans.Bean
-
getLongShort
public LongShort getLongShort()
Gets whether the option is long or short.Long indicates that the owner wants the option to be in the money at expiry. Short indicates that the owner wants the option to be out of the money at expiry.
- Returns:
- the value of the property, not null
-
getSwaptionSettlement
public SwaptionSettlement getSwaptionSettlement()
Gets settlement method.The settlement of the option is specified by
SwaptionSettlement
.- Returns:
- the value of the property, not null
-
getExerciseInfo
public Optional<SwaptionExercise> getExerciseInfo()
Gets the exercise information, optional.A swaption can have three different kinds of exercise - European, American and Bermudan. A European swaption has one exercise date, an American can exercise on any date, and a Bermudan can exercise on a fixed set of dates.
If not present, the swaption is considered to be a European swaption as per the expiry date.
- Returns:
- the optional value of the property, not null
-
getExpiryDate
public AdjustableDate getExpiryDate()
Gets the expiry date of the option.This is the last date that the swaption can be exercised. To represent Bermudan and American swaptions, or to represent a European swaption where the swap start date is calculated dynamically, see the
exerciseOptions
field.This date is typically set to be a valid business day. However, the
businessDayAdjustment
property may be set to provide a rule for adjustment.- Returns:
- the value of the property, not null
-
getExpiryTime
public LocalTime getExpiryTime()
Gets the expiry time of the option.The expiry time is related to the expiry date and time-zone.
- Returns:
- the value of the property, not null
-
getExpiryZone
public ZoneId getExpiryZone()
Gets the time-zone of the expiry time.The expiry time-zone is related to the expiry date and time.
- Returns:
- the value of the property, not null
-
getUnderlying
public Swap getUnderlying()
Gets the underlying swap.At expiry, if the option is exercised, this swap will be entered into. The swap description is the swap as viewed by the party long the option.
- Returns:
- the value of the property, not null
-
toBuilder
public Swaption.Builder toBuilder()
Returns a builder that allows this bean to be mutated.- Returns:
- the mutable builder, not null
-
-