aboutsummaryrefslogtreecommitdiffstats
path: root/python/insert_fx_id.py
diff options
context:
space:
mode:
Diffstat (limited to 'python/insert_fx_id.py')
-rw-r--r--python/insert_fx_id.py9
1 files changed, 4 insertions, 5 deletions
diff --git a/python/insert_fx_id.py b/python/insert_fx_id.py
index a6ab83a9..3f5ef68f 100644
--- a/python/insert_fx_id.py
+++ b/python/insert_fx_id.py
@@ -7,6 +7,7 @@ from serenitas.analytics.dates import prev_business_day
from serenitas.utils.db import dawn_engine
from serenitas.utils.db import dbconn
from collateral.baml_isda import load_excel
+from report_ops.enums import FundEnum
logger = logging.getLogger(__name__)
logger.setLevel(logging.INFO)
@@ -21,8 +22,6 @@ FX_REPORT_COLUMNS = [
"sell_amount",
]
-_fund_enums = {"Serenitas": "SERCGMAST", "BowdSt": "BOWDST", "Selene": "ISOSEL"}
-
def get_tag(fund):
if fund == "Serenitas":
@@ -108,14 +107,14 @@ def get_forwards(cob):
def main(workdate):
conn = dbconn("dawndb")
dawn_trades = get_forwards(workdate)
- for fund, fund_code in _fund_enums.items():
+ for fund in FundEnum:
for counterparty in ("MSCSNY", "BAMSNY"):
read_fun = globals()[f"read_{counterparty}"]
- for row in read_fun(fund, workdate):
+ for row in read_fun(fund.name, workdate):
if row.cpty_id not in dawn_trades.cpty_id.values:
matching_candidates = dawn_trades.loc[
(dawn_trades["cp_code"] == counterparty)
- & (dawn_trades["fund"] == fund_code)
+ & (dawn_trades["fund"] == fund.value)
]
filters = {
"trade_date": row.trade_date,