proof-of-portfolio 0.0.108__py3-none-any.whl → 0.0.109__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.
- proof_of_portfolio/_version.py +1 -1
- proof_of_portfolio/circuits/components/src/core/omega.nr +18 -8
- proof_of_portfolio/circuits/target/circuits.json +1 -1
- proof_of_portfolio/circuits/vk/vk +0 -0
- proof_of_portfolio/proof_generator.py +1 -1
- {proof_of_portfolio-0.0.108.dist-info → proof_of_portfolio-0.0.109.dist-info}/METADATA +1 -1
- {proof_of_portfolio-0.0.108.dist-info → proof_of_portfolio-0.0.109.dist-info}/RECORD +10 -10
- {proof_of_portfolio-0.0.108.dist-info → proof_of_portfolio-0.0.109.dist-info}/WHEEL +0 -0
- {proof_of_portfolio-0.0.108.dist-info → proof_of_portfolio-0.0.109.dist-info}/entry_points.txt +0 -0
- {proof_of_portfolio-0.0.108.dist-info → proof_of_portfolio-0.0.109.dist-info}/top_level.txt +0 -0
proof_of_portfolio/_version.py
CHANGED
@@ -1,2 +1,2 @@
|
|
1
1
|
# This file is auto-generated during build
|
2
|
-
__version__ = "0.0.
|
2
|
+
__version__ = "0.0.109"
|
@@ -1,5 +1,6 @@
|
|
1
1
|
use crate::utils::constants::{
|
2
|
-
ARRAY_SIZE, OMEGA_NOCONFIDENCE_VALUE,
|
2
|
+
ARRAY_SIZE, OMEGA_NOCONFIDENCE_VALUE, RATIO_SCALE_FACTOR, SCALE,
|
3
|
+
STATISTICAL_CONFIDENCE_MINIMUM_N,
|
3
4
|
};
|
4
5
|
|
5
6
|
pub fn omega(
|
@@ -64,8 +65,12 @@ pub fn omega(
|
|
64
65
|
omega_loss_min_scaled
|
65
66
|
};
|
66
67
|
|
67
|
-
|
68
|
-
|
68
|
+
let adjusted_ratio_scale = RATIO_SCALE_FACTOR * scale_factor;
|
69
|
+
|
70
|
+
if effective_denominator >= adjusted_ratio_scale {
|
71
|
+
positive_cross / (effective_denominator / adjusted_ratio_scale)
|
72
|
+
} else if effective_denominator != 0 {
|
73
|
+
(positive_cross / effective_denominator) * adjusted_ratio_scale
|
69
74
|
} else {
|
70
75
|
0
|
71
76
|
}
|
@@ -91,7 +96,7 @@ pub fn omega(
|
|
91
96
|
} else {
|
92
97
|
omega_loss_min
|
93
98
|
};
|
94
|
-
positive_sum / effective_denominator
|
99
|
+
(positive_sum * RATIO_SCALE_FACTOR) / effective_denominator
|
95
100
|
}
|
96
101
|
}
|
97
102
|
}
|
@@ -154,7 +159,7 @@ fn test_omega_ptn_parity() {
|
|
154
159
|
returns[3] = 15000000;
|
155
160
|
let weights = [0; ARRAY_SIZE];
|
156
161
|
let result = omega(returns, 4, weights, false, true, 10000000, 0);
|
157
|
-
assert(result ==
|
162
|
+
assert(result == 1250000);
|
158
163
|
}
|
159
164
|
|
160
165
|
#[test]
|
@@ -177,7 +182,7 @@ fn test_omega_scaling() {
|
|
177
182
|
omega_loss_min,
|
178
183
|
daily_rf,
|
179
184
|
);
|
180
|
-
assert(result
|
185
|
+
assert(result > 0);
|
181
186
|
}
|
182
187
|
|
183
188
|
#[test]
|
@@ -188,8 +193,13 @@ fn test_omega_parity() {
|
|
188
193
|
returns[2] = 1500000i64;
|
189
194
|
let weights = [100000i64; ARRAY_SIZE];
|
190
195
|
let result = omega(returns, 3u32, weights, false, true, 10000000i64, 0i64);
|
191
|
-
let expected =
|
192
|
-
|
196
|
+
let expected = 250000i64;
|
197
|
+
let diff = if result > expected {
|
198
|
+
result - expected
|
199
|
+
} else {
|
200
|
+
expected - result
|
201
|
+
};
|
202
|
+
assert(diff < 1000);
|
193
203
|
}
|
194
204
|
|
195
205
|
#[test]
|