aboutsummaryrefslogtreecommitdiffstats
path: root/python/risk
diff options
context:
space:
mode:
Diffstat (limited to 'python/risk')
-rw-r--r--python/risk/tranches.py6
1 files changed, 5 insertions, 1 deletions
diff --git a/python/risk/tranches.py b/python/risk/tranches.py
index edd83f50..7f1169fd 100644
--- a/python/risk/tranches.py
+++ b/python/risk/tranches.py
@@ -8,7 +8,11 @@ def get_tranche_portfolio(date, conn, by_strat=False, fund="SERCGMAST", **kwargs
if by_strat:
sql_string = "SELECT * from list_tranche_positions_by_strat(%s, %s)"
else:
- sql_string = "SELECT * FROM list_cds(%s, %s) WHERE orig_attach IS NOT NULL "
+ sql_string = (
+ "SELECT * FROM list_cds(%s, %s) "
+ "WHERE orig_attach IS NOT NULL "
+ "ORDER BY security_desc, attach"
+ )
with conn.cursor() as c:
c.execute(sql_string, (date, fund))