1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
|
POSITION_HEADERS = [
"Client Name",
"Fund Name",
"Counterparty",
"AccountNumber",
"COB Date",
"SecurityDescription",
"Prime Broker",
"Product Type",
"Unique Deal ID",
"TransactionIndicator (Buy/Sell)",
"PutCall Indicator (Call/Put)",
"CapFloorIndicator",
"CurrencyPair",
"DealCurrencyA",
"DealCurrencyB",
"NotionalA",
"NotionalB",
"OriginalPrice",
"Strike",
"FixedRate",
"Quantity",
"Start Date",
"Effective Date",
"Maturity Date",
"Underlying Maturity",
"RecPayFixed",
"Underlying (ISIN / CUSP / RED CODES)",
"Underlying Desc",
"Exercise Type",
"MTM Currency",
"MTM Valuation",
"MarketPrice",
"COB Date",
"Clearing House Name",
]
BOWDST_POSITION_HEADERS = [
"Client Name",
"Fund Name",
"Counterparty",
"Product Type",
"Unique Deal ID",
"TransactionIndicator (Buy/Sell)",
"PutCall Indicator (Call/Put)",
"CapFloorIndicator",
"CurrencyPair",
"DealCurrencyA",
"DealCurrencyB",
"NotionalA",
"NotionalB",
"OriginalPrice",
"Strike",
"FixedRate",
"Quantity",
"Start Date",
"Effective Date",
"Maturity Date",
"Underlying Maturity",
"RecPayFixed",
"Underlying (ISIN / CUSP / RED CODES)",
"Underlying Desc",
"Exercise Type",
"MTM Currency",
"MTM Valuation",
"COB Date",
"Clearing House Name",
"MarketPrice",
"AccountNumber",
"SecurityDescription",
"Prime Broker",
]
BNY_SECURITY_HEADER = [
"Function of the Message",
"Trade Type",
"Account No",
"Trade Date",
"Settlement Date",
"Broker ID",
"Clearer ID",
"Price",
"Asset Type",
"Currency",
"Local Cost",
"Commission",
"Broker Account",
"SEC Fee",
"Other Charges",
"Principal",
"Interest",
"Final Money",
"Security Id",
"Security Description",
"Maturity Date",
"Issue Date",
"Current Rate",
"Safekeeping place",
"Settlement Place",
"Reference",
"Stamp Duty",
"Original Face",
"FX Execute",
"Buy/Sell Currency",
"FX Special",
"Market",
"Special Instruction",
"Block Detail Counter",
"Related Reference",
"Deliver To Account",
"Quantity",
"Pool Number",
"Factor",
"ADEL Date",
"Taxes",
"Settlement Method",
"Security Id Type",
"Investor",
"Broker ID Type",
"Broker Description",
"Clearer ID Type",
"Clearer Description",
"Clearer Account",
"Custodian ID Type",
"Custodian ID",
"Custodian Description",
"Custodian Account",
"Base Cost",
"Base Currency",
"Local Currency",
"Change Owner/Reg",
"Settlement Indicator",
"Italian Tax Id",
"Settlement Transaction Indicator",
"Sub-Custodian Special Inst",
"Inventory Book",
"Manual Broker Description Flag Book",
"Manual Broker Description",
"IIJ Number",
"Tracking Indicator",
"Tax Code",
"Tax Code - Deliver",
"Tax Code - Receive",
"Current Face Quantity",
"Accounting Description Line 1",
"Accounting Description Line 2",
"Accounting Description Receive Line 1",
"Accounting Description Receive Line 2",
"Trade Condition Indicator",
"Deal Reference",
"Common Trade Reference",
"Place of Trade",
"Place of Trade Narrative",
"Research Fee",
]
BNY_REPO_HEADER = [
"Function of Message",
"Trade Type",
"Account",
"Transaction Type",
"Trade Date",
"Settlement Date",
"Reference",
"Final Money",
"Currency",
"FX Details",
"Market",
"Settlement Method",
"Settlement Place",
"Place of Safekeeping",
"Broker ID Type",
"Broker ID",
"Broker Description",
"Broker Account",
"Clearer ID Type",
"Clearer ID",
"Clearer Description",
"Clearer Account",
"Change Owner/Reg",
"Settlement Indicator",
"Italian Tax Id",
"Stamp Duty",
"Maturity Date",
"Call Delay",
"Rate Type",
"Repo Rate",
"Forfeit Amount",
"Repo Index",
"Computation Method",
"Accrued Interest",
"Deal Amount",
"Premium Amount",
"Repurchase Amount",
"Legal Framework",
"Repo Reference",
"Closing Leg Reference",
"Collateral Count",
"Security Id Type",
"Security Id",
"Security Description",
"Face/Unit Amount",
"Special Instruction",
"Sub-Custodian Special Inst",
"Repo Special Inst",
"Related Reference",
"Principal Amount",
"Maturity Amount",
"Tri Party Repo Type",
"Custodian ID Type",
"Custodian ID",
"Custodian Description",
"Custodian Account",
"Place Of Trade",
"Place Of Trade Narrative",
]
BNY_CLS_HEADER = [
"Trade Type",
"Account",
"Trade Date",
"Value Date",
"Buy Currency",
"Buy Amount",
"Sell Currency",
"Sell Amount",
"Traded Currency",
"Reference",
"Related Reference",
"Fund Manager Type",
"Fund Manager ID",
"Fund manager Description",
"Fund Manager Add ID Type",
"Fund Manager Add ID",
"Executing Broker Type",
"Executing Broker ID",
"Executing Broker Description",
"Executing Broker Add ID Type",
"Executing Broker Add ID",
"Receive Delivery Agent Type",
"Receive Delivery Agent ID",
"Receive Delivery Agent Description",
"Receive Delivery Agent Add ID Type",
"Receive Delivery Agent Add ID",
"Receive Intermediary Type",
"Receive Intermediary ID",
"Receive Intermediary Description",
"Receive Intermediary Add ID Type",
"Receive Intermediary Add ID",
"Receive Payment Receiving Agent Type",
"Receive Payment Receiving Agent ID",
"Receive Payment Receiving Agent Description",
"Receive Payment Receiving Agent Add ID Type",
"Receive Payment Receiving Agent Add ID",
"Delivery Receiving Agent Type",
"Delivery Receiving Agent ID",
"Delivery Receiving Agent Description",
"Delivery Receiving Agent Add ID Type",
"Delivery Receiving Agent Add ID",
"Delivery Beneficiary Bank Type",
"Delivery Beneficiary Bank ID",
"Delivery Beneficiary Bank Description",
"Delivery Beneficiary Bank Add ID Type",
"Delivery Beneficiary Bank Add ID",
"Delivery Payment Delivery Agent Type",
"Delivery Payment Delivery Agent ID",
"Delivery Payment Delivery Agent Description",
"Delivery Payment Delivery Agent Add ID Type",
"Delivery Payment Delivery Agent Add ID",
"Delivery Intermediary Type",
"Delivery Intermediary ID",
"Delivery Intermediary Description",
"Delivery Intermediary Add ID Type",
"Delivery Intermediary Add ID",
"Sender to Receiver Line Type -1",
"Sender to Receiver Line Description -1",
"Sender to Receiver Line Type -2",
"Sender to Receiver Line Description -2",
"Sender to Receiver Line Type -3",
"Sender to Receiver Line Description -3",
"Sender to Receiver Line Type -4",
"Sender to Receiver Line Description -4",
"Sender to Receiver Line Type -5",
"Sender to Receiver Line Description -5",
"Sender to Receiver Line Type -6",
"Sender to Receiver Line Description -6",
"Function of the Message",
"IIJ Number",
"Settlement Currency",
"Settlement Amount",
"Settlement Reference",
"Gain/Loss Flag",
"Fixing Date",
"Settlement Receiving Agent Type",
"Settlement Receiving Agent ID",
"Settlement Receiving Agent Description",
"Settlement Receiving Agent Add ID Type",
"Settlement Receiving Agent Add ID",
"Settlement Beneficiary Bank Type",
"Settlement Beneficiary Bank ID",
"Settlement Beneficiary Bank Description",
"Settlement Beneficiary Bank Add ID Type",
"Settlement Beneficiary Bank Add ID",
"Settlement Delivery Agent Type",
"Settlement Delivery Agent ID",
"Settlement Delivery Agent Description",
"Settlement Delivery Agent Add ID Type",
"Settlement Delivery Agent Add ID",
"Settlement Intermediary Type",
"Settlement Intermediary ID",
"Settlement Intermediary Description",
"Settlement Intermediary Add ID Type",
"Settlement Intermediary Add ID",
"Payment Clearing Centre",
"Fund Manager Clearing Code Type",
"Fund Manager Clearing Code",
"Fund Manager Tax Code",
"Fund Manager Legal Entity",
"Executing Broker Clearing Code Type",
"Executing Broker Clearing Code",
"Executing Broker Tax Code",
"Executing Broker Legal Entity",
"Receive Delivery Agent Clearing Code Type",
"Receive Delivery Agent Clearing Code",
"Receive Delivery Agent Tax Code",
"Receive Delivery Agent Legal Entity",
"Receive Delivery Agent No Settlement Instruction",
"Receive Intermediary Clearing Code Type",
"Receive Intermediary Clearing Code",
"Receive Intermediary Tax Code",
"Receive Intermediary Legal Entity",
"Receive Payment Receiving Agent Clearing Code Type",
"Receive Payment Receiving Agent Clearing Code",
"Receive Payment Receiving Agent Tax Code",
"Receive Payment Receiving Agent Legal Entity",
"Delivery Receiving Agent Clearing Code Type",
"Delivery Receiving Agent Clearing Code",
"Delivery Receiving Agent Tax Code",
"Delivery Receiving Agent Legal Entity",
"Delivery Receiving Agent No Settlement Instruction",
"Delivery Beneficiary Bank Clearing Code Type",
"Delivery Beneficiary Bank Clearing Code",
"Delivery Beneficiary Bank Tax Code",
"Delivery Beneficiary Bank Legal Entity",
"Delivery Payment Delivery Agent Clearing Code Type",
"Delivery Payment Delivery Agent Clearing Code",
"Delivery Payment Delivery Agent Tax Code",
"Delivery Payment Delivery Agent Legal Entity",
"Delivery Intermediary Clearing Code Type",
"Delivery Intermediary Clearing Code",
"Delivery Intermediary Tax Code",
"Delivery Intermediary Legal Entity",
"Comments",
"Status",
"Template Name",
"Trans Number",
"Creator",
"File ID",
"Authorizer",
"Timestamp",
"Audit Trail",
"Account Name",
]
def get_position_headers(fund):
match fund:
case "BOWDST":
return BOWDST_POSITION_HEADERS
case _:
return POSITION_HEADERS
def get_bny_headers(trade_type):
match trade_type:
case "repo":
return BNY_REPO_HEADER
case "spot":
return BNY_CLS_HEADER
case "bond" | "stock":
return BNY_SECURITY_HEADER
|