proof-of-portfolio 0.0.82__py3-none-any.whl → 0.0.84__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.
@@ -81,12 +81,9 @@ def _prove_worker(
81
81
 
82
82
  proof_results = result.get("proof_results", {})
83
83
  proof_generated = proof_results.get("proof_generated", False)
84
- verification_success = proof_results.get("verification_success", False)
85
84
 
86
- if proof_generated and verification_success:
85
+ if proof_generated:
87
86
  status = "success"
88
- elif proof_generated and not verification_success:
89
- status = "verification_failed"
90
87
  else:
91
88
  status = "proof_generation_failed"
92
89
 
@@ -1,2 +1,2 @@
1
1
  # This file is auto-generated during build
2
- __version__ = "0.0.82"
2
+ __version__ = "0.0.84"
@@ -5,6 +5,7 @@ import os
5
5
  import time
6
6
  import json
7
7
  import bittensor as bt
8
+ import traceback
8
9
 
9
10
  MAX_DAYS = 120
10
11
  MAX_SIGNALS = 256
@@ -247,61 +248,65 @@ def generate_proof(
247
248
  scaled_log_returns += [0] * (MAX_DAYS - len(scaled_log_returns))
248
249
 
249
250
  log_verbose(verbose, "info", f"Using {n_returns} daily returns from PTN")
251
+ try:
252
+ all_orders = []
253
+ for pos in positions:
254
+ all_orders.extend(get_attr(pos, "orders"))
250
255
 
251
- all_orders = []
252
- for pos in positions:
253
- all_orders.extend(get_attr(pos, "orders"))
254
-
255
- signals_count = len(all_orders)
256
- if signals_count > MAX_SIGNALS:
257
- log_verbose(
258
- verbose,
259
- "warning",
260
- f"Truncating {signals_count} signals to {MAX_SIGNALS} (circuit limit)",
261
- )
262
- all_orders = all_orders[:MAX_SIGNALS]
263
- signals_count = MAX_SIGNALS
264
-
265
- trade_pair_map = {}
266
- trade_pair_counter = 0
267
-
268
- signals = []
269
- for order in all_orders:
270
- trade_pair = get_attr(order, "trade_pair")
271
- trade_pair_str = (
272
- str(trade_pair).split(".")[1]
273
- if hasattr(trade_pair, "name")
274
- else str(trade_pair)
275
- )
276
- if trade_pair_str not in trade_pair_map:
277
- trade_pair_map[trade_pair_str] = trade_pair_counter
278
- trade_pair_counter += 1
279
-
280
- order_type = get_attr(order, "order_type")
281
- order_type_str = (
282
- str(order_type).split(".")[1]
283
- if hasattr(order_type, "name")
284
- else str(order_type)
285
- )
286
- order_type_map = {"SHORT": 2, "LONG": 1, "FLAT": 0}
287
- price = int(get_attr(order, "price") * SCALING_FACTOR)
288
- order_uuid = get_attr(order, "order_uuid")
289
- bid = int(get_attr(order, "bid") * SCALING_FACTOR)
290
- ask = int(get_attr(order, "ask") * SCALING_FACTOR)
291
- processed_ms = get_attr(order, "processed_ms")
292
-
293
- signals.append(
294
- {
295
- "trade_pair": str(trade_pair_map[trade_pair_str]),
296
- "order_type": str(order_type_map.get(order_type_str, 0)),
297
- "leverage": str(int(abs(order.leverage) * SCALING_FACTOR)),
298
- "price": str(price),
299
- "processed_ms": str(processed_ms),
300
- "order_uuid": f"0x{order_uuid.replace('-', '')}",
301
- "bid": str(bid),
302
- "ask": str(ask),
303
- }
304
- )
256
+ signals_count = len(all_orders)
257
+ if signals_count > MAX_SIGNALS:
258
+ log_verbose(
259
+ verbose,
260
+ "warning",
261
+ f"Truncating {signals_count} signals to {MAX_SIGNALS} (circuit limit)",
262
+ )
263
+ all_orders = all_orders[:MAX_SIGNALS]
264
+ signals_count = MAX_SIGNALS
265
+
266
+ trade_pair_map = {}
267
+ trade_pair_counter = 0
268
+
269
+ signals = []
270
+ for order in all_orders:
271
+ trade_pair = get_attr(order, "trade_pair")
272
+ trade_pair_str = (
273
+ str(trade_pair).split(".")[1]
274
+ if hasattr(trade_pair, "name")
275
+ else str(trade_pair)
276
+ )
277
+ if trade_pair_str not in trade_pair_map:
278
+ trade_pair_map[trade_pair_str] = trade_pair_counter
279
+ trade_pair_counter += 1
280
+
281
+ order_type = get_attr(order, "order_type")
282
+ order_type_str = (
283
+ str(order_type).split(".")[1]
284
+ if hasattr(order_type, "name")
285
+ else str(order_type)
286
+ )
287
+ order_type_map = {"SHORT": 2, "LONG": 1, "FLAT": 0}
288
+ price = int(get_attr(order, "price") * SCALING_FACTOR)
289
+ order_uuid = get_attr(order, "order_uuid")
290
+ bid = int(get_attr(order, "bid") * SCALING_FACTOR)
291
+ ask = int(get_attr(order, "ask") * SCALING_FACTOR)
292
+ processed_ms = get_attr(order, "processed_ms")
293
+
294
+ signals.append(
295
+ {
296
+ "trade_pair": str(trade_pair_map[trade_pair_str]),
297
+ "order_type": str(order_type_map.get(order_type_str, 0)),
298
+ "leverage": str(
299
+ int(abs(get_attr(order, "leverage")) * SCALING_FACTOR)
300
+ ),
301
+ "price": str(price),
302
+ "processed_ms": str(processed_ms),
303
+ "order_uuid": f"0x{order_uuid.replace('-', '')}",
304
+ "bid": str(bid),
305
+ "ask": str(ask),
306
+ }
307
+ )
308
+ except Exception:
309
+ traceback.print_exc()
305
310
 
306
311
  # Pad signals too
307
312
  signals += [
@@ -421,6 +426,8 @@ def generate_proof(
421
426
  log_verbose(verbose, "info", f"Witness generation completed in {witness_time:.3f}s")
422
427
 
423
428
  fields = parse_circuit_output(output)
429
+ log_verbose(verbose, "info", f"Circuit output: {output}")
430
+ log_verbose(verbose, "info", f"Parsed fields: {fields}")
424
431
  if len(fields) < 9:
425
432
  raise RuntimeError(
426
433
  f"Expected 9 output fields from main circuit, got {len(fields)}: {fields}"
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: proof-of-portfolio
3
- Version: 0.0.82
3
+ Version: 0.0.84
4
4
  Summary: Zero-Knowledge Proof framework for verifiable, private portfolio performance metrics
5
5
  Author-email: "Inference Labs, Inc." <info@inferencelabs.com>
6
6
  Requires-Python: >=3.10
@@ -1,12 +1,12 @@
1
- proof_of_portfolio/__init__.py,sha256=idt_3gH2rz8eP0NIwPgY6sYKWjoPWi01XfAuxmGPAkE,5052
2
- proof_of_portfolio/_version.py,sha256=HHOQJkZCJaFupCOnXxM-rl_fCkgZHsjuumRYIpsHRjA,66
1
+ proof_of_portfolio/__init__.py,sha256=gqM3xkqAO2az6Rhgez0qIREUzZqB3DZYV4IIQHdpwMA,4845
2
+ proof_of_portfolio/_version.py,sha256=FC0Kth0ftVDkDVhYy3jUxM8Ks_ZbGTZLp8qNYN8daMo,66
3
3
  proof_of_portfolio/analyze_data.py,sha256=t80ueFtBUzcWTrPiamiC1HXvw5Em-151zXJx0cCk8sQ,3709
4
4
  proof_of_portfolio/main.py,sha256=JbvdAK7B6hw2sQdjT0EVCiglCQZgN3urKphdeWcW43w,30994
5
5
  proof_of_portfolio/min_metrics.py,sha256=U16B7YRl0UbCterdJ1ksqFOxR5DiQeslUzMVGEWNyog,13211
6
6
  proof_of_portfolio/miner.py,sha256=eGXcPMRQVAepzXJj1ePbbDAf-72E9Yj9n-yfP7GohLw,17177
7
7
  proof_of_portfolio/parsing_utils.py,sha256=Hx61Sby5mEbC6uzhG9G69K7YPCLbjU6vK8fazpNBeLc,6463
8
8
  proof_of_portfolio/post_install.py,sha256=e-57Z_h-svQdjA8ibsM985MXmdV6-KLyymQm3Cgu8YM,5654
9
- proof_of_portfolio/proof_generator.py,sha256=fZ03w8VDM3PBtLFod098dB7g3659x-npkMND0QJsLuQ,20761
9
+ proof_of_portfolio/proof_generator.py,sha256=Qeg07pWZof_jDvgrJX9KYlMWnJ6XTwOB09os5GTdGG0,21216
10
10
  proof_of_portfolio/signal_processor.py,sha256=JQjnkMJEbv_MWIgKNrjKjrBIcIT5pAkAlCneEOGsqT0,6702
11
11
  proof_of_portfolio/validator.py,sha256=kt3BeaXOffv-h52PZBKV1YHUWtiGsnPte16m3EJpITY,3839
12
12
  proof_of_portfolio/circuits/Nargo.toml,sha256=D6ycN7H3xiTcWHH5wz4qXYTXn7Ht0WgPr9w4B7d8ZGw,141
@@ -77,8 +77,8 @@ proof_of_portfolio/tree_generator/Nargo.toml,sha256=O6iSvb-EpV0XcETiDxNgSp7XKNiY
77
77
  proof_of_portfolio/tree_generator/target.gz,sha256=J55ZC5QuFy6vGC2dSJ-0rEWjUKzzxwXwKGDTDUGp06U,225314
78
78
  proof_of_portfolio/tree_generator/src/main.nr,sha256=5Jb46e5PyZ3kpmIJn4W1gVtN3AgHs-fCmTochVB7uOU,2427
79
79
  proof_of_portfolio/tree_generator/target/tree_generator.json,sha256=Uy9AFLrbsd2SayMFTPgmow91-BIs1DrqP3qGfxfZAa0,1540901
80
- proof_of_portfolio-0.0.82.dist-info/METADATA,sha256=yT7cJG26SYJU3x-sDP8VgXl2mexohXhlw1r4d9VsRbc,7076
81
- proof_of_portfolio-0.0.82.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
82
- proof_of_portfolio-0.0.82.dist-info/entry_points.txt,sha256=KeLSJT_UJtr1WiLTkhlGqWQuPKbO_ylgj6OXOC2gJV4,53
83
- proof_of_portfolio-0.0.82.dist-info/top_level.txt,sha256=sY5xZnE6YuiISK1IuRHPfl71NV0vXO3N3YA2li_SPXU,19
84
- proof_of_portfolio-0.0.82.dist-info/RECORD,,
80
+ proof_of_portfolio-0.0.84.dist-info/METADATA,sha256=AcI239nx1ril8N5fRpG2Q3RQ4HUwyUPF5wjj64thcxM,7076
81
+ proof_of_portfolio-0.0.84.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
82
+ proof_of_portfolio-0.0.84.dist-info/entry_points.txt,sha256=KeLSJT_UJtr1WiLTkhlGqWQuPKbO_ylgj6OXOC2gJV4,53
83
+ proof_of_portfolio-0.0.84.dist-info/top_level.txt,sha256=sY5xZnE6YuiISK1IuRHPfl71NV0vXO3N3YA2li_SPXU,19
84
+ proof_of_portfolio-0.0.84.dist-info/RECORD,,