diff options
Diffstat (limited to 'python')
| -rw-r--r-- | python/risk/tranches.py | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/python/risk/tranches.py b/python/risk/tranches.py index 15cee9b1..97b8cb09 100644 --- a/python/risk/tranches.py +++ b/python/risk/tranches.py @@ -8,7 +8,7 @@ def get_tranche_portfolio(date, conn, by_strat=False, fund="SERCGMAST"): sql_string = "SELECT * from list_tranche_positions_by_strat(%s, %s)" params = (date, fund) else: - sql_string = ("SELECT id from cds " + sql_string = ("SELECT folder, id from cds " "WHERE orig_attach IS NOT NULL " "AND (termination_date IS NULL OR termination_date > %s) " "AND maturity > %s AND fund = %s ORDER BY trade_date") @@ -18,7 +18,7 @@ def get_tranche_portfolio(date, conn, by_strat=False, fund="SERCGMAST"): if by_strat: trade_ids = list(c) else: - trade_ids = [dealid for dealid, in c] + trade_ids = [(folder, dealid) for folder, dealid in c] if by_strat: portf = Portfolio([DualCorrTranche(redcode=d['security_id'], maturity=d['maturity'], @@ -32,7 +32,7 @@ def get_tranche_portfolio(date, conn, by_strat=False, fund="SERCGMAST"): f"{t.index_type} {t.series} {t.tenor} {t.attach}-{t.detach}") for d, t in zip(trade_ids, portf.trades)] else: - portf = Portfolio([DualCorrTranche.from_tradeid(dealid) for dealid in trade_ids], + portf = Portfolio([DualCorrTranche.from_tradeid(dealid) for (_, dealid) in trade_ids], trade_ids) portf.value_date = date portf.mark() |
