aboutsummaryrefslogtreecommitdiffstats
path: root/python/trade_dataclasses.py
diff options
context:
space:
mode:
Diffstat (limited to 'python/trade_dataclasses.py')
-rw-r--r--python/trade_dataclasses.py23
1 files changed, 10 insertions, 13 deletions
diff --git a/python/trade_dataclasses.py b/python/trade_dataclasses.py
index d02b3914..a86a4c76 100644
--- a/python/trade_dataclasses.py
+++ b/python/trade_dataclasses.py
@@ -898,21 +898,18 @@ class SwaptionDeal(
obj["SettleCurrency"] = obj["SecurityCurrency"]
obj["IDSource"] = "USERID"
obj["ClearingAgent"] = obj["ExecutionBroker"]
- redcode = (
- obj["security_id"]
- + "_"
- + obj["SecurityDescription"].split()[4].removesuffix("Y")
- )
- instrument = SwaptionProduct(
- underlying_security_id=redcode,
+ obj["SecurityID"] = self.product.dealid
+ return obj
+
+ @property
+ def product(self):
+ return SwaptionProduct(
+ underlying_security_id=self.redcode,
instrument_type="BNDO",
- callput=obj["option_type"] == "RECEIVER",
- strike=obj["strike"],
- expiration=obj["expiration_date"],
+ callput=self.option_type == "RECEIVER",
+ strike=self.strike,
+ expiration=self.expiration_date,
)
- instrument.citco_stage()
- obj["SecurityID"] = instrument.dealid
- return obj
@dataclass