aboutsummaryrefslogtreecommitdiffstats
path: root/python/collateral/baml_isda.py
diff options
context:
space:
mode:
Diffstat (limited to 'python/collateral/baml_isda.py')
-rw-r--r--python/collateral/baml_isda.py25
1 files changed, 17 insertions, 8 deletions
diff --git a/python/collateral/baml_isda.py b/python/collateral/baml_isda.py
index 685c0a12..c87f8ea1 100644
--- a/python/collateral/baml_isda.py
+++ b/python/collateral/baml_isda.py
@@ -61,6 +61,7 @@ def download_from_secure_id(
paths = {
"Serenitas": ["NYops", "Margin Calls Baml"],
"BowdSt": ["BowdoinOps", "Margin BoA"],
+ "Selene": ["SeleneOps", "Margin BoA"],
}
@@ -176,16 +177,24 @@ def collateral(d, dawn_trades, *, fund="Serenitas", **kwargs):
raise ValueError(f"no collateral data for date {report_date}")
df = pd.read_excel(fname, skiprows=6, skipfooter=6)
if df.empty:
- raise ValueError("empty collateral file")
- df = df.drop(0, axis=0)
+ collateral = 0
+ logger.warning("empty collateral file")
+ else:
+ df = df.drop(0, axis=0)
+ try:
+ collateral = float(df.Notional)
+ except TypeError:
+ collateral = df.Notional.sum()
try:
- collateral = float(df.Notional)
- except TypeError:
- collateral = df.Notional.sum()
- try:
- tag = "SLP" if fund == "Serenitas" else "LLC"
+ match fund:
+ case "Serenitas":
+ tag = "TSLP"
+ case "Bowdst":
+ tag = "TLLC"
+ case "Selene":
+ tag = "INC"
fname = next(
- REPORTS_DIR.glob(f"301__LMCG_INVESTMENT{tag}_CSA_{report_date:%m%d%Y}_*")
+ REPORTS_DIR.glob(f"301__LMCG_INVESTMEN{tag}_CSA_{report_date:%m%d%Y}_*")
)
except StopIteration:
raise ValueError(f"no trade-level data for date {report_date}")