aboutsummaryrefslogtreecommitdiffstats
path: root/python
diff options
context:
space:
mode:
Diffstat (limited to 'python')
-rw-r--r--python/risk/tranches.py6
1 files changed, 4 insertions, 2 deletions
diff --git a/python/risk/tranches.py b/python/risk/tranches.py
index f468108f..5f7edb39 100644
--- a/python/risk/tranches.py
+++ b/python/risk/tranches.py
@@ -38,11 +38,12 @@ def get_tranche_portfolio(date, conn, by_strat=False, fund="SERCGMAST"):
def insert_tranche_portfolio(portf, conn):
cols = ["clean_nav", "accrued", "duration", "delta", "gamma",
- "theta", "upfront", "running", "corr_attach", "corr_detach",
+ "theta", "tranche_factor", "upfront", "running",
+ "corr_attach", "corr_detach",
"index_refprice", "index_refspread",
"index_duration"]
update_str = ",".join(f"{c} = EXCLUDED.{c}" for c in cols)
- sql_str = (f"INSERT INTO tranche_risk VALUES({','.join(['%s'] * 15)}) "
+ sql_str = (f"INSERT INTO tranche_risk VALUES({','.join(['%s'] * 16)}) "
" ON CONFLICT (date, tranche_id) DO UPDATE "
f"SET {update_str}")
with conn.cursor() as c:
@@ -60,6 +61,7 @@ def insert_tranche_portfolio(portf, conn):
trade.delta,
trade.gamma,
theta,
+ trade.tranche_factor,
trade.upfront,
trade.tranche_running,
trade.rho[0],