aboutsummaryrefslogtreecommitdiffstats
path: root/python/risk/tranches.py
diff options
context:
space:
mode:
Diffstat (limited to 'python/risk/tranches.py')
-rw-r--r--python/risk/tranches.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/python/risk/tranches.py b/python/risk/tranches.py
index ae22a735..4647ce0c 100644
--- a/python/risk/tranches.py
+++ b/python/risk/tranches.py
@@ -59,7 +59,7 @@ def insert_tranche_pnl_explain(portf, conn):
prev_day_risk = {rec.tranche_id: rec for rec in c}
c.execute(
"SELECT cds.id, cds.upfront, cds_delta.upfront AS delta_upfront, "
- "cds_delta.notional * (CASE WHEN cds_delta.protection='Buyer' THEN -1.0 ELSE 1.0 END) AS notional, "
+ "cds_delta.notional * (CASE WHEN cds_delta.protection='Buy' THEN -1.0 ELSE 1.0 END) AS notional, "
"cds.currency::text FROM cds "
" LEFT JOIN cds AS cds_delta ON cds_delta.id=cds.delta_id "
"WHERE cds.trade_date=%s",
@@ -68,7 +68,7 @@ def insert_tranche_pnl_explain(portf, conn):
daily_trades = {rec.id: rec for rec in c}
c.execute(
"SELECT terminations.dealid, termination_amount, termination_fee, terminations.currency::text, "
- "cds.notional * delta_alloc * (CASE WHEN cds.protection='Buyer' THEN -1.0 ELSE 1.0 END) AS notional, "
+ "cds.notional * delta_alloc * (CASE WHEN cds.protection='Buy' THEN -1.0 ELSE 1.0 END) AS notional, "
"cds.upfront * delta_alloc AS delta_upfront "
"FROM terminations LEFT JOIN cds ON cds.id=terminations.delta_id "
"WHERE deal_type='CDS' AND termination_date=%s",