LSEG Data Library for Python

swap.Definition

Creates a swap.Definition object.

Syntax

`swap.Definition(trade_date, start_date, ...)

Parameters

Value Description Data type Optional Default value
instrument_tag User defined string to identify the instrument.It can be used to link output results to the instrument definition. Only alphabetic, numeric and '- _.#=@' characters are supported. string Yes -
instrument_code A swap RIC that is used to retrieve the description of the swap contract. string Yes -
trade_date The date the swap contract was created. string Yes -
start_date The date the swap starts accruing interest. Its effective date string Yes -
end_date The maturity date of the swap contract. string Yes -
tenor The period code that represents the time between the start date and end date the contract. string Yes -
legs SwapLegDefinition[]. See swap.LegDefinition bellow enum Yes -
is_non_deliverable A flag that indicates if the swap is non-deliverable. bool Yes -
settlement_ccy For non-deliverable instrument, the ISO code of the settlement currency. string Yes -
start_tenor The code indicating the period from a spot date to startDate of the instrument (e.g. '1M'). string Yes -
template A reference to a common swap contract. string Yes -
fields List of fields to request. list Yes -
pricing_parameters See swap.pricing_parameters bellow enum Yes -
extended_params Specifies the parameters that will be merged with the request. dict Yes -

Returned value

swap.Definition instance


swap.LegDefinition

Creates a swap.LegDefinition object.

Syntax

`swap.LegDefinition(trade_date, start_date, ...)

Parameters

Value Description Data type Optional Default value
leg_tag A user provided string to identify the leg that will also be part of the response. Optional. string Yes -
direction The direction of the leg. See Direction enum No -
interest_type An indicator whether the instrument pays a fixed or floating interest. See InterestType enum No -
notional_ccy The ISO code of the notional currency. Mandatory if instrument code or instrument style has not been defined. In case an instrument code/style has been defined, value may come from the reference data. string No -
notional_amount The notional amount of the leg at the period start date. Optional. By default 1,000,000 is used number Yes -
fixed_rate_percent The fixed coupon rate in percentage. It is mandatory in case of a single leg instrument. Otherwise, in case of multi leg instrument, it can be computed as the Par rate. number Yes -
index_name The name of the floating rate index. Mandatory when the leg is float. string Yes -
index_tenor The period code that represents the maturity of the floating rate index. Mandatory when the leg is float. string Yes -
spread_bp The spread in basis point that is added to the floating rate index index value. Optional. By default 0 is used number Yes -
interest_payment_frequency The frequency of the interest payments. Optional if an instrument code/style have been defined : in that case, value comes from reference data. Otherwise, it is mandatory. See Frequency enum No -
interest_calculation_method The Day Count Basis method used to calculate the coupon interest payments. See DayCountBasis enum No -
accrued_calculation_method DayCountBasis enumeration for financial instruments. See DayCountBasis enum Yes -
payment_business_day_convention The method to adjust dates to a working day. See BusinessDayConvention enum Yes -
payment_roll_convention The method to adjust payment dates when they fall at the end of the month (28th of February, 30th, 31st). See DateRollingConvention enum Yes -
index_reset_frequency The reset frequency in case the leg Type is Float. See Frequency enum Yes -
index_reset_type A type indicating if the floating rate index is reset before the coupon period starts or at the end of the coupon period. See IndexResetType enum Yes -
index_fixing_lag Defines the number of working days between the fixing date and the start of the coupon period ('InAdvance') or the end of the coupon period ('InArrears'). number Yes -
first_regular_payment_date The first regular coupon payment date for leg with an odd first coupon. string Yes -
last_regular_payment_date The last regular coupon payment date for leg with an odd last coupon. string Yes -
amortization_schedule A structure that defines the amortization schedule of the swap list Yes -
payment_business_days A list of coma-separated calendar codes to adjust dates (e.g. 'EMU' or 'USA'). Optional. By default the calendar associated to NotionalCcy is used. string Yes -
notional_exchange An indicator if the notional amount is exchanged and when it is exchanged. See NotionalExchange enum Yes -
adjust_interest_to_payment_date A flag that indicates if the coupon dates are adjusted to the payment dates. See AdjustInterestToPaymentDate enum Yes -
index_compounding_method IndexCompoundingMethod for financial instruments. See IndexCompoundingMethod enum Yes -
interest_payment_delay The number of working days between the end of coupon period and the actual interest payment date. Optional. By default no delay (0) is applied. number Yes -
stub_rule The rule that defines whether coupon roll dates are aligned on the maturity or the issue date. See StubRule enum Yes -
index_average_method The method of calculating the average index value. string Yes -
index_observation_method (rfr) method for determining the accrual observation period. string Yes -
index_spread_compounding_method The method defining how the computed float leg spread is applied to compounded rate. string Yes -
index_spread_compounding_method The method defining how the computed float leg spread is applied to compounded rate. string Yes -
interest_calculation_convention The day count basis method convention used to calculate the interest payments. enum Yes -
cms_template A reference to a common swap contract that represents the underlying swap in case of a Constant Maturity Swap contract (CMS). string Yes -
floor_strike_percent Floor leg strike expressed in % number Yes -
index_fixing_ric The RIC that carries the fixing value. This value overrides the RIC associated by default with the IndexName and IndexTenor. string Yes -
upfront_amount The amount which represents the net present value of the swap. it is computed as (100 dirtypricepercent / 100) x notionalamount. the value is expressed in upfrontamountccy. string Yes -

Returned value

swap.LegDefinition instance


swap.PricingParameters

Creates a swap.PricingParameters object.

Syntax

`swap.PricingParameters(index_convexity_adjustment_integration_method, index_convexity_adjustment_method, ...)

Parameters

Value Description Data type Optional Default value
index_convexity_adjustment_integration_method Integration method used for static replication method. string Yes 'riemannsum'
index_convexity_adjustment_method Convexity adjustment type for CMS swaps and Libor in arrears swaps. See IndexConvexityAdjustmentMethod string Yes 'blackscholes'
price_side See PriceSide enum Yes -
tenor_reference_date See TenorReferenceDate enum Yes -
discounting_ccy User defined discounting currency. string Yes -
discounting_tenor User defined discounting tenor (ex: OIS, 1M, 3M, 6M, 1Y) applied to both legs of the swap. string Yes -
market_data_date The market data date for pricing. Optional. By default, the marketDataDate date is the ValuationDate or Today string Yes -
market_value_in_deal_ccy The target market value of the swap expressed in deal currency. number Yes 0
report_ccy Pricing data is computed in deal currency. If a report currency is set, pricing data is also computed in report currency. string Yes -
use_legs_signing Enable the signing of "risk measures" and "valuation" outputs based on leg's direction. bool No False
valuation_date The valuation date for pricing. string Yes -

Returned value

swap.PricingParameters instance


Learn more

For more information, please follow the link: https://developers.refinitiv.com/en/api-catalog/

1137 words (5:59 mins)