diff options
Diffstat (limited to 'python/trade_dataclasses.py')
| -rw-r--r-- | python/trade_dataclasses.py | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/python/trade_dataclasses.py b/python/trade_dataclasses.py index 06572e3e..84c812ee 100644 --- a/python/trade_dataclasses.py +++ b/python/trade_dataclasses.py @@ -1248,6 +1248,7 @@ class TrancheProduct( @dataclass class SwaptionProduct( + CitcoDeal, Deal, deal_type=DealType.SwaptionProduct, table_name="citco_swaption", @@ -1317,7 +1318,12 @@ class SwaptionProduct( obj = self.serialize("citco") obj["Command"] = "N" - obj["Coupon Rate"] = obj["Coupon Rate"] / 100 + obj["Active"] = "Y" + obj["Birth_date"] = obj["Birth_date"].strftime("%Y%m%d") + obj["Death_date"] = obj["Death_date"].strftime("%Y%m%d") + obj["Expiration Date"] = obj["Expiration Date"].strftime("%Y%m%d") + obj["Put/Call Flag"] = "C" if obj["callput"] else "P" + obj["Option Type"] = "Vanilla European" return obj @@ -1412,6 +1418,6 @@ class IRSProduct( obj["Command"] = "N" obj["Active"] = "Y" if obj["Active"] else "N" obj["Principal Exch TypeID"] = 1 - obj["Birth_date"] = obj["Birth_date"].replace("-", "") - obj["Death_date"] = obj["Death_date"].replace("-", "") + obj["Birth_date"] = obj["Birth_date"].strftime("%Y%m%d") + obj["Death_date"] = obj["Death_date"].strftime("%Y%m%d") return obj |
