aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--python/trade_dataclasses.py15
1 files changed, 6 insertions, 9 deletions
diff --git a/python/trade_dataclasses.py b/python/trade_dataclasses.py
index 9683930e..46ee4007 100644
--- a/python/trade_dataclasses.py
+++ b/python/trade_dataclasses.py
@@ -512,6 +512,8 @@ class CitcoTrade(Citco):
)
obj["FillQty"] = obj.get("OrderQty")
obj["FillPrice"] = obj.get("AvgPrice")
+ obj["FXRate"] = 1
+ obj["SettleCurrency"] = obj.get("SecurityCurrency")
return obj
@@ -611,7 +613,6 @@ class CDSDeal(
def to_citco(self):
obj = super().to_citco()
obj["SecurityType"] = "CDS"
- obj["SettleCurrency"] = obj["SecurityCurrency"]
obj["AvgPrice"] = (
obj["OrderQty"] / obj["upfront"] / obj["factor"] / 100
) # Citco looks at factor as 1/100
@@ -788,8 +789,7 @@ class BondDeal(
obj["SecurityType"] = "CMO"
obj["ClearingAgent"] = "NT"
obj["FXRate"] = 1
- obj["CurrencyTraded"] = "USD"
- obj["SettleCurrency"] = obj["CurrencyTraded"]
+ obj["SettleCurrency"] = "USD"
obj["BuySellShortCover"] = "B" if obj["buysell"] else "S"
obj["IDSource"] = "CUSIP"
with self._conn.cursor() as c:
@@ -1087,6 +1087,7 @@ class SpotDeal(
key1, key2 = "buy", "sell"
obj["SecurityCurrency"] = obj[f"{key1}_currency"]
obj["OrderQty"] = obj[f"{key1}_amount"]
+ obj["FillQty"] = obj["OrderQty"]
obj["SecurityType"] = "FX"
obj["BuySellShortCover"] = "S" if obj["buy_currency"] == "USD" else "B"
obj["IDSource"] = "BLOOMBERG"
@@ -1261,7 +1262,7 @@ class TRSDeal(
buysell: bool
underlying_security: str
price: float = field(metadata={"mtm": "Initial Fixing Amount", "citco": "AvgPrice"})
- accrued: float = field(metadata={"mtm": "Initial Payment"})
+ accrued: float = field(metadata={"mtm": "Initial Payment", "citco": "Fee"})
funding_freq: str
funding_daycount: str
funding_payment_roll_convention: str
@@ -1316,11 +1317,6 @@ class TRSDeal(
obj["2nd Leg Index"] = _mtm_index[obj["funding_index"]]
obj["2nd Leg Spread"] = 0
obj["2nd Leg Initial Floating Rate"] = 0
- # obj["2nd Leg Initial Floating Rate"] = obj["Initial Payment"] / (
- # (obj["Effective Date"] - previous_twentieth(obj["Effective Date"])).days
- # * obj["1st Leg Notional"]
- # / 360
- # )
return obj
def to_globeop(self):
@@ -1374,6 +1370,7 @@ class TRSDeal(
obj["BuySellShortCover"] = "B" if obj["buysell"] else "S"
obj["SettleCurrency"] = obj["SecurityCurrency"]
obj["IDSource"] = "USERID"
+ obj["Fee"] = -obj["Fee"] if obj["buysell"] else obj["Fee"]
product = TRSProduct(
birth_date=self.trade_date,
death_date=self.maturity_date,