question

Upvotes
Accepted
1 0 0 0

ipa financial contracts Swaption python API not working for call_put = 'PUT'

I am trying to to use the Swaption Pricer via the Python Eikon Api, and it seems that the functionality does not work if the Swaption is specified as a call option. For a put option I get reasonable results, but for a call option I only get None values. See below example:


This one works:


swapDef = ipa.swap.Definition(start_date='2022-10-26', end_date='2030-10-26',

... template='EUR_AB3E')

... swaptionDef = [(ipa.swaption.Definition(instrument_tag="mySwaption",

... end_date='2022-10-26',

... strike_percent=2.2,

... buy_sell=ipa.enum_types.BuySell.BUY,

... call_put=ipa.enum_types.CallPut.PUT,

... exercise_style=ipa.enum_types.ExerciseStyle.EURO,

... underlying_definition=swapDef),

... ipa.swaption.CalculationParams(valuation_date='2022-06-23'))]

...

... valuationResult = rdp.get_swaption_analytics(

... universe=swaptionDef,

... calculation_params=ipa.swaption.CalculationParams(valuation_date=trade_date),

... fields=['MarketValueInDealCcy'])

valuationResult

MarketValueInDealCcy

0 24137.521123



But with the same input, except using call_put=ipa.enum_types.CallPut.CALL, I'll get None values:


swapDef = ipa.swap.Definition(start_date='2022-10-26', end_date='2030-10-26',

... template='EUR_AB3E')

... swaptionDef = [(ipa.swaption.Definition(instrument_tag="mySwaption",

... end_date='2022-10-24',

... strike_percent=2.2,

... buy_sell=ipa.enum_types.BuySell.BUY,

... call_put=ipa.enum_types.CallPut.CALL,

... exercise_style=ipa.enum_types.ExerciseStyle.EURO,

... underlying_definition=swapDef),

... ipa.swaption.CalculationParams(valuation_date='2022-06-23'))]

...

... valuationResult = rdp.get_swaption_analytics(

... universe=swaptionDef,

... calculation_params=ipa.swaption.CalculationParams(valuation_date=trade_date),

... fields=['MarketValueInDealCcy'])

...

valuationResult

MarketValueInDealCcy

0 None



Could there be a bug in the pricer?

pythonrefinitiv-dataplatform-eikonipaswaps
icon clock
10 |1500

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

1 Answer

· Write an Answer
Upvote
Accepted
321 7 0 1

Hi @olga.schulz

The 'callput' is not supported for swaptions, could you try instead 'swaptionType' (Payer/Receiver) as illustrated below?

Thanks,

Regards

Michel


{
    "fields": [
        "MarketValueInReportCcy",
        "ErrorMessage"
    ],
    "universe": [
        {
            "instrumentType": "Swaption",
            "instrumentDefinition": {
                "instrumentTag": "test",
                "startDate": "2022-10-26",
                "endDate": "2030-05-21",
                "strikePercent": 1.0,
                "buySell": "Buy",
                "exerciseStyle": "EURO",
                "swaptionType": "Payer",
                "underlyingDefinition": {
                    "tenor": "5Y",
                    "template": "EUR_AB3E"
                }
            },
            "pricingParameters": {
                "valuationDate": "2022-06-23",
                "reportCcy": "USD"
            }
        }
    ]
}
icon clock
10 |1500

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.