aboutsummaryrefslogtreecommitdiffstats
path: root/python
diff options
context:
space:
mode:
Diffstat (limited to 'python')
-rw-r--r--python/position_file_bowdst.py3
1 files changed, 2 insertions, 1 deletions
diff --git a/python/position_file_bowdst.py b/python/position_file_bowdst.py
index b440e59d..8d72afe5 100644
--- a/python/position_file_bowdst.py
+++ b/python/position_file_bowdst.py
@@ -9,7 +9,7 @@ from serenitas.utils.exchange import ExchangeMessage, FileAttachment
from csv_headers.globeop_upload import POSITION_HEADERS
_otc_queries = {
- "Tranche": "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_bowdst trb left join cds on trade_id=id WHERE date=%s",
+ "Tranche": "SELECT trb.trade_id, trb.serenitas_clean_nav + trb.serenitas_accrued as mtm, trb.notional * trb.tranche_factor as active_notional, cds.*, COALESCE(nextredindexcode, security_id) AS redindexcode FROM tranche_risk_bowdst trb left join cds on trade_id=id LEFT JOIN index_version_markit ivm ON security_id=redindexcode WHERE date=%s;",
"CDXSwaption": "SELECT abs(spr.notional) AS active_notional, spr.serenitas_nav as nav, swaptions.*, index_version_markit.annexdate FROM list_swaption_positions_and_risks(%s, 'BOWDST') spr LEFT JOIN swaptions ON deal_id=dealid LEFT JOIN index_version_markit ON swaptions.security_id=redindexcode;",
"IRSwaption": "SELECT abs(spr.notional) AS active_notional, spr.nav, swaptions.*, index_version_markit.effectivedate FROM list_ir_swaption_positions(%s, 'BOWDST') spr LEFT JOIN swaptions ON deal_id=dealid LEFT JOIN index_version_markit ON swaptions.security_id=redindexcode;",
"CDX": "SELECT cds.*, ivm.effectivedate FROM list_cds_marks(%s, null, 'BOWDST') cds LEFT JOIN index_version_markit ivm ON security_id=redindexcode;",
@@ -143,6 +143,7 @@ def _otc_serialize(obj, product_type, date):
}
obj.update(data)
if product_type == "Tranche":
+ obj["Underlying (ISIN / CUSP / RED CODES)"] = obj["redindexcode"]
obj["Product Type"] = "Credit Index Tranche"
obj["TransactionIndicator (Buy/Sell)"] = (
"B" if obj["protection"] == "Buyer" else "S"