diff options
Diffstat (limited to 'python/globeop_monitor.py')
| -rw-r--r-- | python/globeop_monitor.py | 23 |
1 files changed, 22 insertions, 1 deletions
diff --git a/python/globeop_monitor.py b/python/globeop_monitor.py index 9fc64960..12faddd9 100644 --- a/python/globeop_monitor.py +++ b/python/globeop_monitor.py @@ -7,7 +7,12 @@ from serenitas.utils.db import dbconn from serenitas.ops.trade_dataclasses import WireDeal from serenitas.ops.funds import Service -from report_ops.utils import GFSMonitor, check_cleared_cds, BondMarkMonitor +from report_ops.utils import ( + GFSMonitor, + StratMonitor, + check_cleared_cds, + BondMarkMonitor, +) from collateral.common import CASH_STRATEGY_MAPPING, STRATEGY_CASH_MAPPING @@ -26,6 +31,21 @@ def check_gfs(date, fund, conn): GFSMonitor._staging_queue.clear() +def check_random_strat(date, fund, conn): + with conn.cursor() as c: + c.execute( + "SELECT gfstranid1, invdesc, knowledgedate, periodenddate, port, strat FROM valuation_reports vr WHERE fund=%s AND periodenddate=%s AND port='SERCGMAST';", + ( + fund, + date, + ), + ) + for row in c: + StratMonitor.stage(row._asdict()) + StratMonitor.email(fund) + StratMonitor._staging_queue.clear() + + def reallocate_strategy_cash(date, fund, conn): service = Service[fund] with conn.cursor() as c: @@ -100,5 +120,6 @@ if __name__ == "__main__": match fund: case "SERCGMAST": check_manager_marks(args.cob, "SERCGMAST", conn) + check_random_strat(args.cob, "SERCGMAST", conn) case "BOWDST": reallocate_strategy_cash(args.cob, "BOWDST", conn) |
