diff options
Diffstat (limited to 'python/collateral/baml_isda.py')
| -rw-r--r-- | python/collateral/baml_isda.py | 23 |
1 files changed, 17 insertions, 6 deletions
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}") |
