diff options
Diffstat (limited to 'python')
| -rw-r--r-- | python/trade_dataclasses.py | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/python/trade_dataclasses.py b/python/trade_dataclasses.py index 081dbc1d..379fd858 100644 --- a/python/trade_dataclasses.py +++ b/python/trade_dataclasses.py @@ -443,11 +443,14 @@ class SwaptionDeal( def to_markit(self): obj = self.serialize("mtm") obj["Initial Payment"] = obj["price"] * obj["1st Leg Notional"] * 0.01 - obj["Transaction Code"] = "Receive" if obj["buysell"] else "Pay" obj["Trade ID"] = obj["Swap ID"] obj["Product Type"] = "CDISW" obj["Transaction Type"] = "NEW" - obj["Protection"] = "Buy" if obj["option_type"] == "PAYER" else "Sell" + obj["Protection"] = ( + ("Buy" if obj["option_type"] == "PAYER" else "Sell") + if obj["buysell"] + else ("Sell" if obj["option_type"] == "PAYER" else "Buy") + ) obj["Entity Matrix"] = "Publisher" obj["Clearing House"] = "ICE_FCM_US" obj["Swaption Settlement Type"] = "Physical" |
