aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--python/risk/tranches.py8
1 files changed, 4 insertions, 4 deletions
diff --git a/python/risk/tranches.py b/python/risk/tranches.py
index 3afc7e70..22c675c4 100644
--- a/python/risk/tranches.py
+++ b/python/risk/tranches.py
@@ -35,7 +35,7 @@ def get_tranche_portfolio(date, conn, by_strat=False, fund="SERCGMAST"):
portf.mark()
return portf
-def insert_tranche_marks(portf, conn):
+def insert_tranche_risk(portf, conn):
cols = ["clean_nav", "accrued", "theta", "duration", "delta",
"upfront", "running", "index_refprice", "index_refspread",
"index_duration"]
@@ -46,10 +46,10 @@ def insert_tranche_marks(portf, conn):
with conn.cursor() as c:
for trade_id, trade in portf.items():
c.execute(sql_str, (trade.value_date,
- trade_id,
+ trade_id[1],
trade.clean_pv,
-trade._accrued * trade.notional,
- None,
+ trade.theta(),
trade.duration,
trade.delta,
trade.upfront,
@@ -57,7 +57,7 @@ def insert_tranche_marks(portf, conn):
100 - float(trade._index.pv()) * 100,
trade._index._snacspread(trade._index.coupon(),
trade._index.recovery,
- trade._index.maturities[0]) * 10000,
+ trade.maturity) * 10000,
float(trade._index.duration()))
)
conn.commit()