diff options
Diffstat (limited to 'python/trade_dataclasses.py')
| -rw-r--r-- | python/trade_dataclasses.py | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/python/trade_dataclasses.py b/python/trade_dataclasses.py index 84c812ee..5a206a88 100644 --- a/python/trade_dataclasses.py +++ b/python/trade_dataclasses.py @@ -1175,6 +1175,7 @@ class TrancheType(IntEnum): @dataclass class TrancheProduct( + CitcoDeal, Deal, deal_type=DealType.TrancheProduct, table_name="citco_tranche", @@ -1185,11 +1186,12 @@ class TrancheProduct( "death_date", "security_desc", "coupon", + "currency", ), ): underlying_security_id: str = field(metadata={"citco": "Underlying Security Id"}) - attach: float - detach: float + attach: float = field(metadata={"citco": "Attachment_Points"}) + detach: float = field(metadata={"citco": "Detachment_Points"}) birth_date: datetime.date = field( init=False, metadata={"insert": False, "citco": "Birth_date"} ) @@ -1202,6 +1204,7 @@ class TrancheProduct( security_desc: str = field( init=False, metadata={"insert": False, "citco": "Sec_Desc"} ) + currency: str = field(init=False, default=None, metadata={"citco": "LocalCcy"}) instrument_type: str = field(default="CDS", metadata={"citco": "Instrument Type"}) underlying_id_source: str = field( default="RED", metadata={"citco": "Underlying ID Source"} @@ -1234,6 +1237,7 @@ class TrancheProduct( self.security_desc = ( f"{desc_str(index, series, '5')} {self.attach}-{self.detach}" ) + self.currency = "EUR" if index in ("XO", "EU") else "USD" def to_citco(self): if not self.id: @@ -1242,7 +1246,11 @@ class TrancheProduct( self.get_dealid() obj = self.serialize("citco") obj["Command"] = "N" + obj["Active"] = "Y" + obj["Birth_date"] = obj["Birth_date"].strftime("%Y%m%d") + obj["Death_date"] = obj["Death_date"].strftime("%Y%m%d") obj["Coupon Rate"] = obj["Coupon Rate"] / 100 + obj["SettleDays"] = 3 return obj |
