Because in the function getOpenINtrest thehalfSkew is calculated in a wrong way, the returned values for longsOpenInterest and shortsOpenInterest are wrong. This will break any external service dependant on those values.
In the function getOpenInterest, first the skew is taken to determine the halfSkew which is later used to calculate the longsOpenInterest and shortsOpenInterest:
The issue arises from the fact that the skew is saved with 18 decimals and by dividing it by 2e18 the result is not half of the skew.
E.g. if the scew is 2e18 half of the skew should be 1e18 but the result is:
halfScew = 2e18 / 2e18 = 1.
This leads to the wrong calculation of the longsOpenInterest and shortsOpenInterest further down:
To ensure the values for the longsOpenInterest and shortsOpenInterest are right, change the code like this:
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.