aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--python/book_bbg.py2
-rw-r--r--python/trade_dataclasses.py17
2 files changed, 12 insertions, 7 deletions
diff --git a/python/book_bbg.py b/python/book_bbg.py
index 0de463d1..786631ed 100644
--- a/python/book_bbg.py
+++ b/python/book_bbg.py
@@ -10,7 +10,7 @@ logger = logging.getLogger(__name__)
def get_bbg_id(s):
- if m := re.match("(CDX|BOND)-[^_]*_([^$]*)", s):
+ if m := re.match("(CDX|BOND)(?:BLOCK)-[^_]*_([^$]*)", s):
return m.groups()
if "DEAL" in s:
return "FX", s.split("_")[3]
diff --git a/python/trade_dataclasses.py b/python/trade_dataclasses.py
index be3bef07..1baff39d 100644
--- a/python/trade_dataclasses.py
+++ b/python/trade_dataclasses.py
@@ -28,10 +28,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",
@@ -432,10 +429,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 = [list(line.values())[0]] + [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"],