aboutsummaryrefslogtreecommitdiffstats
path: root/python
diff options
context:
space:
mode:
Diffstat (limited to 'python')
-rw-r--r--python/fcm_fx.py (renamed from python/baml_fcm_fx.py)25
-rw-r--r--python/report_ops/misc.py5
2 files changed, 21 insertions, 9 deletions
diff --git a/python/baml_fcm_fx.py b/python/fcm_fx.py
index 1c7984bb..dd53ea39 100644
--- a/python/baml_fcm_fx.py
+++ b/python/fcm_fx.py
@@ -5,13 +5,19 @@ from report_ops.misc import _recipients, _cc_recipients
from serenitas.utils.exchange import ExchangeMessage
from exchangelib import HTMLBody
-_fcm_alias = {"V0NSCLMSPT": "6MZ20049"}
+_account_alias = {"V0NSCLMSPT": "6MZ20049"}
def email_fcm(em, d, fund):
- fcm_account = _fcm_alias.get(d["cash_account"], d["cash_account"])
+ account = _account_alias.get(d["cash_account"], d["cash_account"])
+ match d["cp_code"]:
+ case "BAMSNY":
+ recipients = _recipients["BAML_FCM"]
+ case "GOLDNY":
+ recipients = _recipients["GS_FCM"]
+ additional_instructions = f"Could you please instruct moves from DCS 057575201 to Futures {account} to settle thie trade? "
em.send_email(
- f"FX Details: {fcm_account} Trade Date: {d['trade_date']}",
+ f"FX Details: {account} Trade Date: {d['trade_date']}",
HTMLBody(
f"""
<html>
@@ -22,11 +28,11 @@ def email_fcm(em, d, fund):
</style>
</head>
<body>
- Hello,<br><br>Please see below details for an FX Spot Trade we did with the desk today for account {fcm_account}. Please let me know if you need more information.<br><br>{to_tabulate(d)}
+ Hello,<br><br>Please see below details for an FX Spot Trade we did with the desk today for account {account}. {additional_instructions if additional_instructions else ""}Please let me know if you need more information.<br><br>{to_tabulate(d)}
</body>
</html>"""
),
- to_recipients=_recipients["BAML_FCM"],
+ to_recipients=recipients,
cc_recipients=_cc_recipients[fund],
)
@@ -36,9 +42,9 @@ def to_tabulate(d):
key1, key2 = "buy", "sell"
else:
key1, key2 = "sell", "buy"
- fcm_account = _fcm_alias.get(d["cash_account"], d["cash_account"])
+ account = _account_alias.get(d["cash_account"], d["cash_account"])
line = [
- fcm_account,
+ account,
d[f"{key1}_currency"],
d[f"{key1}_amount"],
d[f"{key2}_currency"],
@@ -71,9 +77,9 @@ def to_tabulate(d):
def main(trade_date, conn, fund, em):
with conn.cursor() as c:
c.execute(
- "SELECT spots.cash_account, buy_currency, sell_currency, buy_amount, sell_amount, spot_rate, settle_date, trade_date FROM spots "
+ "SELECT spots.cash_account, buy_currency, sell_currency, buy_amount, sell_amount, spot_rate, settle_date, trade_date, spots.cp_code FROM spots "
"LEFT JOIN accounts2 USING (cash_account) "
- "WHERE account_type='Fcm' AND spots.cp_code='BAMSNY' AND spots.trade_date =%s AND spots.fund=%s",
+ "WHERE account_type in ('Fcm', 'Future') AND spots.cp_code in ('BAMSNY', 'GOLDNY') AND spots.trade_date =%s AND spots.fund=%s",
(trade_date, fund),
)
for rec in c:
@@ -98,5 +104,6 @@ if __name__ == "__main__":
for fund in (
"SERCGMAST",
"ISOSEL",
+ "BOWDST",
):
main(args.date, conn, fund, em)
diff --git a/python/report_ops/misc.py b/python/report_ops/misc.py
index 02b39bd3..76ec9cbb 100644
--- a/python/report_ops/misc.py
+++ b/python/report_ops/misc.py
@@ -18,6 +18,11 @@ _recipients = {
"SERENITAS.ops@sscinc.com",
),
"BAML_FCM": ("footc_margin_csr_amrs@bofa.com",),
+ "GS_FCM": (
+ "Susan.Olesky@ny.email.gs.com",
+ "Divyanshi.Girotra@gs.com",
+ "gs-margin-calls-dcs@ny.email.gs.com",
+ ),
"NYOPS": ("nyops@lmcg.com",),
"UMB": ("lmcgcustody@umb.com",),
}