## Interface SingleCurrencySwapConvention

• All Superinterfaces:
Named, TradeConvention
All Known Subinterfaces:
FixedIborSwapConvention, FixedInflationSwapConvention, FixedOvernightSwapConvention, IborIborSwapConvention, OvernightIborSwapConvention, ThreeLegBasisSwapConvention
All Known Implementing Classes:
ImmutableFixedIborSwapConvention, ImmutableFixedInflationSwapConvention, ImmutableFixedOvernightSwapConvention, ImmutableIborIborSwapConvention, ImmutableOvernightIborSwapConvention, ImmutableThreeLegBasisSwapConvention

public interface SingleCurrencySwapConvention
extends TradeConvention, Named
A market convention for swap trades.

This defines the market convention for a a swap. Each different type of swap has its own convention - this interface provides an abstraction.

• ### Method Summary

All Methods
Modifier and Type Method Description
default java.time.LocalDate calculateSpotDateFromTradeDate​(java.time.LocalDate tradeDate, ReferenceData refData)
Calculates the spot date from the trade date.
default SwapTrade createTrade​(java.time.LocalDate tradeDate, Tenor tenor, BuySell buySell, double notional, double fixedRateOrSpread, ReferenceData refData)
Creates a spot-starting trade based on this convention.
default SwapTrade createTrade​(java.time.LocalDate tradeDate, java.time.Period periodToStart, Tenor tenor, BuySell buySell, double notional, double fixedRateOrSpread, ReferenceData refData)
Creates a forward-starting trade based on this convention.
java.lang.String getName()
Gets the name that uniquely identifies this convention.
DaysAdjustment getSpotDateOffset()
Gets the offset of the spot value date from the trade date.
static SingleCurrencySwapConvention of​(java.lang.String uniqueName)
Obtains an instance from the specified unique name.
SwapTrade toTrade​(TradeInfo tradeInfo, java.time.LocalDate startDate, java.time.LocalDate endDate, BuySell buySell, double notional, double fixedRateOrSpread)
Creates a trade based on this convention.
default SwapTrade toTrade​(java.time.LocalDate tradeDate, java.time.LocalDate startDate, java.time.LocalDate endDate, BuySell buySell, double notional, double fixedRateOrSpread)
Creates a trade based on this convention.
• ### Method Detail

• #### of

static SingleCurrencySwapConvention of​(java.lang.String uniqueName)
Obtains an instance from the specified unique name.
Parameters:
uniqueName - the unique name
Returns:
the convention
Throws:
java.lang.IllegalArgumentException - if the name is not known
• #### getSpotDateOffset

DaysAdjustment getSpotDateOffset()
Gets the offset of the spot value date from the trade date.

The offset is applied to the trade date to find the start date. A typical value is "plus 2 business days".

Returns:
the spot date offset, not null

default SwapTrade createTrade​(java.time.LocalDate tradeDate,
Tenor tenor,
double notional,
ReferenceData refData)
Creates a spot-starting trade based on this convention.

This returns a trade based on the specified tenor. For example, a tenor of 5 years creates a swap starting on the spot date and maturing 5 years later.

See the instrument-level documentation to understand how the fixed rate or spread is applied.

Parameters:
tradeDate - the date of the trade
tenor - the tenor of the swap
buySell - the buy/sell flag
notional - the notional amount
fixedRateOrSpread - the fixed rate or spread in decimal form, typically derived from the market
refData - the reference data, used to resolve the trade dates
Returns:
Throws:
ReferenceDataNotFoundException - if an identifier cannot be resolved in the reference data

default SwapTrade createTrade​(java.time.LocalDate tradeDate,
java.time.Period periodToStart,
Tenor tenor,
double notional,
ReferenceData refData)
Creates a forward-starting trade based on this convention.

This returns a trade based on the specified period and tenor. For example, a period of 3 months and a tenor of 5 years creates a swap starting three months after the spot date and maturing 5 years later.

See the instrument-level documentation to understand how the fixed rate or spread is applied.

Parameters:
tradeDate - the date of the trade
periodToStart - the period between the spot date and the start date
tenor - the tenor of the swap
buySell - the buy/sell flag
notional - the notional amount
fixedRateOrSpread - the fixed rate or spread in decimal form, typically derived from the market
refData - the reference data, used to resolve the trade dates
Returns:
Throws:
ReferenceDataNotFoundException - if an identifier cannot be resolved in the reference data

default SwapTrade toTrade​(java.time.LocalDate tradeDate,
java.time.LocalDate startDate,
java.time.LocalDate endDate,
double notional,
double fixedRateOrSpread)
Creates a trade based on this convention.

This returns a trade based on the specified dates.

See the instrument-level documentation to understand how the fixed rate or spread is applied.

Parameters:
tradeDate - the date of the trade
startDate - the start date
endDate - the end date
buySell - the buy/sell flag
notional - the notional amount
fixedRateOrSpread - the fixed rate or spread in decimal form, typically derived from the market
Returns:

SwapTrade toTrade​(TradeInfo tradeInfo,
java.time.LocalDate startDate,
java.time.LocalDate endDate,
double notional,
double fixedRateOrSpread)
Creates a trade based on this convention.

This returns a trade based on the specified dates.

See the instrument-level documentation to understand how the fixed rate or spread is applied.

Parameters:
tradeInfo - additional information about the trade
startDate - the start date
endDate - the end date
buySell - the buy/sell flag
notional - the notional amount
fixedRateOrSpread - the fixed rate or spread in decimal form, typically derived from the market
Returns:

default java.time.LocalDate calculateSpotDateFromTradeDate​(java.time.LocalDate tradeDate,
ReferenceData refData)
Calculates the spot date from the trade date.
Parameters:
tradeDate - the trade date
refData - the reference data, used to resolve the date
Returns:
the spot date
Throws:
ReferenceDataNotFoundException - if an identifier cannot be resolved in the reference data
• #### getName

java.lang.String getName()
Gets the name that uniquely identifies this convention.

This name is used in serialization and can be parsed using of(String).

Specified by:
getName in interface Named
Returns:
the unique name