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?

Best Answer

  • Michel B
    Answer ✓

    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"
    }
    }
    ]
    }