The issue arises when one asset's price is significantly smaller than the other, leading to an excessively large gradient and an overly dominant weight for that asset. This can lead to unintended portfolio outcomes where one asset (Asset 2 in this case) dominates the entire portfolio, overshadowing the other asset (Asset 1), even if both assets had equal initial weights.
Let's consider the following situation:
Weights: [0.5, 0.5]
prices = [1, 0.01]
movingAverage = [1, 0.001]
κ = 0.5, w = 0.1, A = 2, e = 2
for asset 1:
gradient[0] =( price[0] / movingAverage[0]) - 1 = (1 / 1 ) - 1 = 0
for asset 2 :
gradient[1] = price[1] / movingAverage[1] - 1 =(0.01 / 0.001) - 1 = 10 - 1 = 9
for asset 1 :
kappaGradient[0] = κ × gradient[0] = 0.5 × 0 = 0
for asset 2 :
kappaGradient[1] = κ × gradient[1] = 0.5 × 9 = 4.5
For Asset 1:
channel[0] = A × (kappaGradient[0] / w)^e = 2 × (0 / 0.1)^2 = 2 × 0 = 0
For Asset 2:
channel[1] = A × (kappaGradient[1] / w)^e = 2 × (4.5 / 0.1)^2 = 2 × (45)^2 = 2 × 2025 = 4050
weights[0] = 0.5 + 0 = 0.5
For Asset 2:
weights[1] = 0.5 + 4050 = 4050.5
Total weight:
sumWeights = 0.5 + 4050.5 = 4051
Normalized weights:
For Asset 1:
newWeights[0] = 0.5 / 4051 ≈ 0.000123
For Asset 2: newWeights[1] = 4050.5 / 4051 ≈ 0.999877
After the calculations, Asset 2 holds 99.99% of the total weight, making it dominate the portfolio. In contrast, Asset 1 only holds 0.01%. This outcome is highly skewed, and the portfolio is now almost entirely dependent on Asset 2, despite both assets initially having equal weights.
Ensure moving averages don’t become too small by setting a minimum value.
Please read the CodeHawks documentation to know which submissions are valid. If you disagree, provide a coded PoC and explain the real likelyhood and the detailed impact on the mainnet without any supposition (if, it could, etc) to prove your point.
The contest is live. Earn rewards by submitting a finding.
This is your time to appeal against judgements on your submissions.
Appeals are being carefully reviewed by our judges.