aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--python/analytics/tranche_basket.py5
1 files changed, 3 insertions, 2 deletions
diff --git a/python/analytics/tranche_basket.py b/python/analytics/tranche_basket.py
index 9640dc81..adcd186f 100644
--- a/python/analytics/tranche_basket.py
+++ b/python/analytics/tranche_basket.py
@@ -603,8 +603,8 @@ class DualCorrTranche:
col_ref = "close_price" if self.index_type == "HY" else "close_spread"
sql_query = (
f"SELECT {col_ref} from index_quotes_pre "
- "WHERE date=%s and index=%s and series=%s and "
- "tenor=%s and source=%s"
+ "WHERE date <=%s and index=%s and series=%s and "
+ "tenor=%s and version=%s and source=%s ORDER BY date DESC LIMIT 1"
)
conn = serenitas_pool.getconn()
with conn.cursor() as c:
@@ -615,6 +615,7 @@ class DualCorrTranche:
self.index_type,
self.series,
self.tenor,
+ self._index.version,
kwargs.get("source", "MKIT"),
),
)