aboutsummaryrefslogtreecommitdiffstats
path: root/python
diff options
context:
space:
mode:
Diffstat (limited to 'python')
-rw-r--r--python/collateral/__main__.py2
-rw-r--r--python/collateral/baml_isda.py23
2 files changed, 18 insertions, 7 deletions
diff --git a/python/collateral/__main__.py b/python/collateral/__main__.py
index bd55f673..ade60c21 100644
--- a/python/collateral/__main__.py
+++ b/python/collateral/__main__.py
@@ -47,7 +47,7 @@ cp_dict = {
"isda_cps": ("citi", "baml_isda", "ms", "gs", "bnp", "cs"),
},
"Brinker": {"fcms": (), "isda_cps": ("ms", "gs")},
- "BowdSt": {"fcms": (), "isda_cps": ("ms", "bnp", "gs")},
+ "BowdSt": {"fcms": (), "isda_cps": ("ms", "bnp", "gs", "baml_isda")},
}
diff --git a/python/collateral/baml_isda.py b/python/collateral/baml_isda.py
index 92727236..1ef6023e 100644
--- a/python/collateral/baml_isda.py
+++ b/python/collateral/baml_isda.py
@@ -56,9 +56,17 @@ def download_from_secure_id(
z.extract(f, path=path)
-def download_files(em, d=None, count=20, **kwargs):
- DATA_DIR = DAILY_DIR / "BAML_ISDA_reports"
- emails = em.get_msgs(path=["NYops", "Margin Calls Baml"], count=count)
+paths = {
+ "Serenitas": ["NYops", "Margin Calls Baml"],
+ "BowdSt": ["BowdoinOps", "Margin BoA"],
+}
+
+
+def download_files(em, d=None, count=20, *, fund="Serenitas", **kwargs):
+ DATA_DIR = DAILY_DIR / fund / "BoA_reports"
+ if fund not in paths:
+ return
+ emails = em.get_msgs(path=paths[fund], count=count)
for msg in emails:
if (
msg.sender.name == "us_otc_client_valuation@baml.com"
@@ -136,9 +144,11 @@ def load_excel(fname):
return df
-def collateral(d, dawn_trades, **kwargs):
+def collateral(d, dawn_trades, *, fund="Serenitas", **kwargs):
+ if fund == "BowdSt":
+ breakpoint()
report_date = d + BDay()
- REPORTS_DIR = DAILY_DIR / "BAML_ISDA_reports"
+ REPORTS_DIR = DAILY_DIR / fund / "BoA_reports"
try:
fname = next(REPORTS_DIR.glob(f"Collat_*{report_date:%m%d%Y}_*.xls"))
except StopIteration:
@@ -150,8 +160,9 @@ def collateral(d, dawn_trades, **kwargs):
except TypeError:
collateral = df.Notional.sum()
try:
+ tag = "SLP" if fund == "Serenitas" else "LLC"
fname = next(
- REPORTS_DIR.glob(f"301__LMCG_INVESTMENTSLP_CSA_{report_date:%m%d%Y}_*")
+ REPORTS_DIR.glob(f"301__LMCG_INVESTMENT{tag}_CSA_{report_date:%m%d%Y}_*")
)
except StopIteration:
raise ValueError(f"no trade-level data for date {report_date}")