diff options
Diffstat (limited to 'python/report_ops')
| -rw-r--r-- | python/report_ops/cash.py | 51 |
1 files changed, 50 insertions, 1 deletions
diff --git a/python/report_ops/cash.py b/python/report_ops/cash.py index 027cb350..e8f8d0cb 100644 --- a/python/report_ops/cash.py +++ b/python/report_ops/cash.py @@ -9,12 +9,55 @@ from .misc import get_dir, dt_from_fname from .custodians import NT, UMB, BNY from functools import partial +_bowdst_iam_cp = { + "BAML_ISDA": "BOANNY", + "CS": "CSITLN", + "GS": "GOLINY", + "BNP": "BNPBNY", + "MS": "MSCILN", + "JPM": "JPCBNY", + "GS_FCM": "GOLDNY", +} + +_serenitas_iam_cp = { + "BAML_ISDA": "BAMSNY", + "CS": "CSFBBO", + "GS": "GOLDNY", + "BNP": "BNPBNY", + "MS": "MSCSNY", + "JPM": "JPCBNY", + "GS_FCM": "GOLDNY", +} + + +def get_counterparty(fund, iam_broker): + match fund: + case "SERCGMAST": + return _serenitas_iam_cp[iam_broker] + case "BOWDST": + return _bowdst_iam_cp[iam_broker] + + +def get_custodian_account(fund, iam_broker): + match fund, iam_broker: + case ("SERCGMAST", "WF_FCM"): + return ("WELLSFCM", "WFNSCLMFCM") + case ("SERCGMAST", "BAML_FCM"): + return ("BOMLCM", "V0NSCLMFCM") + case ("BOWDST", "GS_FCM"): + return ("GS", "057363418ICE-CDS") + case ("SERCGMAST", _): + return ("UMB", "159260.1") + case ("BOWDST", _): + return ("BNY", "751254") + @dataclass class IAMDeal(Deal, deal_type=None, table_name="iam_tickets"): trade_date: datetime.date = field(metadata={"globeop": "SettlementDate"}) folder: str = field(metadata={"globeop": "Folder"}) - counterparty: str = field(metadata={"globeop": "Counterparty"}) + broker: str + # counterparty: str = field(metadata={"globeop": "Counterparty"}) start_money: float = field(metadata={"globeop": "StartMoney"}) currency: str = field(metadata={"globeop": "Currency"}) fund: Fund @@ -42,6 +85,12 @@ class IAMDeal(Deal, deal_type=None, table_name="iam_tickets"): obj["DealFunction"] = "OTC" obj["MarginType"] = "Variation" obj["Basis"] = "ACT/360" + (custodian, cash_account) = get_custodian_account(fund, self.broker) + obj = obj | { + "Custodian": custodian, + "Cash Account": cash_account, + "Counterparty": get_counterparty(fund, self.broker), + } return obj |
