aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--python/collateral/baml_isda.py10
1 files changed, 8 insertions, 2 deletions
diff --git a/python/collateral/baml_isda.py b/python/collateral/baml_isda.py
index 619ce309..ac8db16a 100644
--- a/python/collateral/baml_isda.py
+++ b/python/collateral/baml_isda.py
@@ -132,6 +132,7 @@ def load_excel(fname):
"Contract ID ": "Trade ID",
"Market Value Amount": "MTM(USD)",
"Trade Date ": "Trade Date",
+ "Cpty Independent Amount": "ia",
}
)
df["MTM(USD)"] *= -1.0
@@ -158,8 +159,13 @@ def collateral(d, dawn_trades, *args):
except StopIteration:
raise ValueError(f"no trade-level data for date {report_date}")
df = load_excel(fname)
- df = df[["Trade ID", "MTM(USD)"]]
- df = df.merge(dawn_trades, how="left", left_on="Trade ID", right_on="cpty_id")
+ df = df[["Trade ID", "MTM(USD)", "ia"]]
+ df = df.merge(
+ dawn_trades.drop("ia", axis=1),
+ how="left",
+ left_on="Trade ID",
+ right_on="cpty_id",
+ )
missing_ids = df.loc[df.cpty_id.isnull(), "Trade ID"]
if not missing_ids.empty:
raise ValueError(f"{missing_ids.tolist()} not in the database")