aboutsummaryrefslogtreecommitdiffstats
path: root/python/collateral/common.py
diff options
context:
space:
mode:
Diffstat (limited to 'python/collateral/common.py')
-rw-r--r--python/collateral/common.py7
1 files changed, 6 insertions, 1 deletions
diff --git a/python/collateral/common.py b/python/collateral/common.py
index 1fd31d05..a210c5fb 100644
--- a/python/collateral/common.py
+++ b/python/collateral/common.py
@@ -92,7 +92,12 @@ def get_bilateral_trades(d: datetime.date, fund: str, engine: Engine) -> pd.Data
engine,
params=(d, fund, d),
)
- df = pd.concat([df_cds, df_swaptions, df_caps, df_forwards])
+ df_trs = pd.read_sql_query(
+ "SELECT cpty_id, folder, initial_margin_percentage * notional/100 as IA from trs where cpty_id is NOT NULL and trade_date <= %s and fund=%s",
+ engine,
+ params=(d, fund),
+ )
+ df = pd.concat([df_cds, df_swaptions, df_caps, df_forwards, df_trs])
df = df.replace({"folder": STRATEGY_CASH_MAPPING})
return df