-
Notifications
You must be signed in to change notification settings - Fork 901
/
instrument.py
2301 lines (2101 loc) · 168 KB
/
instrument.py
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
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
"""
Copyright 2019 Goldman Sachs.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing,
software distributed under the License is distributed on an
"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
KIND, either express or implied. See the License for the
specific language governing permissions and limitations
under the License.
"""
from gs_quant.base import *
from gs_quant.common import *
import datetime
from typing import Dict, Optional, Tuple, Union
from dataclasses import dataclass, field
from dataclasses_json import LetterCase, config, dataclass_json
from gs_quant.instrument.core import Instrument
@handle_camel_case_args
@dataclass_json(letter_case=LetterCase.CAMEL)
@dataclass(unsafe_hash=True, repr=False)
class EqSyntheticOETTerms(Instrument):
client_fee: Optional[str] = field(default=None, metadata=field_metadata)
client_notice: Optional[str] = field(default=None, metadata=field_metadata)
client_terms: Optional[str] = field(default=None, metadata=field_metadata)
firm_fee: Optional[str] = field(default=None, metadata=field_metadata)
firm_notice: Optional[str] = field(default=None, metadata=field_metadata)
firm_terms: Optional[str] = field(default=None, metadata=field_metadata)
oet_type: Optional[str] = field(default=None, metadata=field_metadata)
asset_class: Optional[AssetClass] = field(init=False, default=AssetClass.Equity, metadata=field_metadata)
type_: Optional[AssetType] = field(init=False, default=AssetType.SyntheticOETTerms, metadata=config(field_name='type', exclude=exclude_none))
name: Optional[str] = field(default=None, metadata=name_metadata)
@handle_camel_case_args
@dataclass_json(letter_case=LetterCase.CAMEL)
@dataclass(unsafe_hash=True, repr=False)
class EqSyntheticSchedule(Instrument):
period: Optional[str] = field(default=None, metadata=field_metadata)
delay: Optional[str] = field(default=None, metadata=field_metadata)
date_rule: Optional[str] = field(default=None, metadata=field_metadata)
asset_class: Optional[AssetClass] = field(init=False, default=AssetClass.Equity, metadata=field_metadata)
type_: Optional[AssetType] = field(init=False, default=AssetType.SyntheticSchedule, metadata=config(field_name='type', exclude=exclude_none))
name: Optional[str] = field(default=None, metadata=name_metadata)
@handle_camel_case_args
@dataclass_json(letter_case=LetterCase.CAMEL)
@dataclass(unsafe_hash=True, repr=False)
class FXCorrelationSwapLeg(Instrument):
pair: Optional[str] = field(default=None, metadata=field_metadata)
asset_class: Optional[AssetClass] = field(init=False, default=AssetClass.FX, metadata=field_metadata)
type_: Optional[AssetType] = field(init=False, default=AssetType.CorrelationSwapLeg, metadata=config(field_name='type', exclude=exclude_none))
name: Optional[str] = field(default=None, metadata=name_metadata)
@handle_camel_case_args
@dataclass_json(letter_case=LetterCase.CAMEL)
@dataclass(unsafe_hash=True, repr=False)
class AssetRef(Instrument):
buy_sell: Optional[BuySell] = field(default=None, metadata=field_metadata)
product_code: Optional[ProductCode] = field(default=None, metadata=field_metadata)
size: Optional[float] = field(default=None, metadata=field_metadata)
asset_id: Optional[str] = field(default=None, metadata=field_metadata)
number_of_options: Optional[float] = field(default=None, metadata=field_metadata)
asset_class: Optional[AssetClass] = field(init=False, default=AssetClass.Cross_Asset, metadata=field_metadata)
type_: Optional[AssetType] = field(init=False, default=AssetType.Any, metadata=config(field_name='type', exclude=exclude_none))
name: Optional[str] = field(default=None, metadata=name_metadata)
@handle_camel_case_args
@dataclass_json(letter_case=LetterCase.CAMEL)
@dataclass(unsafe_hash=True, repr=False)
class Bond(Instrument):
buy_sell: Optional[BuySell] = field(default=None, metadata=field_metadata)
identifier: Optional[str] = field(default=None, metadata=field_metadata)
identifier_type: Optional[UnderlierType] = field(default=None, metadata=field_metadata)
size: Optional[float] = field(default=None, metadata=field_metadata)
settlement_date: Optional[Union[datetime.date, str]] = field(default=None, metadata=field_metadata)
settlement_currency: Optional[Currency] = field(default=None, metadata=field_metadata)
asset_class: Optional[AssetClass] = field(init=False, default=AssetClass.Cross_Asset, metadata=field_metadata)
type_: Optional[AssetType] = field(init=False, default=AssetType.Bond, metadata=config(field_name='type', exclude=exclude_none))
name: Optional[str] = field(default=None, metadata=name_metadata)
@handle_camel_case_args
@dataclass_json(letter_case=LetterCase.CAMEL)
@dataclass(unsafe_hash=True, repr=False)
class Cash(Instrument):
currency: Optional[Currency] = field(default=None, metadata=field_metadata)
payment_date: Optional[datetime.date] = field(default=None, metadata=field_metadata)
notional_amount: Optional[Union[float, str]] = field(default=None, metadata=field_metadata)
asset_class: Optional[AssetClass] = field(init=False, default=AssetClass.Cash, metadata=field_metadata)
type_: Optional[AssetType] = field(init=False, default=AssetType.Cash, metadata=config(field_name='type', exclude=exclude_none))
name: Optional[str] = field(default=None, metadata=name_metadata)
@handle_camel_case_args
@dataclass_json(letter_case=LetterCase.CAMEL)
@dataclass(unsafe_hash=True, repr=False)
class CommodIndexSwap(Instrument):
index: Optional[str] = field(default=None, metadata=field_metadata)
quantity: Optional[Union[float, str]] = field(default=None, metadata=field_metadata)
quantity_unit: Optional[str] = field(default=None, metadata=field_metadata)
settlement_days: Optional[int] = field(default=None, metadata=field_metadata)
settlement_days_after: Optional[str] = field(default=None, metadata=field_metadata)
settlement_days_type: Optional[str] = field(default=None, metadata=field_metadata)
effective_date: Optional[Union[datetime.date, str]] = field(default=None, metadata=field_metadata)
termination_date: Optional[Union[datetime.date, str]] = field(default=None, metadata=field_metadata)
buy_sell: Optional[BuySell] = field(default=None, metadata=field_metadata)
reset_frequency: Optional[str] = field(default=None, metadata=field_metadata)
reset_day: Optional[int] = field(default=None, metadata=field_metadata)
reset_frequency_multiplier: Optional[int] = field(default=None, metadata=field_metadata)
index_name_source: Optional[str] = field(default=None, metadata=field_metadata)
execution_method_name: Optional[str] = field(default=None, metadata=field_metadata)
execution_method_start_time: Optional[str] = field(default=None, metadata=field_metadata)
execution_method_end_time: Optional[str] = field(default=None, metadata=field_metadata)
execution_method_location: Optional[str] = field(default=None, metadata=field_metadata)
asset_class: Optional[AssetClass] = field(init=False, default=AssetClass.Commod, metadata=field_metadata)
type_: Optional[AssetType] = field(init=False, default=AssetType.IndexSwap, metadata=config(field_name='type', exclude=exclude_none))
name: Optional[str] = field(default=None, metadata=name_metadata)
@handle_camel_case_args
@dataclass_json(letter_case=LetterCase.CAMEL)
@dataclass(unsafe_hash=True, repr=False)
class CommodOTCOptionPeriod(Instrument):
start: Optional[Union[datetime.date, str]] = field(default=None, metadata=field_metadata)
end: Optional[Union[datetime.date, str]] = field(default=None, metadata=field_metadata)
contract: Optional[str] = field(default=None, metadata=field_metadata)
quantity: Optional[Union[float, str]] = field(default=None, metadata=field_metadata)
asset_class: Optional[AssetClass] = field(init=False, default=AssetClass.Commod, metadata=field_metadata)
type_: Optional[AssetType] = field(init=False, default=AssetType.OptionPeriod, metadata=config(field_name='type', exclude=exclude_none))
name: Optional[str] = field(default=None, metadata=name_metadata)
@handle_camel_case_args
@dataclass_json(letter_case=LetterCase.CAMEL)
@dataclass(unsafe_hash=True, repr=False)
class CommodOTCSwapLeg(Instrument):
fixing_currency: Optional[CurrencyName] = field(default=None, metadata=field_metadata)
leg_description: Optional[str] = field(default=None, metadata=field_metadata)
contract: Optional[str] = field(default=None, metadata=field_metadata)
fixing_currency_source: Optional[str] = field(default=None, metadata=field_metadata)
underlier: Optional[str] = field(default=None, metadata=field_metadata)
quantity_multiplier: Optional[int] = field(default=None, metadata=field_metadata)
fixed_price: Optional[Union[float, str]] = field(default=None, metadata=field_metadata)
asset_class: Optional[AssetClass] = field(init=False, default=AssetClass.Commod, metadata=field_metadata)
type_: Optional[AssetType] = field(init=False, default=AssetType.SwapLeg, metadata=config(field_name='type', exclude=exclude_none))
name: Optional[str] = field(default=None, metadata=name_metadata)
@handle_camel_case_args
@dataclass_json(letter_case=LetterCase.CAMEL)
@dataclass(unsafe_hash=True, repr=False)
class CommodOTCSwapPeriod(Instrument):
start: Optional[Union[datetime.date, str]] = field(default=None, metadata=field_metadata)
end: Optional[Union[datetime.date, str]] = field(default=None, metadata=field_metadata)
quantity: Optional[Union[float, str]] = field(default=None, metadata=field_metadata)
asset_class: Optional[AssetClass] = field(init=False, default=AssetClass.Commod, metadata=field_metadata)
type_: Optional[AssetType] = field(init=False, default=AssetType.SwapPeriod, metadata=config(field_name='type', exclude=exclude_none))
name: Optional[str] = field(default=None, metadata=name_metadata)
@handle_camel_case_args
@dataclass_json(letter_case=LetterCase.CAMEL)
@dataclass(unsafe_hash=True, repr=False)
class CommodSwapData(Instrument):
commodity: Optional[str] = field(default=None, metadata=field_metadata)
quantity: Optional[Union[float, str]] = field(default=None, metadata=field_metadata)
contract: Optional[str] = field(default=None, metadata=field_metadata)
fixing_currency_source: Optional[str] = field(default=None, metadata=field_metadata)
start: Optional[Union[datetime.date, str]] = field(default=None, metadata=field_metadata)
floating_type: Optional[str] = field(default=None, metadata=field_metadata)
number_of_periods: Optional[int] = field(default=None, metadata=field_metadata)
quantity_unit: Optional[str] = field(default=None, metadata=field_metadata)
fixed_price: Optional[Union[float, str]] = field(default=None, metadata=field_metadata)
settlement: Optional[str] = field(default=None, metadata=field_metadata)
fixing_currency: Optional[str] = field(default=None, metadata=field_metadata)
fixed_price_unit: Optional[str] = field(default=None, metadata=field_metadata)
commodity_reference_price: Optional[str] = field(default=None, metadata=field_metadata)
end: Optional[Union[datetime.date, str]] = field(default=None, metadata=field_metadata)
quantity_period: Optional[Period] = field(default=None, metadata=field_metadata)
strategy: Optional[str] = field(default=None, metadata=field_metadata)
buy_sell: Optional[BuySell] = field(default=None, metadata=field_metadata)
buy_sells: Optional[Tuple[str, ...]] = field(default=None, metadata=field_metadata)
underlier_short_name: Optional[str] = field(default=None, metadata=field_metadata)
settlement_days: Optional[Union[float, str]] = field(default=None, metadata=field_metadata)
settlement_days_type: Optional[str] = field(default=None, metadata=field_metadata)
settlement_days_from: Optional[str] = field(default=None, metadata=field_metadata)
settlement_frequency: Optional[str] = field(default=None, metadata=field_metadata)
currency_summary: Optional[CurrencyName] = field(default=None, metadata=field_metadata)
native_quantity_unit: Optional[str] = field(default=None, metadata=field_metadata)
asset_class: Optional[AssetClass] = field(init=False, default=AssetClass.Commod, metadata=field_metadata)
type_: Optional[AssetType] = field(init=False, default=AssetType.SwapData, metadata=config(field_name='type', exclude=exclude_none))
name: Optional[str] = field(default=None, metadata=name_metadata)
@handle_camel_case_args
@dataclass_json(letter_case=LetterCase.CAMEL)
@dataclass(unsafe_hash=True, repr=False)
class EqAutoroll(Instrument):
underlier: Optional[Union[float, str]] = field(default=None, metadata=field_metadata)
expiration_date: Optional[Union[datetime.date, str]] = field(default=None, metadata=field_metadata)
first_fixing_date: Optional[Union[datetime.date, str]] = field(default=None, metadata=field_metadata)
last_fixing_date: Optional[Union[datetime.date, str]] = field(default=None, metadata=field_metadata)
fixing_frequency: Optional[str] = field(default=None, metadata=field_metadata)
trigger_level: Optional[float] = field(default=None, metadata=field_metadata)
buffer_level: Optional[float] = field(default=None, metadata=field_metadata)
local_return_cap: Optional[float] = field(default=None, metadata=field_metadata)
upside_leverage: Optional[float] = field(default=None, metadata=field_metadata)
initial_fixing_override: Optional[float] = field(default=None, metadata=field_metadata)
apply_trigger_level_shift: Optional[str] = field(default=None, metadata=field_metadata)
trigger_level_shift: Optional[float] = field(default=None, metadata=field_metadata)
notional: Optional[Union[float, str]] = field(default=None, metadata=field_metadata)
business_day_calendar: Optional[str] = field(default=None, metadata=field_metadata)
payment_currency: Optional[Currency] = field(default=None, metadata=field_metadata)
settlement_delay: Optional[str] = field(default=None, metadata=field_metadata)
underlier_type: Optional[UnderlierType] = field(default=None, metadata=field_metadata)
buy_sell: Optional[BuySell] = field(default=None, metadata=field_metadata)
premium: Optional[float] = field(default=None, metadata=field_metadata)
premium_payment_date: Optional[Union[datetime.date, str]] = field(default=None, metadata=field_metadata)
premium_currency: Optional[Currency] = field(default=None, metadata=field_metadata)
asset_class: Optional[AssetClass] = field(init=False, default=AssetClass.Equity, metadata=field_metadata)
type_: Optional[AssetType] = field(init=False, default=AssetType.Autoroll, metadata=config(field_name='type', exclude=exclude_none))
name: Optional[str] = field(default=None, metadata=name_metadata)
@handle_camel_case_args
@dataclass_json(letter_case=LetterCase.CAMEL)
@dataclass(unsafe_hash=True, repr=False)
class EqBarrier(Instrument):
underlier: Optional[str] = field(default=None, metadata=field_metadata)
buy_sell: Optional[BuySell] = field(default=None, metadata=field_metadata)
option_type: Optional[OptionType] = field(default=None, metadata=field_metadata)
expiration_date: Optional[str] = field(default=None, metadata=field_metadata)
strike_price: Optional[float] = field(default=None, metadata=field_metadata)
barrier_start_date: Optional[str] = field(default=None, metadata=field_metadata)
barrier_end_date: Optional[str] = field(default=None, metadata=field_metadata)
barrier_level: Optional[float] = field(default=None, metadata=field_metadata)
knock_up_or_down: Optional[UpDown] = field(default=None, metadata=field_metadata)
barrier_frequency: Optional[str] = field(default=None, metadata=field_metadata)
knock_in_or_out: Optional[InOut] = field(default=None, metadata=field_metadata)
number_of_options: Optional[float] = field(default=None, metadata=field_metadata)
multiplier: Optional[float] = field(default=None, metadata=field_metadata)
premium: Optional[float] = field(default=None, metadata=field_metadata)
premium_settlement_date: Optional[str] = field(default=None, metadata=field_metadata)
currency: Optional[str] = field(default=None, metadata=field_metadata)
asset_class: Optional[AssetClass] = field(init=False, default=AssetClass.Equity, metadata=field_metadata)
type_: Optional[AssetType] = field(init=False, default=AssetType.Barrier, metadata=config(field_name='type', exclude=exclude_none))
name: Optional[str] = field(default=None, metadata=name_metadata)
@handle_camel_case_args
@dataclass_json(letter_case=LetterCase.CAMEL)
@dataclass(unsafe_hash=True, repr=False)
class EqBinary(Instrument):
underlier: Optional[Union[float, str]] = field(default=None, metadata=field_metadata)
buy_sell: Optional[BuySell] = field(default=None, metadata=field_metadata)
option_type: Optional[OptionType] = field(default=None, metadata=field_metadata)
expiration_date: Optional[Union[datetime.date, str]] = field(default=None, metadata=field_metadata)
settlement_date: Optional[Union[datetime.date, str]] = field(default=None, metadata=field_metadata)
strike_price: Optional[Union[float, str]] = field(default=None, metadata=field_metadata)
notional_amount: Optional[Union[float, str]] = field(default=None, metadata=field_metadata)
currency: Optional[str] = field(default=None, metadata=field_metadata)
premium: Optional[Union[float, str]] = field(default=None, metadata=field_metadata)
premium_settlement_date: Optional[Union[datetime.date, str]] = field(default=None, metadata=field_metadata)
asset_class: Optional[AssetClass] = field(init=False, default=AssetClass.Equity, metadata=field_metadata)
type_: Optional[AssetType] = field(init=False, default=AssetType.Binary, metadata=config(field_name='type', exclude=exclude_none))
name: Optional[str] = field(default=None, metadata=name_metadata)
@handle_camel_case_args
@dataclass_json(letter_case=LetterCase.CAMEL)
@dataclass(unsafe_hash=True, repr=False)
class EqCliquet(Instrument):
return_style: Optional[ReturnStyle] = field(default=ReturnStyle.Rate_of_Return, metadata=field_metadata)
last_valuation_date: Optional[datetime.date] = field(default=None, metadata=field_metadata)
notional_amount: Optional[Union[float, str]] = field(default=None, metadata=field_metadata)
underlier_type: Optional[UnderlierType] = field(default=None, metadata=field_metadata)
underlier: Optional[Union[float, str]] = field(default=None, metadata=field_metadata)
payment_frequency: Optional[PaymentFrequency] = field(default=PaymentFrequency.Maturity, metadata=field_metadata)
global_cap: Optional[float] = field(default=1000000.0, metadata=field_metadata)
first_valuation_date: Optional[datetime.date] = field(default=None, metadata=field_metadata)
currency: Optional[Currency] = field(default=None, metadata=field_metadata)
global_floor: Optional[float] = field(default=-1000000.0, metadata=field_metadata)
strike_price: Optional[float] = field(default=None, metadata=field_metadata)
return_type: Optional[ReturnType] = field(default=ReturnType.Sum, metadata=field_metadata)
valuation_period: Optional[str] = field(default=None, metadata=field_metadata)
expiration_date: Optional[Union[datetime.date, str]] = field(default=None, metadata=field_metadata)
premium: Optional[float] = field(default=0.0, metadata=field_metadata)
asset_class: Optional[AssetClass] = field(init=False, default=AssetClass.Equity, metadata=field_metadata)
type_: Optional[AssetType] = field(init=False, default=AssetType.Cliquet, metadata=config(field_name='type', exclude=exclude_none))
name: Optional[str] = field(default=None, metadata=name_metadata)
@handle_camel_case_args
@dataclass_json(letter_case=LetterCase.CAMEL)
@dataclass(unsafe_hash=True, repr=False)
class EqConvertibleBond(Instrument):
underlier: Optional[Union[float, str]] = field(default=None, metadata=field_metadata)
underlier_type: Optional[UnderlierType] = field(default=None, metadata=field_metadata)
premium_settlement_date: Optional[Union[datetime.date, str]] = field(default=None, metadata=field_metadata)
ref_currency: Optional[Currency] = field(default=None, metadata=field_metadata)
buy_sell: Optional[BuySell] = field(default=None, metadata=field_metadata)
quantity: Optional[float] = field(default=None, metadata=field_metadata)
isin: Optional[str] = field(default=None, metadata=field_metadata)
premium_currency: Optional[Currency] = field(default=None, metadata=field_metadata)
denominated: Optional[Currency] = field(default=None, metadata=field_metadata)
multiplier: Optional[float] = field(default=None, metadata=field_metadata)
asset_class: Optional[AssetClass] = field(init=False, default=AssetClass.Equity, metadata=field_metadata)
type_: Optional[AssetType] = field(init=False, default=AssetType.Convertible, metadata=config(field_name='type', exclude=exclude_none))
name: Optional[str] = field(default=None, metadata=name_metadata)
@handle_camel_case_args
@dataclass_json(letter_case=LetterCase.CAMEL)
@dataclass(unsafe_hash=True, repr=False)
class EqForward(Instrument):
underlier: Optional[Union[float, str]] = field(default=None, metadata=field_metadata)
underlier_type: Optional[UnderlierType] = field(default=None, metadata=field_metadata)
expiration_date: Optional[Union[datetime.date, str]] = field(default=None, metadata=field_metadata)
forward_price: Optional[float] = field(default=None, metadata=field_metadata)
number_of_shares: Optional[int] = field(default=1, metadata=field_metadata)
asset_class: Optional[AssetClass] = field(init=False, default=AssetClass.Equity, metadata=field_metadata)
type_: Optional[AssetType] = field(init=False, default=AssetType.Forward, metadata=config(field_name='type', exclude=exclude_none))
name: Optional[str] = field(default=None, metadata=name_metadata)
@handle_camel_case_args
@dataclass_json(letter_case=LetterCase.CAMEL)
@dataclass(unsafe_hash=True, repr=False)
class EqForwardVarianceSwap(Instrument):
underlier: Optional[Union[float, str]] = field(default=None, metadata=field_metadata)
underlier_type: Optional[UnderlierType] = field(default=None, metadata=field_metadata)
expiration_date: Optional[Union[datetime.date, str]] = field(default=None, metadata=field_metadata)
strike_price: Optional[Union[float, str]] = field(default=None, metadata=field_metadata)
variance_cap: Optional[Union[float, str]] = field(default=None, metadata=field_metadata)
settlement_date: Optional[Union[datetime.date, str]] = field(default=None, metadata=field_metadata)
premium: Optional[Union[float, str]] = field(default=None, metadata=field_metadata)
buy_sell: Optional[BuySell] = field(default=None, metadata=field_metadata)
days_in_contract: Optional[float] = field(default=None, metadata=field_metadata)
valuation_time: Optional[ValuationTime] = field(default=None, metadata=field_metadata)
denominated: Optional[Currency] = field(default=None, metadata=field_metadata)
fixing_schedule_dates: Optional[Tuple[str, ...]] = field(default=None, metadata=field_metadata)
holiday_calendar: Optional[str] = field(default=None, metadata=field_metadata)
initial_date: Optional[Union[datetime.date, str]] = field(default=None, metadata=field_metadata)
quantity: Optional[Union[float, str]] = field(default=None, metadata=field_metadata)
initial_spot: Optional[float] = field(default=None, metadata=field_metadata)
expiry_settlement_days: Optional[str] = field(default=None, metadata=field_metadata)
initial_spot_valuation_time: Optional[ValuationTime] = field(default=None, metadata=field_metadata)
force_forward_tradable: Optional[bool] = field(default=None, metadata=field_metadata)
asset_class: Optional[AssetClass] = field(init=False, default=AssetClass.Equity, metadata=field_metadata)
type_: Optional[AssetType] = field(init=False, default=AssetType.ForwardVarianceSwap, metadata=config(field_name='type', exclude=exclude_none))
name: Optional[str] = field(default=None, metadata=name_metadata)
@handle_camel_case_args
@dataclass_json(letter_case=LetterCase.CAMEL)
@dataclass(unsafe_hash=True, repr=False)
class EqFuture(Instrument):
identifier: Optional[str] = field(default=None, metadata=field_metadata)
identifier_type: Optional[UnderlierType] = field(default=None, metadata=field_metadata)
underlier: Optional[str] = field(default=None, metadata=field_metadata)
multiplier: Optional[float] = field(default=None, metadata=field_metadata)
expiration_date: Optional[Union[datetime.date, str]] = field(default=None, metadata=field_metadata)
buy_sell: Optional[BuySell] = field(default=None, metadata=field_metadata)
quantity: Optional[float] = field(default=None, metadata=field_metadata)
currency: Optional[Currency] = field(default=None, metadata=field_metadata)
traded_price: Optional[float] = field(default=0.0, metadata=field_metadata)
total_quantity: Optional[float] = field(default=None, metadata=field_metadata)
trade_as: Optional[str] = field(default=None, metadata=field_metadata)
denominated: Optional[Currency] = field(default=None, metadata=field_metadata)
asset_class: Optional[AssetClass] = field(init=False, default=AssetClass.Equity, metadata=field_metadata)
type_: Optional[AssetType] = field(init=False, default=AssetType.Future, metadata=config(field_name='type', exclude=exclude_none))
name: Optional[str] = field(default=None, metadata=name_metadata)
@handle_camel_case_args
@dataclass_json(letter_case=LetterCase.CAMEL)
@dataclass(unsafe_hash=True, repr=False)
class EqOption(Instrument):
underlier: Optional[Union[float, str]] = field(default=None, metadata=field_metadata)
expiration_date: Optional[Union[datetime.date, str]] = field(default=None, metadata=field_metadata)
strike_price: Optional[Union[float, str]] = field(default=None, metadata=field_metadata)
option_type: Optional[OptionType] = field(default=None, metadata=field_metadata)
option_style: Optional[OptionStyle] = field(default=None, metadata=field_metadata)
number_of_options: Optional[Union[float, str]] = field(default=None, metadata=field_metadata)
exchange: Optional[str] = field(default=None, metadata=field_metadata)
multiplier: Optional[float] = field(default=None, metadata=field_metadata)
settlement_date: Optional[Union[datetime.date, str]] = field(default=None, metadata=field_metadata)
settlement_currency: Optional[Currency] = field(default=None, metadata=field_metadata)
premium: Optional[float] = field(default=0.0, metadata=field_metadata)
premium_payment_date: Optional[Union[datetime.date, str]] = field(default=None, metadata=field_metadata)
valuation_time: Optional[ValuationTime] = field(default=None, metadata=field_metadata)
method_of_settlement: Optional[OptionSettlementMethod] = field(default=None, metadata=field_metadata)
underlier_type: Optional[UnderlierType] = field(default=None, metadata=field_metadata)
buy_sell: Optional[BuySell] = field(default=None, metadata=field_metadata)
premium_currency: Optional[Currency] = field(default=None, metadata=field_metadata)
trade_as: Optional[TradeAs] = field(default=None, metadata=field_metadata)
future_contract: Optional[str] = field(default=None, metadata=field_metadata)
asset_class: Optional[AssetClass] = field(init=False, default=AssetClass.Equity, metadata=field_metadata)
type_: Optional[AssetType] = field(init=False, default=AssetType.Option, metadata=config(field_name='type', exclude=exclude_none))
name: Optional[str] = field(default=None, metadata=name_metadata)
def scale_in_place(self, scaling: Optional[float] = None):
if self.unresolved is None:
raise RuntimeError('Can only scale resolved instruments')
if scaling is None or scaling == 1:
return
if scaling < 0:
flip_dict = {BuySell.Buy: BuySell.Sell, BuySell.Sell: BuySell.Buy}
self.buy_sell = flip_dict[self.buy_sell]
self.number_of_options *= abs(scaling)
return
@handle_camel_case_args
@dataclass_json(letter_case=LetterCase.CAMEL)
@dataclass(unsafe_hash=True, repr=False)
class EqOptionLeg(Instrument):
method_of_settlement: Optional[OptionSettlementMethod] = field(default=None, metadata=field_metadata)
premium_payment_date: Optional[Union[datetime.date, str]] = field(default=None, metadata=field_metadata)
buy_sell: Optional[BuySell] = field(default=None, metadata=field_metadata)
option_style: Optional[OptionStyle] = field(default=None, metadata=field_metadata)
multiplier: Optional[float] = field(default=None, metadata=field_metadata)
number_of_options: Optional[float] = field(default=None, metadata=field_metadata)
settlement_date: Optional[Union[datetime.date, str]] = field(default=None, metadata=field_metadata)
valuation_time: Optional[ValuationTime] = field(default=None, metadata=field_metadata)
option_type: Optional[OptionType] = field(default=None, metadata=field_metadata)
settlement_currency: Optional[Currency] = field(default=None, metadata=field_metadata)
premium: Optional[float] = field(default=None, metadata=field_metadata)
premium_currency: Optional[Currency] = field(default=None, metadata=field_metadata)
trade_as: Optional[TradeAs] = field(default=None, metadata=field_metadata)
exchange: Optional[str] = field(default=None, metadata=field_metadata)
strike_price: Optional[Union[float, str]] = field(default=None, metadata=field_metadata)
expiration_date: Optional[Union[datetime.date, str]] = field(default=None, metadata=field_metadata)
asset_class: Optional[AssetClass] = field(init=False, default=AssetClass.Equity, metadata=field_metadata)
type_: Optional[AssetType] = field(init=False, default=AssetType.OptionLeg, metadata=config(field_name='type', exclude=exclude_none))
name: Optional[str] = field(default=None, metadata=name_metadata)
@handle_camel_case_args
@dataclass_json(letter_case=LetterCase.CAMEL)
@dataclass(unsafe_hash=True, repr=False)
class EqStock(Instrument):
identifier: Optional[str] = field(default=None, metadata=field_metadata)
identifier_type: Optional[UnderlierType] = field(default=None, metadata=field_metadata)
buy_sell: Optional[BuySell] = field(default=None, metadata=field_metadata)
traded_price: Optional[float] = field(default=0.0, metadata=field_metadata)
currency: Optional[Currency] = field(default=None, metadata=field_metadata)
quantity: Optional[float] = field(default=None, metadata=field_metadata)
settlement_date: Optional[datetime.date] = field(default=None, metadata=field_metadata)
asset_class: Optional[AssetClass] = field(init=False, default=AssetClass.Equity, metadata=field_metadata)
type_: Optional[AssetType] = field(init=False, default=AssetType.Single_Stock, metadata=config(field_name='type', exclude=exclude_none))
name: Optional[str] = field(default=None, metadata=name_metadata)
@handle_camel_case_args
@dataclass_json(letter_case=LetterCase.CAMEL)
@dataclass(unsafe_hash=True, repr=False)
class EqSyntheticLeg(Instrument):
schedule_type: Optional[str] = field(default=None, metadata=field_metadata)
first_roll_date: Optional[str] = field(default=None, metadata=field_metadata)
first_roll_date_day_of_month: Optional[float] = field(default=None, metadata=field_metadata)
payment_schedule: Optional[Tuple[EqSyntheticSchedule, ...]] = field(default=None, metadata=field_metadata)
reset_schedule: Optional[Tuple[EqSyntheticSchedule, ...]] = field(default=None, metadata=field_metadata)
valuation_schedule: Optional[Tuple[EqSyntheticSchedule, ...]] = field(default=None, metadata=field_metadata)
asset_class: Optional[AssetClass] = field(init=False, default=AssetClass.Equity, metadata=field_metadata)
type_: Optional[AssetType] = field(init=False, default=AssetType.SyntheticLeg, metadata=config(field_name='type', exclude=exclude_none))
name: Optional[str] = field(default=None, metadata=name_metadata)
@handle_camel_case_args
@dataclass_json(letter_case=LetterCase.CAMEL)
@dataclass(unsafe_hash=True, repr=False)
class EqVarianceSwap(Instrument):
underlier: Optional[Union[float, str]] = field(default=None, metadata=field_metadata)
underlier_type: Optional[UnderlierType] = field(default=None, metadata=field_metadata)
expiration_date: Optional[Union[datetime.date, str]] = field(default=None, metadata=field_metadata)
strike_price: Optional[Union[float, str]] = field(default=None, metadata=field_metadata)
variance_cap: Optional[Union[float, str]] = field(default=None, metadata=field_metadata)
settlement_date: Optional[Union[datetime.date, str]] = field(default=None, metadata=field_metadata)
premium: Optional[Union[float, str]] = field(default=None, metadata=field_metadata)
buy_sell: Optional[BuySell] = field(default=None, metadata=field_metadata)
days_in_contract: Optional[float] = field(default=None, metadata=field_metadata)
valuation_time: Optional[ValuationTime] = field(default=None, metadata=field_metadata)
denominated: Optional[Currency] = field(default=None, metadata=field_metadata)
fixing_schedule_dates: Optional[Tuple[str, ...]] = field(default=None, metadata=field_metadata)
holiday_calendar: Optional[str] = field(default=None, metadata=field_metadata)
initial_date: Optional[Union[datetime.date, str]] = field(default=None, metadata=field_metadata)
quantity: Optional[Union[float, str]] = field(default=None, metadata=field_metadata)
initial_spot: Optional[float] = field(default=None, metadata=field_metadata)
expiry_settlement_days: Optional[str] = field(default=None, metadata=field_metadata)
initial_spot_source_flag: Optional[float] = field(default=None, metadata=field_metadata)
force_forward_tradable: Optional[bool] = field(default=None, metadata=field_metadata)
asset_class: Optional[AssetClass] = field(init=False, default=AssetClass.Equity, metadata=field_metadata)
type_: Optional[AssetType] = field(init=False, default=AssetType.VarianceSwap, metadata=config(field_name='type', exclude=exclude_none))
name: Optional[str] = field(default=None, metadata=name_metadata)
@handle_camel_case_args
@dataclass_json(letter_case=LetterCase.CAMEL)
@dataclass(unsafe_hash=True, repr=False)
class EqVolatilitySwap(Instrument):
underlier: Optional[Union[float, str]] = field(default=None, metadata=field_metadata)
underlier_type: Optional[UnderlierType] = field(default=None, metadata=field_metadata)
expiration_date: Optional[Union[datetime.date, str]] = field(default=None, metadata=field_metadata)
strike_price: Optional[Union[float, str]] = field(default=None, metadata=field_metadata)
variance_cap: Optional[Union[float, str]] = field(default=None, metadata=field_metadata)
settlement_date: Optional[Union[datetime.date, str]] = field(default=None, metadata=field_metadata)
premium: Optional[Union[float, str]] = field(default=None, metadata=field_metadata)
buy_sell: Optional[BuySell] = field(default=None, metadata=field_metadata)
days_in_contract: Optional[float] = field(default=None, metadata=field_metadata)
valuation_time: Optional[ValuationTime] = field(default=None, metadata=field_metadata)
denominated: Optional[Currency] = field(default=None, metadata=field_metadata)
fixing_schedule_dates: Optional[Tuple[str, ...]] = field(default=None, metadata=field_metadata)
holiday_calendar: Optional[str] = field(default=None, metadata=field_metadata)
initial_date: Optional[Union[datetime.date, str]] = field(default=None, metadata=field_metadata)
quantity: Optional[Union[float, str]] = field(default=None, metadata=field_metadata)
initial_spot: Optional[float] = field(default=None, metadata=field_metadata)
expiry_settlement_days: Optional[str] = field(default=None, metadata=field_metadata)
asset_class: Optional[AssetClass] = field(init=False, default=AssetClass.Equity, metadata=field_metadata)
type_: Optional[AssetType] = field(init=False, default=AssetType.VolatilitySwap, metadata=config(field_name='type', exclude=exclude_none))
name: Optional[str] = field(default=None, metadata=name_metadata)
@handle_camel_case_args
@dataclass_json(letter_case=LetterCase.CAMEL)
@dataclass(unsafe_hash=True, repr=False)
class FXAccumulatorScheduleLeg(Instrument):
strike: Optional[Union[float, str]] = field(default=None, metadata=field_metadata)
european_knock_in: Optional[Union[float, str]] = field(default=None, metadata=field_metadata)
knock_out_level: Optional[Union[float, str]] = field(default=None, metadata=field_metadata)
fixing_date: Optional[Union[datetime.date, str]] = field(default=None, metadata=field_metadata)
payment_date: Optional[Union[datetime.date, str]] = field(default=None, metadata=field_metadata)
notional_amount: Optional[Union[float, str]] = field(default=None, metadata=field_metadata)
leverage_ratio: Optional[Union[float, str]] = field(default=None, metadata=field_metadata)
asset_class: Optional[AssetClass] = field(init=False, default=AssetClass.FX, metadata=field_metadata)
type_: Optional[AssetType] = field(init=False, default=AssetType.AccumulatorScheduleLeg, metadata=config(field_name='type', exclude=exclude_none))
name: Optional[str] = field(default=None, metadata=name_metadata)
@handle_camel_case_args
@dataclass_json(letter_case=LetterCase.CAMEL)
@dataclass(unsafe_hash=True, repr=False)
class FXBinary(Instrument):
pair: Optional[str] = field(default=None, metadata=field_metadata)
buy_sell: Optional[BuySell] = field(default=None, metadata=field_metadata)
option_type: Optional[OptionType] = field(default=None, metadata=field_metadata)
notional_amount: Optional[Union[float, str]] = field(default=None, metadata=field_metadata)
notional_currency: Optional[Currency] = field(default=None, metadata=field_metadata)
strike_price: Optional[Union[float, str]] = field(default=None, metadata=field_metadata)
settlement_date: Optional[Union[datetime.date, str]] = field(default=None, metadata=field_metadata)
expiration_date: Optional[Union[datetime.date, str]] = field(default=None, metadata=field_metadata)
expiration_time: Optional[str] = field(default=None, metadata=field_metadata)
premium: Optional[Union[float, str]] = field(default=None, metadata=field_metadata)
premium_currency: Optional[Currency] = field(default=None, metadata=field_metadata)
premium_payment_date: Optional[str] = field(default=None, metadata=field_metadata)
settlement_rate_option: Optional[str] = field(default=None, metadata=field_metadata)
asset_class: Optional[AssetClass] = field(init=False, default=AssetClass.FX, metadata=field_metadata)
type_: Optional[AssetType] = field(init=False, default=AssetType.Binary, metadata=config(field_name='type', exclude=exclude_none))
name: Optional[str] = field(default=None, metadata=name_metadata)
@handle_camel_case_args
@dataclass_json(letter_case=LetterCase.CAMEL)
@dataclass(unsafe_hash=True, repr=False)
class FXCorrelationSwap(Instrument):
legs: Tuple[FXCorrelationSwapLeg, ...] = field(default=None, metadata=field_metadata)
buy_sell: Optional[BuySell] = field(default=None, metadata=field_metadata)
strike_corr: Optional[Union[float, str]] = field(default=None, metadata=field_metadata)
notional_currency: Optional[Currency] = field(default=None, metadata=field_metadata)
notional_amount: Optional[Union[float, str]] = field(default=None, metadata=field_metadata)
first_fixing_date: Optional[Union[datetime.date, str]] = field(default=None, metadata=field_metadata)
last_fixing_date: Optional[Union[datetime.date, str]] = field(default=None, metadata=field_metadata)
settlement_date: Optional[Union[datetime.date, str]] = field(default=None, metadata=field_metadata)
fixing_source: Optional[str] = field(default=None, metadata=field_metadata)
fixing_frequency: Optional[str] = field(default=None, metadata=field_metadata)
calculate_mean_return: Optional[float] = field(default=0.0, metadata=field_metadata)
premium: Optional[Union[float, str]] = field(default=0, metadata=field_metadata)
premium_currency: Optional[Currency] = field(default=None, metadata=field_metadata)
premium_payment_date: Optional[str] = field(default=None, metadata=field_metadata)
asset_class: Optional[AssetClass] = field(init=False, default=AssetClass.FX, metadata=field_metadata)
type_: Optional[AssetType] = field(init=False, default=AssetType.CorrelationSwap, metadata=config(field_name='type', exclude=exclude_none))
name: Optional[str] = field(default=None, metadata=name_metadata)
@handle_camel_case_args
@dataclass_json(letter_case=LetterCase.CAMEL)
@dataclass(unsafe_hash=True, repr=False)
class FXDoubleKnockout(Instrument):
pair: Optional[str] = field(default=None, metadata=field_metadata)
buy_sell: Optional[BuySell] = field(default=None, metadata=field_metadata)
option_type: Optional[OptionType] = field(default=None, metadata=field_metadata)
notional_amount: Optional[Union[float, str]] = field(default=None, metadata=field_metadata)
notional_currency: Optional[Currency] = field(default=None, metadata=field_metadata)
strike_price: Optional[Union[float, str]] = field(default=None, metadata=field_metadata)
settlement_date: Optional[Union[datetime.date, str]] = field(default=None, metadata=field_metadata)
settlement_currency: Optional[Currency] = field(default=None, metadata=field_metadata)
settlement_rate_option: Optional[str] = field(default=None, metadata=field_metadata)
method_of_settlement: Optional[OptionSettlementMethod] = field(default=None, metadata=field_metadata)
expiration_date: Optional[Union[datetime.date, str]] = field(default=None, metadata=field_metadata)
expiration_time: Optional[str] = field(default=None, metadata=field_metadata)
premium: Optional[Union[float, str]] = field(default=None, metadata=field_metadata)
premium_currency: Optional[Currency] = field(default=None, metadata=field_metadata)
premium_payment_date: Optional[str] = field(default=None, metadata=field_metadata)
knock_in_or_out: Optional[InOut] = field(default=None, metadata=field_metadata)
lower_barrier_level: Optional[Union[float, str]] = field(default=None, metadata=field_metadata)
upper_barrier_level: Optional[Union[float, str]] = field(default=None, metadata=field_metadata)
knockout_convention: Optional[KnockoutConvention] = field(default=None, metadata=field_metadata)
asset_class: Optional[AssetClass] = field(init=False, default=AssetClass.FX, metadata=field_metadata)
type_: Optional[AssetType] = field(init=False, default=AssetType.DoubleKnockout, metadata=config(field_name='type', exclude=exclude_none))
name: Optional[str] = field(default=None, metadata=name_metadata)
@handle_camel_case_args
@dataclass_json(letter_case=LetterCase.CAMEL)
@dataclass(unsafe_hash=True, repr=False)
class FXDoubleOneTouch(Instrument):
pair: Optional[str] = field(default=None, metadata=field_metadata)
buy_sell: Optional[BuySell] = field(default=None, metadata=field_metadata)
notional_amount: Optional[Union[float, str]] = field(default=None, metadata=field_metadata)
notional_currency: Optional[Currency] = field(default=None, metadata=field_metadata)
settlement_date: Optional[Union[datetime.date, str]] = field(default=None, metadata=field_metadata)
settlement_currency: Optional[Currency] = field(default=None, metadata=field_metadata)
settlement_rate_option: Optional[str] = field(default=None, metadata=field_metadata)
method_of_settlement: Optional[OptionSettlementMethod] = field(default=None, metadata=field_metadata)
expiration_date: Optional[Union[datetime.date, str]] = field(default=None, metadata=field_metadata)
expiration_time: Optional[str] = field(default=None, metadata=field_metadata)
premium: Optional[Union[float, str]] = field(default=None, metadata=field_metadata)
premium_currency: Optional[Currency] = field(default=None, metadata=field_metadata)
premium_payment_date: Optional[str] = field(default=None, metadata=field_metadata)
lower_barrier_level: Optional[Union[float, str]] = field(default=None, metadata=field_metadata)
upper_barrier_level: Optional[Union[float, str]] = field(default=None, metadata=field_metadata)
payout_type: Optional[PayoutType] = field(default=None, metadata=field_metadata)
knockout_convention: Optional[KnockoutConvention] = field(default=None, metadata=field_metadata)
touch_or_no_touch: Optional[TouchNoTouch] = field(default=None, metadata=field_metadata)
asset_class: Optional[AssetClass] = field(init=False, default=AssetClass.FX, metadata=field_metadata)
type_: Optional[AssetType] = field(init=False, default=AssetType.DoubleTouch, metadata=config(field_name='type', exclude=exclude_none))
name: Optional[str] = field(default=None, metadata=name_metadata)
@handle_camel_case_args
@dataclass_json(letter_case=LetterCase.CAMEL)
@dataclass(unsafe_hash=True, repr=False)
class FXDualDoubleKnockoutLeg(Instrument):
pair: Optional[str] = field(default=None, metadata=field_metadata)
lower_barrier_level: Optional[Union[float, str]] = field(default=None, metadata=field_metadata)
upper_barrier_level: Optional[Union[float, str]] = field(default=None, metadata=field_metadata)
knockout_convention: Optional[KnockoutConvention] = field(default=None, metadata=field_metadata)
asset_class: Optional[AssetClass] = field(init=False, default=AssetClass.FX, metadata=field_metadata)
type_: Optional[AssetType] = field(init=False, default=AssetType.DualDoubleKnockoutLeg, metadata=config(field_name='type', exclude=exclude_none))
name: Optional[str] = field(default=None, metadata=name_metadata)
@handle_camel_case_args
@dataclass_json(letter_case=LetterCase.CAMEL)
@dataclass(unsafe_hash=True, repr=False)
class FXEuropeanKnockout(Instrument):
pair: Optional[str] = field(default=None, metadata=field_metadata)
buy_sell: Optional[BuySell] = field(default=None, metadata=field_metadata)
option_type: Optional[OptionType] = field(default=None, metadata=field_metadata)
notional_amount: Optional[Union[float, str]] = field(default=None, metadata=field_metadata)
notional_currency: Optional[Currency] = field(default=None, metadata=field_metadata)
strike_price: Optional[Union[float, str]] = field(default=None, metadata=field_metadata)
settlement_date: Optional[Union[datetime.date, str]] = field(default=None, metadata=field_metadata)
settlement_currency: Optional[Currency] = field(default=None, metadata=field_metadata)
expiration_date: Optional[str] = field(default=None, metadata=field_metadata)
expiration_time: Optional[str] = field(default=None, metadata=field_metadata)
premium: Optional[Union[float, str]] = field(default=None, metadata=field_metadata)
premium_currency: Optional[Currency] = field(default=None, metadata=field_metadata)
premium_payment_date: Optional[str] = field(default=None, metadata=field_metadata)
settlement_rate_option: Optional[str] = field(default=None, metadata=field_metadata)
method_of_settlement: Optional[OptionSettlementMethod] = field(default=None, metadata=field_metadata)
barrier_level: Optional[Union[float, str]] = field(default=None, metadata=field_metadata)
knock_up_or_down: Optional[UpDown] = field(default=None, metadata=field_metadata)
knock_in_or_out: Optional[InOut] = field(default=None, metadata=field_metadata)
asset_class: Optional[AssetClass] = field(init=False, default=AssetClass.FX, metadata=field_metadata)
type_: Optional[AssetType] = field(init=False, default=AssetType.EuropeanKnockout, metadata=config(field_name='type', exclude=exclude_none))
name: Optional[str] = field(default=None, metadata=name_metadata)
@handle_camel_case_args
@dataclass_json(letter_case=LetterCase.CAMEL)
@dataclass(unsafe_hash=True, repr=False)
class FXForward(Instrument):
pair: Optional[str] = field(default=None, metadata=field_metadata)
settlement_date: Optional[Union[datetime.date, str]] = field(default=None, metadata=field_metadata)
forward_rate: Optional[Union[float, str]] = field(default=None, metadata=field_metadata)
notional_amount: Optional[Union[float, str]] = field(default=None, metadata=field_metadata)
notional_currency: Optional[Currency] = field(default=None, metadata=field_metadata)
notional_amount_in_other_currency: Optional[Union[float, str]] = field(default=None, metadata=field_metadata)
buy_sell: Optional[BuySell] = field(default=None, metadata=field_metadata)
asset_class: Optional[AssetClass] = field(init=False, default=AssetClass.FX, metadata=field_metadata)
type_: Optional[AssetType] = field(init=False, default=AssetType.Forward, metadata=config(field_name='type', exclude=exclude_none))
name: Optional[str] = field(default=None, metadata=name_metadata)
@handle_camel_case_args
@dataclass_json(letter_case=LetterCase.CAMEL)
@dataclass(unsafe_hash=True, repr=False)
class FXKnockout(Instrument):
pair: Optional[str] = field(default=None, metadata=field_metadata)
buy_sell: Optional[BuySell] = field(default=None, metadata=field_metadata)
option_type: Optional[OptionType] = field(default=None, metadata=field_metadata)
notional_amount: Optional[Union[float, str]] = field(default=None, metadata=field_metadata)
notional_currency: Optional[Currency] = field(default=None, metadata=field_metadata)
strike_price: Optional[Union[float, str]] = field(default=None, metadata=field_metadata)
settlement_date: Optional[Union[datetime.date, str]] = field(default=None, metadata=field_metadata)
settlement_currency: Optional[Currency] = field(default=None, metadata=field_metadata)
settlement_rate_option: Optional[str] = field(default=None, metadata=field_metadata)
method_of_settlement: Optional[OptionSettlementMethod] = field(default=None, metadata=field_metadata)
expiration_date: Optional[Union[datetime.date, str]] = field(default=None, metadata=field_metadata)
expiration_time: Optional[str] = field(default=None, metadata=field_metadata)
premium: Optional[Union[float, str]] = field(default=None, metadata=field_metadata)
premium_currency: Optional[Currency] = field(default=None, metadata=field_metadata)
premium_payment_date: Optional[str] = field(default=None, metadata=field_metadata)
knock_in_or_out: Optional[InOut] = field(default=None, metadata=field_metadata)
knock_up_or_down: Optional[UpDown] = field(default=None, metadata=field_metadata)
barrier_level: Optional[Union[float, str]] = field(default=None, metadata=field_metadata)
knockout_convention: Optional[KnockoutConvention] = field(default=None, metadata=field_metadata)
asset_class: Optional[AssetClass] = field(init=False, default=AssetClass.FX, metadata=field_metadata)
type_: Optional[AssetType] = field(init=False, default=AssetType.Knockout, metadata=config(field_name='type', exclude=exclude_none))
name: Optional[str] = field(default=None, metadata=name_metadata)
@handle_camel_case_args
@dataclass_json(letter_case=LetterCase.CAMEL)
@dataclass(unsafe_hash=True, repr=False)
class FXMultiCrossBinaryLeg(Instrument):
pair: Optional[str] = field(default=None, metadata=field_metadata)
option_type: Optional[OptionType] = field(default=None, metadata=field_metadata)
strike_price: Optional[Union[float, str]] = field(default=None, metadata=field_metadata)
fixing_source: Optional[str] = field(default=None, metadata=field_metadata)
asset_class: Optional[AssetClass] = field(init=False, default=AssetClass.FX, metadata=field_metadata)
type_: Optional[AssetType] = field(init=False, default=AssetType.MultiCrossBinaryLeg, metadata=config(field_name='type', exclude=exclude_none))
name: Optional[str] = field(default=None, metadata=name_metadata)
@handle_camel_case_args
@dataclass_json(letter_case=LetterCase.CAMEL)
@dataclass(unsafe_hash=True, repr=False)
class FXMultiCrossDoubleBinaryLeg(Instrument):
pair: Optional[str] = field(default=None, metadata=field_metadata)
lower_barrier_level: Optional[Union[float, str]] = field(default=None, metadata=field_metadata)
upper_barrier_level: Optional[Union[float, str]] = field(default=None, metadata=field_metadata)
fixing_source: Optional[str] = field(default=None, metadata=field_metadata)
asset_class: Optional[AssetClass] = field(init=False, default=AssetClass.FX, metadata=field_metadata)
type_: Optional[AssetType] = field(init=False, default=AssetType.MultiCrossDoubleBinaryLeg, metadata=config(field_name='type', exclude=exclude_none))
name: Optional[str] = field(default=None, metadata=name_metadata)
@handle_camel_case_args
@dataclass_json(letter_case=LetterCase.CAMEL)
@dataclass(unsafe_hash=True, repr=False)
class FXMultiCrossDoubleOneTouchLeg(Instrument):
pair: Optional[str] = field(default=None, metadata=field_metadata)
lower_barrier_level: Optional[Union[float, str]] = field(default=None, metadata=field_metadata)
upper_barrier_level: Optional[Union[float, str]] = field(default=None, metadata=field_metadata)
knockout_convention: Optional[KnockoutConvention] = field(default=None, metadata=field_metadata)
asset_class: Optional[AssetClass] = field(init=False, default=AssetClass.FX, metadata=field_metadata)
type_: Optional[AssetType] = field(init=False, default=AssetType.MultiCrossDoubleTouchLeg, metadata=config(field_name='type', exclude=exclude_none))
name: Optional[str] = field(default=None, metadata=name_metadata)
@handle_camel_case_args
@dataclass_json(letter_case=LetterCase.CAMEL)
@dataclass(unsafe_hash=True, repr=False)
class FXOneTouch(Instrument):
pair: Optional[str] = field(default=None, metadata=field_metadata)
buy_sell: Optional[BuySell] = field(default=None, metadata=field_metadata)
notional_amount: Optional[Union[float, str]] = field(default=None, metadata=field_metadata)
notional_currency: Optional[Currency] = field(default=None, metadata=field_metadata)
strike_price: Optional[Union[float, str]] = field(default=None, metadata=field_metadata)
settlement_date: Optional[Union[datetime.date, str]] = field(default=None, metadata=field_metadata)
settlement_currency: Optional[Currency] = field(default=None, metadata=field_metadata)
settlement_rate_option: Optional[str] = field(default=None, metadata=field_metadata)
method_of_settlement: Optional[OptionSettlementMethod] = field(default=None, metadata=field_metadata)
expiration_date: Optional[Union[datetime.date, str]] = field(default=None, metadata=field_metadata)
expiration_time: Optional[str] = field(default=None, metadata=field_metadata)
premium: Optional[Union[float, str]] = field(default=None, metadata=field_metadata)
premium_currency: Optional[Currency] = field(default=None, metadata=field_metadata)
premium_payment_date: Optional[str] = field(default=None, metadata=field_metadata)
knock_up_or_down: Optional[UpDown] = field(default=None, metadata=field_metadata)
knockout_convention: Optional[KnockoutConvention] = field(default=None, metadata=field_metadata)
touch_or_no_touch: Optional[TouchNoTouch] = field(default=None, metadata=field_metadata)
payout_type: Optional[PayoutType] = field(default=None, metadata=field_metadata)
asset_class: Optional[AssetClass] = field(init=False, default=AssetClass.FX, metadata=field_metadata)
type_: Optional[AssetType] = field(init=False, default=AssetType.OneTouch, metadata=config(field_name='type', exclude=exclude_none))
name: Optional[str] = field(default=None, metadata=name_metadata)
@handle_camel_case_args
@dataclass_json(letter_case=LetterCase.CAMEL)
@dataclass(unsafe_hash=True, repr=False)
class FXOption(Instrument):
pair: Optional[str] = field(default=None, metadata=field_metadata)
buy_sell: Optional[BuySell] = field(default=None, metadata=field_metadata)
option_type: Optional[OptionType] = field(default=None, metadata=field_metadata)
notional_amount: Optional[Union[float, str]] = field(default=None, metadata=field_metadata)
notional_currency: Optional[Currency] = field(default=None, metadata=field_metadata)
notional_amount_in_other_currency: Optional[Union[float, str]] = field(default=None, metadata=field_metadata)
strike_price: Optional[Union[float, str]] = field(default=None, metadata=field_metadata)
settlement_date: Optional[Union[datetime.date, str]] = field(default=None, metadata=field_metadata)
settlement_currency: Optional[Currency] = field(default=None, metadata=field_metadata)
settlement_rate_option: Optional[str] = field(default=None, metadata=field_metadata)
method_of_settlement: Optional[OptionSettlementMethod] = field(default=None, metadata=field_metadata)
expiration_date: Optional[Union[datetime.date, str]] = field(default=None, metadata=field_metadata)
expiration_time: Optional[str] = field(default=None, metadata=field_metadata)
premium: Optional[Union[float, str]] = field(default=None, metadata=field_metadata)
premium_currency: Optional[Currency] = field(default=None, metadata=field_metadata)
premium_payment_date: Optional[str] = field(default=None, metadata=field_metadata)
exercise_style: Optional[OptionExerciseStyle] = field(default=None, metadata=field_metadata)
asset_class: Optional[AssetClass] = field(init=False, default=AssetClass.FX, metadata=field_metadata)
type_: Optional[AssetType] = field(init=False, default=AssetType.Option, metadata=config(field_name='type', exclude=exclude_none))
name: Optional[str] = field(default=None, metadata=name_metadata)
@handle_camel_case_args
@dataclass_json(letter_case=LetterCase.CAMEL)
@dataclass(unsafe_hash=True, repr=False)
class FXOptionLeg(Instrument):
buy_sell: Optional[BuySell] = field(default=None, metadata=field_metadata)
option_type: Optional[OptionType] = field(default=None, metadata=field_metadata)
notional_amount: Optional[Union[float, str]] = field(default=None, metadata=field_metadata)
notional_currency: Optional[Currency] = field(default=None, metadata=field_metadata)
notional_amount_in_other_currency: Optional[Union[float, str]] = field(default=None, metadata=field_metadata)
strike_price: Optional[Union[float, str]] = field(default=None, metadata=field_metadata)
expiration_date: Optional[Union[datetime.date, str]] = field(default=None, metadata=field_metadata)
settlement_date: Optional[Union[datetime.date, str]] = field(default=None, metadata=field_metadata)
premium: Optional[Union[float, str]] = field(default=None, metadata=field_metadata)
premium_currency: Optional[Currency] = field(default=None, metadata=field_metadata)
premium_payment_date: Optional[str] = field(default=None, metadata=field_metadata)
settlement_currency: Optional[Currency] = field(default=None, metadata=field_metadata)
settlement_rate_option: Optional[str] = field(default=None, metadata=field_metadata)
method_of_settlement: Optional[OptionSettlementMethod] = field(default=None, metadata=field_metadata)
expiration_time: Optional[str] = field(default=None, metadata=field_metadata)
exercise_style: Optional[OptionExerciseStyle] = field(default=None, metadata=field_metadata)
asset_class: Optional[AssetClass] = field(init=False, default=AssetClass.FX, metadata=field_metadata)
type_: Optional[AssetType] = field(init=False, default=AssetType.OptionLeg, metadata=config(field_name='type', exclude=exclude_none))
name: Optional[str] = field(default=None, metadata=name_metadata)
@handle_camel_case_args
@dataclass_json(letter_case=LetterCase.CAMEL)
@dataclass(unsafe_hash=True, repr=False)
class FXPivotScheduleLeg(Instrument):
notional_amount: Optional[Union[float, str]] = field(default=None, metadata=field_metadata)
fixing_date: Optional[Union[datetime.date, str]] = field(default=None, metadata=field_metadata)
payment_date: Optional[Union[datetime.date, str]] = field(default=None, metadata=field_metadata)
lower_leverage_ratio: Optional[Union[float, str]] = field(default=None, metadata=field_metadata)
lower_knock_in: Optional[Union[float, str]] = field(default=None, metadata=field_metadata)
lower_strike: Optional[Union[float, str]] = field(default=None, metadata=field_metadata)
pivot: Optional[Union[float, str]] = field(default=None, metadata=field_metadata)
upper_strike: Optional[Union[float, str]] = field(default=None, metadata=field_metadata)
upper_knock_in: Optional[Union[float, str]] = field(default=None, metadata=field_metadata)
upper_leverage_ratio: Optional[Union[float, str]] = field(default=None, metadata=field_metadata)
asset_class: Optional[AssetClass] = field(init=False, default=AssetClass.FX, metadata=field_metadata)
type_: Optional[AssetType] = field(init=False, default=AssetType.PivotScheduleLeg, metadata=config(field_name='type', exclude=exclude_none))
name: Optional[str] = field(default=None, metadata=name_metadata)
@handle_camel_case_args
@dataclass_json(letter_case=LetterCase.CAMEL)
@dataclass(unsafe_hash=True, repr=False)
class FXShiftingBermForward(Instrument):
pair: Optional[str] = field(default=None, metadata=field_metadata)
buy_sell: Optional[BuySell] = field(default=None, metadata=field_metadata)
notional_amount: Optional[Union[float, str]] = field(default=None, metadata=field_metadata)
notional_currency: Optional[Currency] = field(default=None, metadata=field_metadata)
notional_amount_in_other_currency: Optional[Union[float, str]] = field(default=None, metadata=field_metadata)
strike_price: Optional[Union[float, str]] = field(default=None, metadata=field_metadata)
settlement_date: Optional[Union[datetime.date, str]] = field(default=None, metadata=field_metadata)
settlement_currency: Optional[Currency] = field(default=None, metadata=field_metadata)
expiration_date: Optional[Union[datetime.date, str]] = field(default=None, metadata=field_metadata)
window_start_date: Optional[str] = field(default=None, metadata=field_metadata)
exercise_decision_freq: Optional[str] = field(default=None, metadata=field_metadata)
premium: Optional[Union[float, str]] = field(default=None, metadata=field_metadata)
premium_currency: Optional[Currency] = field(default=None, metadata=field_metadata)
premium_payment_date: Optional[str] = field(default=None, metadata=field_metadata)
asset_class: Optional[AssetClass] = field(init=False, default=AssetClass.FX, metadata=field_metadata)
type_: Optional[AssetType] = field(init=False, default=AssetType.ShiftingBermForward, metadata=config(field_name='type', exclude=exclude_none))
name: Optional[str] = field(default=None, metadata=name_metadata)
@handle_camel_case_args
@dataclass_json(letter_case=LetterCase.CAMEL)
@dataclass(unsafe_hash=True, repr=False)
class FXTarfScheduleLeg(Instrument):
profit_strike: Optional[Union[float, str]] = field(default=None, metadata=field_metadata)
loss_strike: Optional[Union[float, str]] = field(default=None, metadata=field_metadata)
fixing_date: Optional[Union[datetime.date, str]] = field(default=None, metadata=field_metadata)
payment_date: Optional[Union[datetime.date, str]] = field(default=None, metadata=field_metadata)
notional_amount: Optional[Union[float, str]] = field(default=None, metadata=field_metadata)
european_knock_in: Optional[Union[float, str]] = field(default=None, metadata=field_metadata)
leverage_ratio: Optional[Union[float, str]] = field(default=None, metadata=field_metadata)
asset_class: Optional[AssetClass] = field(init=False, default=AssetClass.FX, metadata=field_metadata)
type_: Optional[AssetType] = field(init=False, default=AssetType.TarfScheduleLeg, metadata=config(field_name='type', exclude=exclude_none))
name: Optional[str] = field(default=None, metadata=name_metadata)
@handle_camel_case_args
@dataclass_json(letter_case=LetterCase.CAMEL)
@dataclass(unsafe_hash=True, repr=False)
class FXVarianceSwap(Instrument):
pair: Optional[str] = field(default=None, metadata=field_metadata)
buy_sell: Optional[BuySell] = field(default=None, metadata=field_metadata)
strike_vol: Optional[Union[float, str]] = field(default=None, metadata=field_metadata)
notional_currency: Optional[Currency] = field(default=None, metadata=field_metadata)
notional_amount: Optional[Union[float, str]] = field(default=None, metadata=field_metadata)
first_fixing_date: Optional[Union[datetime.date, str]] = field(default=None, metadata=field_metadata)
last_fixing_date: Optional[Union[datetime.date, str]] = field(default=None, metadata=field_metadata)
settlement_date: Optional[Union[datetime.date, str]] = field(default=None, metadata=field_metadata)
fixing_source: Optional[str] = field(default=None, metadata=field_metadata)
fixing_frequency: Optional[str] = field(default=None, metadata=field_metadata)
annualization_factor: Optional[float] = field(default=None, metadata=field_metadata)
calculate_mean_return: Optional[float] = field(default=0.0, metadata=field_metadata)
premium: Optional[Union[float, str]] = field(default=0, metadata=field_metadata)
premium_currency: Optional[Currency] = field(default=None, metadata=field_metadata)
premium_payment_date: Optional[str] = field(default=None, metadata=field_metadata)
asset_class: Optional[AssetClass] = field(init=False, default=AssetClass.FX, metadata=field_metadata)
type_: Optional[AssetType] = field(init=False, default=AssetType.VarianceSwap, metadata=config(field_name='type', exclude=exclude_none))
name: Optional[str] = field(default=None, metadata=name_metadata)
@handle_camel_case_args
@dataclass_json(letter_case=LetterCase.CAMEL)
@dataclass(unsafe_hash=True, repr=False)
class FXVolatilitySwap(Instrument):
pair: Optional[str] = field(default=None, metadata=field_metadata)
buy_sell: Optional[BuySell] = field(default=None, metadata=field_metadata)
strike_vol: Optional[Union[float, str]] = field(default=None, metadata=field_metadata)
notional_currency: Optional[Currency] = field(default=None, metadata=field_metadata)
notional_amount: Optional[Union[float, str]] = field(default=None, metadata=field_metadata)
first_fixing_date: Optional[Union[datetime.date, str]] = field(default=None, metadata=field_metadata)
last_fixing_date: Optional[Union[datetime.date, str]] = field(default=None, metadata=field_metadata)
settlement_date: Optional[Union[datetime.date, str]] = field(default=None, metadata=field_metadata)
fixing_source: Optional[str] = field(default=None, metadata=field_metadata)
fixing_frequency: Optional[str] = field(default=None, metadata=field_metadata)
annualization_factor: Optional[float] = field(default=None, metadata=field_metadata)
calculate_mean_return: Optional[float] = field(default=0.0, metadata=field_metadata)
premium: Optional[Union[float, str]] = field(default=0, metadata=field_metadata)
premium_currency: Optional[Currency] = field(default=None, metadata=field_metadata)
premium_payment_date: Optional[str] = field(default=None, metadata=field_metadata)
asset_class: Optional[AssetClass] = field(init=False, default=AssetClass.FX, metadata=field_metadata)
type_: Optional[AssetType] = field(init=False, default=AssetType.VolatilitySwap, metadata=config(field_name='type', exclude=exclude_none))
name: Optional[str] = field(default=None, metadata=name_metadata)
@handle_camel_case_args
@dataclass_json(letter_case=LetterCase.CAMEL)
@dataclass(unsafe_hash=True, repr=False)
class FXWorstOfKOLeg(Instrument):
pair: Optional[str] = field(default=None, metadata=field_metadata)
option_type: Optional[OptionType] = field(default=None, metadata=field_metadata)
strike_price: Optional[Union[float, str]] = field(default=None, metadata=field_metadata)
expiration_date: Optional[Union[datetime.date, str]] = field(default=None, metadata=field_metadata)
settlement_date: Optional[Union[datetime.date, str]] = field(default=None, metadata=field_metadata)
knock_up_or_down: Optional[UpDown] = field(default=None, metadata=field_metadata)
knock_in_or_out: Optional[InOut] = field(default=None, metadata=field_metadata)
barrier_level: Optional[Union[float, str]] = field(default=None, metadata=field_metadata)
knockout_convention: Optional[KnockoutConvention] = field(default=None, metadata=field_metadata)
settlement_rate_option: Optional[str] = field(default=None, metadata=field_metadata)
expiration_time: Optional[str] = field(default=None, metadata=field_metadata)
asset_class: Optional[AssetClass] = field(init=False, default=AssetClass.FX, metadata=field_metadata)
type_: Optional[AssetType] = field(init=False, default=AssetType.WorstOfKOLeg, metadata=config(field_name='type', exclude=exclude_none))
name: Optional[str] = field(default=None, metadata=name_metadata)
@handle_camel_case_args
@dataclass_json(letter_case=LetterCase.CAMEL)
@dataclass(unsafe_hash=True, repr=False)
class FXWorstOfLeg(Instrument):
pair: Optional[str] = field(default=None, metadata=field_metadata)
notional_scale_factor: Optional[float] = field(default=None, metadata=field_metadata)
option_type: Optional[OptionType] = field(default=None, metadata=field_metadata)
strike_price: Optional[Union[float, str]] = field(default=None, metadata=field_metadata)
expiration_date: Optional[Union[datetime.date, str]] = field(default=None, metadata=field_metadata)
settlement_currency: Optional[Currency] = field(default=None, metadata=field_metadata)
settlement_rate_option: Optional[str] = field(default=None, metadata=field_metadata)
method_of_settlement: Optional[OptionSettlementMethod] = field(default=None, metadata=field_metadata)
expiration_time: Optional[str] = field(default=None, metadata=field_metadata)
asset_class: Optional[AssetClass] = field(init=False, default=AssetClass.FX, metadata=field_metadata)
type_: Optional[AssetType] = field(init=False, default=AssetType.WorstOfLeg, metadata=config(field_name='type', exclude=exclude_none))
name: Optional[str] = field(default=None, metadata=name_metadata)
@handle_camel_case_args
@dataclass_json(letter_case=LetterCase.CAMEL)
@dataclass(unsafe_hash=True, repr=False)