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.py9
1 files changed, 5 insertions, 4 deletions
diff --git a/python/trade_dataclasses.py b/python/trade_dataclasses.py
index 664b3e80..23ccc385 100644
--- a/python/trade_dataclasses.py
+++ b/python/trade_dataclasses.py
@@ -1216,7 +1216,7 @@ class TRSDeal(
obj["Trader"] = "serenitas_trader"
obj["StrategyCode"] = f"{obj['portfolio']}/{obj['folder']}"
obj["FillPrice"] = obj["AvgPrice"]
- obj["BuySellShortCover"] = "B" if obj["payreceive"] == "Buy" else "S"
+ obj["BuySellShortCover"] = "B" if obj["buysell"] else "S"
obj["FillQty"] = obj["OrderQty"]
obj["SettleCurrency"] = obj["SecurityCurrency"]
obj["IDSource"] = "USERID"
@@ -1236,6 +1236,7 @@ class TRSDeal(
@dataclass
class IRSDeal(
+ CitcoTrade,
Deal,
deal_type=DealType.IRS,
table_name="irs",
@@ -1271,7 +1272,7 @@ class IRSDeal(
clearing_facility: str = field(metadata={"globeop": "ClearingFacility"})
swap_type: str = field(metadata={"globeop": "SwapType"})
cleared_trade_id: str
- currency: str
+ currency: str = field(metadata={"citco": "SecurityCurrency"})
custodian: int = field(
default=None, metadata={"insert": False, "globeop": "Custodian"}, init=False
)
@@ -1337,7 +1338,7 @@ class IRSDeal(
obj["Trader"] = "serenitas_trader"
obj["StrategyCode"] = f"{obj['portfolio']}/{obj['folder']}"
obj["FillPrice"] = obj["AvgPrice"]
- obj["BuySellShortCover"] = "B" if obj["payreceive"] == "Buy" else "S"
+ obj["BuySellShortCover"] = "B" if obj["payreceive"] else "S"
obj["FillQty"] = obj["OrderQty"]
obj["SettleCurrency"] = obj["SecurityCurrency"]
obj["IDSource"] = "USERID"
@@ -1608,7 +1609,7 @@ class TRSProduct(
deal_type=DealType.TRSProduct,
table_name="citco_trs",
product_key=("birth_date", "death_date", "funding_index", "underlying_security"),
- insert_ignore=("id", "dealid"),
+ insert_ignore=("id", "dealid", "security_desc"),
):
birth_date: datetime.date = field(metadata={"citco": "Birth_date"})
death_date: datetime.date = field(metadata={"citco": "Death_date"})