diff options
Diffstat (limited to 'python/risk')
| -rw-r--r-- | python/risk/tranches.py | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/python/risk/tranches.py b/python/risk/tranches.py index 8c41b523..c6b41c3e 100644 --- a/python/risk/tranches.py +++ b/python/risk/tranches.py @@ -10,13 +10,10 @@ def get_tranche_portfolio(date, conn, by_strat=False, fund="SERCGMAST"): params = (date, fund) else: 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 trade_date <= %s " - "AND fund = %s ORDER BY trade_date" + "SELECT folder, id from list_cds(%s, %s) " + "WHERE orig_attach IS NOT NULL ORDER BY trade_date" ) - params = (date, date, date, fund) + params = (date, fund) with conn.cursor() as c: c.execute(sql_string, params) trade_ids = [tuple(e) for e in c] |
