diff options
Diffstat (limited to 'python/trade_dataclasses.py')
| -rw-r--r-- | python/trade_dataclasses.py | 19 |
1 files changed, 13 insertions, 6 deletions
diff --git a/python/trade_dataclasses.py b/python/trade_dataclasses.py index f99dad2e..43d92da3 100644 --- a/python/trade_dataclasses.py +++ b/python/trade_dataclasses.py @@ -30,10 +30,7 @@ Portfolio = Literal[ "OPTIONS", "IR", "MORTGAGES", "CURVE", "TRANCHE", "CLO", "HEDGE_MAC" ] # deprecated IG, HY, STRUCTURED -_funds = { - "SERENITAS_CGMF": "SERCGMAST", - "BOWDOINST": "BOWDST", -} +_funds = {"BAML": "SERCGMAST", "GS": "BOWDST", "WF": "SERCGMAST"} _fcms = { "Bank of America, N.A.": "BAML", "Goldman Sachs": "GS", @@ -501,6 +498,8 @@ class CDSDeal( @classmethod def from_bbg_line(cls, line: dict): + if "SEQ#" in line and line["Brkr"] != "BSEF": + raise ValueError("Ignoring file, we have an allocation file") if line["Coupon"] == "": with cls._conn.cursor() as c: c.execute( @@ -514,10 +513,18 @@ class CDSDeal( coupon, index, series, tenor = c.fetchone() line["Security"] = desc_str(index, series, tenor.removesuffix("yr")) line["Coupon"] = coupon + if line["Brkr"] == "BSEF": # BSEF means CDX BLOCK + line["Price (Dec)"] = line["Price"] + line["Quantity"] = line["Qty (M)"] * 1000 + values = [line["bbg_ticket_id"]] + [None] * 21 + values[14] = _funds[_fcms[line["Client FCM"]]] + values[15] = _fcms[line["Client FCM"]] + else: + values = line.values() cp_code = cls.get_cp_code(line["Brkr"], "CDS") - cls._bbg_insert_queue.append(list(line.values())) + cls._bbg_insert_queue.append(list(values)) return cls( - fund=_funds[line["Account"]], + fund=_funds[_fcms[line["Client FCM"]]], folder="*", portfolio="UNALLOCATED", security_id=line["Red Code"], |
