aboutsummaryrefslogtreecommitdiffstats
path: root/python
diff options
context:
space:
mode:
Diffstat (limited to 'python')
-rw-r--r--python/trade_dataclasses.py17
1 files changed, 8 insertions, 9 deletions
diff --git a/python/trade_dataclasses.py b/python/trade_dataclasses.py
index 8192048c..8427f7e5 100644
--- a/python/trade_dataclasses.py
+++ b/python/trade_dataclasses.py
@@ -690,6 +690,7 @@ class BondDeal(BbgDeal, Deal, deal_type=DealType.Bond, table_name="bonds"):
@dataclass
class SwaptionDeal(
+ CitcoTrade,
MTMDeal,
Deal,
deal_type=DealType.Swaption,
@@ -905,6 +906,7 @@ class TerminationDeal(
@dataclass
class SpotDeal(
+ CitcoTrade,
BbgDeal,
Deal,
deal_type=DealType.Spot,
@@ -1071,6 +1073,7 @@ class FxSwapDeal(
@dataclass
class TRSDeal(
+ CitcoTrade,
MTMDeal,
Deal,
deal_type=DealType.TRS,
@@ -1407,7 +1410,7 @@ class SwaptionProduct(
def __post_init__(self):
self.get_productid()
- if self.underlying_id_source == "RED":
+ if self.underlying_id_source == "BNDO":
sql_str = "SELECT issue_date, maturity, coupon, index, series FROM index_desc WHERE tenor='5yr' AND redindexcode=%s"
with self._conn.cursor() as c:
c.execute(sql_str, (self.underlying_security_id.removesuffix("_5"),))
@@ -1418,14 +1421,10 @@ class SwaptionProduct(
index,
series,
) = c.fetchone()
- self.security_desc = (
- f"{desc_str(index, series, '5')} {self.expiration}-{self.strike}"
- )
+ self.security_desc = f"{desc_str(index, series, '5')} {self.expiration}-{self.strike}-{'C' if self.callput else 'P'}-{self.birth_date}-{self.death_date}"
self.currency = "EUR" if index in ("XO", "EU") else "USD"
- self.instrument_type = "BNDO"
- else:
+ elif self.underlying_id_source == "SWPO":
self.security_desc = ""
- self.instrument_type = "SWPO"
def to_citco(self):
if not self.id:
@@ -1493,7 +1492,7 @@ class IRSProduct(
def __post_init__(self):
self.get_productid()
- self.security_desc = f"SWAP IRS {self.float_index}-{self.fixed_rate}"
+ self.security_desc = f"SWAP IRS {self.float_index}-{self.fixed_rate}-{self.birth_date}-{self.death_date}"
def to_citco(self):
if not self.id:
@@ -1565,7 +1564,7 @@ class TRSProduct(
def __post_init__(self):
self.get_productid()
_citco_trs = {"4J623JAA8": "IBOXHY_TRS"}
- self.security_desc = _citco_trs[self.underlying_security]
+ self.security_desc = f"{_citco_trs[self.underlying_security]}-{self.funding_index}-{self.birth_date}-{self.death_date}"
def to_citco(self):
if not self.id: