aboutsummaryrefslogtreecommitdiffstats
path: root/python/report_ops/queries.py
diff options
context:
space:
mode:
Diffstat (limited to 'python/report_ops/queries.py')
-rw-r--r--python/report_ops/queries.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/python/report_ops/queries.py b/python/report_ops/queries.py
index e1ec9c9c..1c735fa8 100644
--- a/python/report_ops/queries.py
+++ b/python/report_ops/queries.py
@@ -6,11 +6,11 @@ FUTURE_QUERY = (
"SELECT bbg_ticker, notional, code AS cp_code, cash_account, security_desc, currency, maturity, account_code, dealid, buysell FROM tmp LEFT JOIN accounts USING (fund) WHERE tmp.notional != 0 AND account_type='Future';"
)
-TRANCHE_QUERY = "SELECT trb.trade_id, trb.serenitas_clean_nav + trb.serenitas_accrued as mtm, trb.notional * trb.tranche_factor as active_notional, cds.* FROM tranche_risk_master trb left join cds on trade_id=id WHERE date=%s AND trb.fund=%s;"
+TRANCHE_QUERY = "SELECT trb.trade_id, trb.serenitas_clean_nav + trb.serenitas_accrued as mtm, trb.notional * trb.tranche_factor as active_notional, cds.*, index_version.redindexcode as globeop_id FROM tranche_risk_master trb left join cds on trade_id=id LEFT JOIN index_version using (INDEX, series) WHERE date=%s AND trb.fund=%s AND lastdate= 'infinity';"
CDX_SWAPTION_QUERY = "SELECT abs(spr.notional) AS active_notional, spr.serenitas_nav, swaptions.*, index_version_markit.annexdate FROM list_swaption_positions_and_risks(%s, %s) spr LEFT JOIN swaptions ON deal_id=dealid LEFT JOIN index_version_markit ON swaptions.security_id=redindexcode;"
-IR_SWAPTION_QUERY = "SELECT abs(spr.notional) AS active_notional, spr.nav as serenitas_nav, swaptions.*, index_version_markit.effectivedate FROM list_ir_swaption_positions(%s, %s) spr LEFT JOIN swaptions ON deal_id=dealid LEFT JOIN index_version_markit ON swaptions.security_id=redindexcode;"
+IR_SWAPTION_QUERY = "SELECT abs(spr.notional) AS active_notional, spr.nav as serenitas_nav, swaptions.*, index_version_markit.effectivedate, swaptions.security_id as globeop_id FROM list_ir_swaption_positions(%s, %s) spr LEFT JOIN swaptions ON deal_id=dealid LEFT JOIN index_version_markit ON swaptions.security_id=redindexcode;"
CDX_QUERY = "SELECT cds.*, ivm.effectivedate FROM list_cds_marks(%s, null, %s) cds LEFT JOIN index_version_markit ivm ON security_id=redindexcode;"