diff options
Diffstat (limited to 'python')
| -rw-r--r-- | python/report_ops/utils.py | 17 |
1 files changed, 14 insertions, 3 deletions
diff --git a/python/report_ops/utils.py b/python/report_ops/utils.py index 035b2e13..54f25526 100644 --- a/python/report_ops/utils.py +++ b/python/report_ops/utils.py @@ -102,13 +102,24 @@ def check_cleared_cds(date, fund, conn): _tolerance = {"IG": 0.10, "HY": 0.20, "EU": 0.20, "XO": 0.30} with conn.cursor() as c: c.execute( - "SELECT *, abs(price-globeop_price) AS difference FROM list_cds_marks(%s, NULL, %s) WHERE abs((notional * factor) - globeop_notional) < 100;", - (date, fund), + "SELECT * FROM list_cds_marks(%s, NULL, %s), fx WHERE date=%s AND abs((notional*factor) - globeop_nav) < 100;", + (date, fund, date), ) for row in c: d = row._asdict() d["serenitas_quote"] = d["price"] - d["admin_quote"] = d["globeop_price"] + match d["index"]: + case "XO" | "EU": + d["admin_quote"] = 100 - ( + ((d["globeop_nav"] - d["accrued"]) / d["eurusd"]) + / (d["globeop_notional"] / 100) + ) + case _: + d["admin_quote"] = 100 - ( + (d["globeop_nav"] - d["accrued"]) + / (d["globeop_notional"] / 100) + ) + d["difference"] = abs(d["price"] - d["admin_quote"]) if d["difference"] > _tolerance[d["index"]]: CDXQuoteMonitor.stage(d) CDXQuoteMonitor.email(fund) |
