diff options
Diffstat (limited to 'python/report_ops')
| -rw-r--r-- | python/report_ops/__main__.py | 2 | ||||
| -rw-r--r-- | python/report_ops/utils.py | 18 |
2 files changed, 18 insertions, 2 deletions
diff --git a/python/report_ops/__main__.py b/python/report_ops/__main__.py index da634f74..a5172a24 100644 --- a/python/report_ops/__main__.py +++ b/python/report_ops/__main__.py @@ -8,7 +8,7 @@ from .cash import CashReport from .admin import CitcoReport from .wires import Wire from .custodians import upload_to_custodian -from .utils import notify_payment_settlements, notify_fx_hedge, PaymentMonitor, FxHedge +from .utils import notify_payment_settlements, notify_fx_hedge from .misc import _fund_custodians logger = logging.getLogger(__name__) diff --git a/python/report_ops/utils.py b/python/report_ops/utils.py index c4c1561d..f5a5ee35 100644 --- a/python/report_ops/utils.py +++ b/python/report_ops/utils.py @@ -98,6 +98,22 @@ def notify_fx_hedge(date, fund, conn): FxHedge._staging_queue.clear() +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_quote) AS difference FROM list_cds_marks(%s, NULL, %s)", + (date, fund), + ) + for row in c: + d = row._asdict() + d["serenitas_quote"] = d["price"] + if d["difference"] > _tolerance[d["index"]]: + CDXQuoteMonitor.stage(d) + CDXQuoteMonitor.email(fund) + CDXQuoteMonitor._staging_queue.clear() + + @dataclass class CitcoSubmission(Deal, deal_type=None, table_name="citco_submission2"): id: int = field(init=False, metadata={"insert": False}) @@ -300,7 +316,7 @@ class CDXQuoteMonitor( Monitor, headers=( "security_desc", - "identifier", + "security_id", "maturity", "globeop_quote", "serenitas_quote", |
