aboutsummaryrefslogtreecommitdiffstats
path: root/python
diff options
context:
space:
mode:
Diffstat (limited to 'python')
-rw-r--r--python/trade_dataclasses.py22
1 files changed, 11 insertions, 11 deletions
diff --git a/python/trade_dataclasses.py b/python/trade_dataclasses.py
index a2a225be..37671553 100644
--- a/python/trade_dataclasses.py
+++ b/python/trade_dataclasses.py
@@ -490,7 +490,7 @@ class CitcoProduct(Citco):
(self.id, self.dealid, self.committed) = results
@classmethod
- def _base_attrs(cls, obj):
+ def to_citco(cls, obj):
obj["Birth_date"] = obj["Birth_date"].strftime("%Y%m%d")
obj["Death_date"] = obj["Death_date"].strftime("%Y%m%d")
return obj
@@ -501,7 +501,7 @@ class CitcoTrade(Citco):
_citco_headers = GTL
@classmethod
- def _base_attrs(cls, obj):
+ def to_citco(cls, obj):
obj["FillID"] = obj["ClientOrderID"]
obj["Trader"] = "DFLT"
obj["StrategyCode"] = f"{obj['portfolio']}/{obj['folder']}"
@@ -626,7 +626,7 @@ class CDSDeal(
obj[
"ClearingAgent"
] = "BOA_FC" # We need to query DB via accounts table here
- obj = self._base_attrs(obj)
+ obj = super().to_citco(obj)
return obj
@classmethod
@@ -775,7 +775,7 @@ class BondDeal(
(obj["SecurityID"],),
)
obj["Coupon%"], obj["DayCountFraction/RepoCalendar"] = c.fetchone()
- obj = self._base_attrs(obj)
+ obj = super().to_citco(obj)
return obj
@@ -873,7 +873,7 @@ class SwaptionDeal(
)
instrument.citco_stage()
obj["SecurityID"] = instrument.dealid
- obj = self._base_attrs(obj)
+ obj = super().to_citco(obj)
return obj
@@ -1075,7 +1075,7 @@ class SpotDeal(
obj["FillFXSettleAmount"] = obj[f"{key2}_amount"]
obj["SettleCurrency"] = "USD"
obj["FXRate"] = 1
- obj = self._base_attrs(obj)
+ obj = super().to_citco(obj)
return obj
@@ -1202,7 +1202,7 @@ class FxSwapDeal(
obj["ClientOrderID"] = obj["ClientOrderID"] + "_F"
obj["SettleCurrency"] = "USD"
obj["FXRate"] = 1
- obj = self._base_attrs(obj)
+ obj = super().to_citco(obj)
return obj
@@ -1489,7 +1489,7 @@ class IRSDeal(
product.citco_stage()
obj["SecurityID"] = product.dealid
obj["ClearingAgent"] = "BOA_FC"
- obj = self._base_attrs(obj)
+ obj = super().to_citco(obj)
return obj
@@ -1571,7 +1571,7 @@ class TrancheProduct(
obj["CouponRate"] = obj["CouponRate"] / 100
obj["SettleDays"] = 3
obj["AccruStartDate"] = obj["Birth_date"]
- obj = self._base_attrs(obj)
+ obj = super().to_citco(obj)
return obj
@@ -1657,7 +1657,7 @@ class SwaptionProduct(
obj["ExpirationDate"] = obj["ExpirationDate"].strftime("%Y%m%d")
obj["Put/CallFlag"] = "C" if obj["callput"] else "P"
obj["OptionType"] = "Vanilla European"
- obj = self._base_attrs(obj)
+ obj = super().to_citco(obj)
return obj
@@ -1827,5 +1827,5 @@ class TRSProduct(
obj["GeneralDirection"] = "F"
obj["PrincipalExchTypeID"] = 3
obj["UnderlyingIDSource"] = "RED"
- obj = self._base_attrs(obj)
+ obj = super().to_citco(obj)
return obj