diff options
Diffstat (limited to 'python/lmcg_monitor.py')
| -rw-r--r-- | python/lmcg_monitor.py | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/python/lmcg_monitor.py b/python/lmcg_monitor.py index ea39ebb3..5f8230cd 100644 --- a/python/lmcg_monitor.py +++ b/python/lmcg_monitor.py @@ -3,6 +3,7 @@ import argparse from serenitas.analytics.dates import prev_business_day from serenitas.utils.db import dbconn from serenitas.utils.exchange import ExchangeMessage +from report_ops.utils import CDXNotionalMonitor def monitor_scotia(date, conn): @@ -19,6 +20,20 @@ def monitor_scotia(date, conn): ) +def monitor_cds_notional(fund, date, conn): + with conn.cursor() as c: + c.execute( + "SELECT *, notional as serenitas_notional, globeop_notional / factor as admin_notional FROM list_cds_marks(%s, NULL, %s) WHERE abs((notional * factor) - globeop_notional) > 100;", + (date, fund), + ) + for row in c: + d = row._asdict() + d["difference"] = d["serenitas_notional"] - d["globeop_notional"] + CDXNotionalMonitor.stage(d) + CDXNotionalMonitor.email(fund) + CDXNotionalMonitor._staging_queue.clear() + + if __name__ == "__main__": parser = argparse.ArgumentParser() parser.add_argument( @@ -31,3 +46,5 @@ if __name__ == "__main__": args = parser.parse_args() conn = dbconn("dawndb") monitor_scotia(args.cob, conn) + for fund in ("SERCGMAST", "BOWDST", "ISOSEL"): + monitor_cds_notional(fund, args.cob, conn) |
