1818class Side (enum .StrEnum ):
1919 """Side of the market"""
2020
21- bid = enum .auto ()
22- ask = enum .auto ()
21+ BID = enum .auto ()
22+ ASK = enum .auto ()
2323
2424
2525class OptionType (enum .StrEnum ):
2626 """Type of option"""
2727
28- call = enum .auto ()
29- put = enum .auto ()
28+ CALL = enum .auto ()
29+ PUT = enum .auto ()
3030
3131 def is_call (self ) -> bool :
32- return self is OptionType .call
32+ return self is OptionType .CALL
3333
3434 def is_put (self ) -> bool :
35- return self is OptionType .put
35+ return self is OptionType .PUT
3636
3737 def call_put (self ) -> int :
3838 """Return 1 for call options and -1 for put options"""
39- return 1 if self is OptionType .call else - 1
39+ return 1 if self is OptionType .CALL else - 1
4040
4141
4242class OptionMetadata (BaseModel ):
@@ -65,9 +65,9 @@ def is_in_the_money(self, forward: Decimal) -> bool:
6565class VolSecurityType (enum .StrEnum ):
6666 """Type of security for the volatility surface"""
6767
68- spot = enum .auto ()
69- forward = enum .auto ()
70- option = enum .auto ()
68+ SPOT = enum .auto ()
69+ FORWARD = enum .auto ()
70+ OPTION = enum .auto ()
7171
7272
7373class VolSurfaceSecurity (BaseModel ):
@@ -84,7 +84,7 @@ def forward(cls) -> Self:
8484
8585class DefaultVolSecurity (VolSurfaceSecurity ):
8686 security_type : VolSecurityType = Field (
87- default = VolSecurityType .spot ,
87+ default = VolSecurityType .SPOT ,
8888 description = "Type of security for the volatility surface" ,
8989 )
9090
@@ -93,22 +93,22 @@ def vol_surface_type(self) -> VolSecurityType:
9393
9494 @classmethod
9595 def spot (cls ) -> Self :
96- return cls (security_type = VolSecurityType .spot )
96+ return cls (security_type = VolSecurityType .SPOT )
9797
9898 @classmethod
9999 def forward (cls ) -> Self :
100- return cls (security_type = VolSecurityType .forward )
100+ return cls (security_type = VolSecurityType .FORWARD )
101101
102102 @classmethod
103103 def option (cls ) -> Self :
104- return cls (security_type = VolSecurityType .option )
104+ return cls (security_type = VolSecurityType .OPTION )
105105
106106
107107class SpotInput (PriceVolume ):
108108 """Input data for a spot contract in the volatility surface"""
109109
110110 security_type : VolSecurityType = Field (
111- default = VolSecurityType .spot ,
111+ default = VolSecurityType .SPOT ,
112112 description = "Type of security for the volatility surface" ,
113113 )
114114
@@ -118,7 +118,7 @@ class ForwardInput(PriceVolume):
118118
119119 maturity : datetime = Field (description = "Expiry date of the forward contract" )
120120 security_type : VolSecurityType = Field (
121- default = VolSecurityType .forward ,
121+ default = VolSecurityType .FORWARD ,
122122 description = "Type of security for the volatility surface" ,
123123 )
124124
@@ -127,7 +127,7 @@ class OptionInput(PriceVolume, OptionMetadata):
127127 """Input data for an option in the volatility surface"""
128128
129129 security_type : VolSecurityType = Field (
130- default = VolSecurityType .option ,
130+ default = VolSecurityType .OPTION ,
131131 description = "Type of security for the volatility surface" ,
132132 )
133133 iv_bid : DecimalNumber | None = Field (
0 commit comments