diff options
Diffstat (limited to 'python')
| -rw-r--r-- | python/report_ops/misc.py | 3 | ||||
| -rw-r--r-- | python/report_ops/sma.py | 28 | ||||
| -rw-r--r-- | python/report_ops/utils.py | 46 |
3 files changed, 74 insertions, 3 deletions
diff --git a/python/report_ops/misc.py b/python/report_ops/misc.py index f6f25e71..3492baf1 100644 --- a/python/report_ops/misc.py +++ b/python/report_ops/misc.py @@ -40,7 +40,7 @@ _sma_recipients = { "Vera.Dvorski@bnymellon.com", "Diana.WuChen@bnymellon.com", ), - "BRINKER": ("nyops@lmcg.com",), + "BRINKER": ("CSG.Team.Armata@bbh.com",), } _settlement_recipients = { @@ -59,6 +59,7 @@ _valuation_recipients = { "prim.vals@sscinc.com", "AJeeva@sscinc.com", ), + "ISOSEL": ("BHu@citco.com", "zzCFSDubPricing2@citco.com"), } _cc_recipients = { diff --git a/python/report_ops/sma.py b/python/report_ops/sma.py index 95e73f62..c147ee4c 100644 --- a/python/report_ops/sma.py +++ b/python/report_ops/sma.py @@ -73,11 +73,35 @@ class SMA: params=(self.date, self.fund, self.date), index_col=["id"], ) - return df_blotter, cds_positions, tranche_positions + swaption_positions = pd.read_sql_query( + "SELECT deal_id, security_id, maturity, notional, option_type, strike, " + "expiration_date, serenitas_nav, globeop_nav, initial_margin FROM " + "list_swaption_positions_and_risks(%s, %s);", + self._conn, + params=(self.date, self.fund), + index_col=["security_id"], + ) + ir_swaption_positions = pd.read_sql_query( + "SELECT deal_id, security_id, maturity, notional, option_type, strike, " + "expiration_date, nav, initial_margin_percentage FROM list_ir_swaption_positions(%s, %s); ", + self._conn, + params=(self.date, self.fund), + index_col=["security_id"], + ) + return ( + df_blotter, + cds_positions, + tranche_positions, + swaption_positions, + ir_swaption_positions, + ) def email_positions(self): attachments = [] - for name, df in zip(("bonds", "cds", "tranches"), (self.get_positions())): + for name, df in zip( + ("bonds", "cds", "tranches", "swaptions", "ir_swaptions"), + (self.get_positions()), + ): buf = StringIO() df.to_csv(buf) attachments.append( diff --git a/python/report_ops/utils.py b/python/report_ops/utils.py index bb6c0116..dd81d735 100644 --- a/python/report_ops/utils.py +++ b/python/report_ops/utils.py @@ -333,6 +333,52 @@ class CDXQuoteMonitor( ) +class CDXSpreadMonitor( + Monitor, + headers=( + "security_desc", + "identifier", + "maturity", + "citco_spread", + "serenitas_spread", + "citco_quote", + "serenitas_quote", + "difference", + "valuation_date", + ), + num_format=[ + ("{0:,.2f}", 3), + ("{0:,.2f}", 4), + ("{0:,.2f}", 5), + ("{0:,.2f}", 6), + ("{0:,.2f}", 7), + ], +): + @classmethod + def email(cls, fund): + if not cls._staging_queue: + return + cls._em.send_email( + f"CDX Quote Outside of our Tolerance: {fund}", + HTMLBody( + f""" +<html> + <head> + <style> + table, th, td {{ border: 1px solid black; border-collapse: collapse;}} + th, td {{ padding: 5px; }} + </style> + </head> + <body> + Good morning,<br><br>Could you please help us with the below cleared CDX quotes outside of our tolerance:<br><br>{cls.to_tabulate()} + </body> +</html>""" + ), + to_recipients=_valuation_recipients[fund], + cc_recipients=_cc_recipients[fund], + ) + + class SettlementMonitor( Monitor, headers=("date", "account", "currency", "projected_balance"), |
