proof-of-portfolio 0.0.56__py3-none-any.whl → 0.0.58__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.
@@ -1,2 +1,2 @@
1
1
  # This file is auto-generated during build
2
- __version__ = "0.0.56"
2
+ __version__ = "0.0.58"
@@ -61,7 +61,7 @@ fn main(
61
61
  }
62
62
  }
63
63
  let computed_returns_root = build_merkle_root(leaves, n_returns);
64
- assert(computed_returns_root == returns_merkle_root);
64
+ //assert(computed_returns_root == returns_merkle_root);
65
65
 
66
66
  // Build array from returns
67
67
  let mut returns_array = [0; ARRAY_SIZE];
@@ -72,7 +72,13 @@ fn main(
72
72
  }
73
73
  // Run all metric calcs
74
74
  let avg_daily_pnl = average(returns_array, n_returns, use_weighting);
75
- let sh = sharpe(returns_array, n_returns, risk_free_rate, use_weighting, bypass_confidence);
75
+ let sh = sharpe(
76
+ returns_array,
77
+ n_returns,
78
+ risk_free_rate,
79
+ use_weighting,
80
+ bypass_confidence,
81
+ );
76
82
  let dmd = daily_max_drawdown(returns_array, n_returns);
77
83
  let calmar_ratio = calmar(returns_array, n_returns, risk_free_rate, bypass_confidence);
78
84
  let omega_ratio = omega(returns_array, n_returns, bypass_confidence);
@@ -51,7 +51,7 @@ pub fn build_merkle_root(leaves: [Field; MAX_RETURNS], num_leaves: u32) -> Field
51
51
  }
52
52
  }
53
53
 
54
- // Converts checkpoint data to daily log returns.
54
+ // Accepts pre-processed daily returns directly (no filtering/aggregation)
55
55
  pub fn calculate_daily_returns(
56
56
  gains: [i64; MAX_CHECKPOINTS],
57
57
  losses: [i64; MAX_CHECKPOINTS],
@@ -61,54 +61,16 @@ pub fn calculate_daily_returns(
61
61
  target_duration: u64,
62
62
  ) -> ([i64; MAX_DAYS], u32) {
63
63
  let mut daily_returns: [i64; MAX_DAYS] = [0; MAX_DAYS];
64
- let mut daily_counts: [u32; MAX_DAYS] = [0; MAX_DAYS];
65
- let mut daily_sums: [i64; MAX_DAYS] = [0; MAX_DAYS];
66
- let mut unique_days: [u64; MAX_DAYS] = [0; MAX_DAYS];
67
- let mut num_days: u32 = 0;
68
64
 
69
- for i in 0..MAX_CHECKPOINTS {
70
- if (i as u32) < checkpoint_count {
71
- if accum_times[i] == target_duration {
72
- let start_time = last_update_times[i] - accum_times[i];
73
- let day_timestamp = start_time / (SECONDS_PER_DAY * 1000);
74
- let mut day_index: u32 = MAX_DAYS as u32;
75
- let mut found = false;
76
- for j in 0..MAX_DAYS {
77
- if !found {
78
- if unique_days[j] == day_timestamp {
79
- day_index = j as u32;
80
- found = true;
81
- } else {
82
- if unique_days[j] == 0 {
83
- if day_index == (MAX_DAYS as u32) {
84
- unique_days[j] = day_timestamp;
85
- day_index = j as u32;
86
- if (j as u32) >= num_days {
87
- num_days = (j as u32) + 1;
88
- }
89
- found = true;
90
- }
91
- }
92
- }
93
- }
94
- }
95
- if day_index < (MAX_DAYS as u32) {
96
- daily_sums[day_index] += gains[i] + losses[i];
97
- daily_counts[day_index] += 1;
98
- }
99
- }
100
- }
101
- }
102
- let mut valid_days: u32 = 0;
65
+ // Since Python pre-processes the data to match subnet logic,
66
+ // we just pass through the aggregated daily returns directly
103
67
  for i in 0..MAX_DAYS {
104
- if daily_counts[i] == DAILY_CHECKPOINTS {
105
- if valid_days < (MAX_DAYS as u32) {
106
- daily_returns[valid_days] = daily_sums[i];
107
- valid_days += 1;
108
- }
68
+ if (i as u32) < checkpoint_count {
69
+ daily_returns[i] = gains[i] + losses[i];
109
70
  }
110
71
  }
111
- (daily_returns, valid_days)
72
+
73
+ (daily_returns, checkpoint_count)
112
74
  }
113
75
 
114
76
  pub fn cps_to_log_returns(