voly 0.0.228__py3-none-any.whl → 0.0.230__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
voly/core/data.py CHANGED
@@ -251,6 +251,7 @@ def process_option_chain(df: pd.DataFrame, currency: str) -> pd.DataFrame:
251
251
 
252
252
  # Apply extraction to create new columns
253
253
  df['spot_price'] = df['index_price']
254
+ s = df['spot_price'].iloc[0]
254
255
  df['instrument'] = df['instrument_name']
255
256
  splits = df['instrument'].str.split('-')
256
257
  df['maturity'] = splits.str[1]
@@ -271,19 +272,20 @@ def process_option_chain(df: pd.DataFrame, currency: str) -> pd.DataFrame:
271
272
  df['bid_iv'] = df['bid_iv'].replace({0: np.nan}) / 100
272
273
  df['ask_iv'] = df['ask_iv'].replace({0: np.nan}) / 100
273
274
 
274
- df['bid_price'] = df['best_bid_price']
275
- df['ask_price'] = df['best_ask_price']
275
+ df['mark_price'] = df['mark_price'] * df['spot_price']
276
+ df['bid_price'] = df['best_bid_price'] * df['spot_price']
277
+ df['ask_price'] = df['best_ask_price'] * df['spot_price']
276
278
  df['bid_amount'] = df['best_bid_amount']
277
279
  df['ask_amount'] = df['best_ask_amount']
278
280
 
279
281
  for idx, row in df.iterrows():
280
282
  # Process bid side
281
283
  if 'bids' in row and isinstance(row['bids'], list) and len(row['bids']) > 0:
282
- clean_bids = [] # Clean up the bid data
284
+ clean_bids = [] # Clean up the bid data
283
285
  for bid in row['bids']:
284
286
  if len(bid) >= 3:
285
287
  # Extract price and quantity, removing 'new' if present
286
- price = float(bid[1]) if bid[0] == 'new' else float(bid[0])
288
+ price = float(bid[1]) if bid[0] == 'new' else float(bid[0]) * s
287
289
  qty = float(bid[2]) if bid[0] == 'new' else float(bid[1])
288
290
  clean_bids.append((price, qty))
289
291
  if clean_bids:
@@ -291,11 +293,11 @@ def process_option_chain(df: pd.DataFrame, currency: str) -> pd.DataFrame:
291
293
 
292
294
  # Process ask side
293
295
  if 'asks' in row and isinstance(row['asks'], list) and len(row['asks']) > 0:
294
- clean_asks = [] # Clean up the ask data
296
+ clean_asks = [] # Clean up the ask data
295
297
  for ask in row['asks']:
296
298
  if len(ask) >= 3:
297
299
  # Extract price and quantity, removing 'new' if present
298
- price = float(ask[1]) if ask[0] == 'new' else float(ask[0])
300
+ price = float(ask[1]) if ask[0] == 'new' else float(ask[0]) * s
299
301
  qty = float(ask[2]) if ask[0] == 'new' else float(ask[1])
300
302
  clean_asks.append((price, qty))
301
303
  if clean_asks:
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: voly
3
- Version: 0.0.228
3
+ Version: 0.0.230
4
4
  Summary: Options & volatility research package
5
5
  Author-email: Manu de Cara <manu.de.cara@gmail.com>
6
6
  License: MIT
@@ -5,7 +5,7 @@ voly/formulas.py,sha256=Jx2QSTkN3S_X1YWYXN3T0gBcxMKB_VLsqgDPg32ApmM,10833
5
5
  voly/models.py,sha256=CGJQr13Uie7iwtx2hjViN9lMXeRN_uOqzp4u8NPaTlA,9282
6
6
  voly/core/__init__.py,sha256=bu6fS2I1Pj9fPPnl-zY3L7NqrZSY5Zy6NY2uMUvdhKs,183
7
7
  voly/core/charts.py,sha256=6MSU0z01fPOVSssodxdnFqchzDfupSmXq_e71WwDmVQ,12635
8
- voly/core/data.py,sha256=4E-zF2wJwumbWcrGVOS59ebApRKnxyyUXCTTriUk45Y,12389
8
+ voly/core/data.py,sha256=2Gloc89_UWgS_sAu46WJvHK4e8tM_4F-fuyRb9i46-0,12529
9
9
  voly/core/fit.py,sha256=R3aDgCjvZ30PujoE9pgnGQXPQOTTMbk7_-RQ0ZMx5ig,13918
10
10
  voly/core/hd.py,sha256=dSv197RmSWFWbRRdoBzMrD_poT7ZiJ8hdD_wKE-Li_M,13559
11
11
  voly/core/interpolate.py,sha256=GAkrqaar7A0D6UMipXQUp4vSHRfb44TmCG5Xiv9elXg,5176
@@ -13,8 +13,8 @@ voly/core/rnd.py,sha256=wiZ5OIjPDf1Th5_sQ9CZG5JgAo3EL8f63T_Rj1_VP-0,13214
13
13
  voly/utils/__init__.py,sha256=E05mWatyC-PDOsCxQV1p5Xi1IgpOomxrNURyCx_gB-w,200
14
14
  voly/utils/density.py,sha256=ONpRli-IaJDgOZ2sb27HHFc9_tkkGSATKl94JODd86A,5879
15
15
  voly/utils/logger.py,sha256=4-_2bVJmq17Q0d7Rd2mPg1AeR8gxv6EPvcmBDMFWcSM,1744
16
- voly-0.0.228.dist-info/licenses/LICENSE,sha256=wcHIVbE12jfcBOai_wqBKY6xvNQU5E909xL1zZNq_2Q,1065
17
- voly-0.0.228.dist-info/METADATA,sha256=_21vNdPGISj2HC7IKCjC47LHjMq2F1qPbKOEF9oFbb0,4115
18
- voly-0.0.228.dist-info/WHEEL,sha256=ck4Vq1_RXyvS4Jt6SI0Vz6fyVs4GWg7AINwpsaGEgPE,91
19
- voly-0.0.228.dist-info/top_level.txt,sha256=ZfLw2sSxF-LrKAkgGjOmeTcw6_gD-30zvtdEY5W4B7c,5
20
- voly-0.0.228.dist-info/RECORD,,
16
+ voly-0.0.230.dist-info/licenses/LICENSE,sha256=wcHIVbE12jfcBOai_wqBKY6xvNQU5E909xL1zZNq_2Q,1065
17
+ voly-0.0.230.dist-info/METADATA,sha256=8mrLyHiVSGuSVUBEdmFWuFIsVYlY-WPYRpjyEfxFIUw,4115
18
+ voly-0.0.230.dist-info/WHEEL,sha256=ck4Vq1_RXyvS4Jt6SI0Vz6fyVs4GWg7AINwpsaGEgPE,91
19
+ voly-0.0.230.dist-info/top_level.txt,sha256=ZfLw2sSxF-LrKAkgGjOmeTcw6_gD-30zvtdEY5W4B7c,5
20
+ voly-0.0.230.dist-info/RECORD,,
File without changes