For getting sizeInTokens in VaultReader contract at number of places, getPositionSizeInUsd(key) is used (which gives sizeInUsd) instead of the available getPositionSizeInTokens(key) which actually gives the position’s size in tokens(sizeInTokens).
In the function getPositionInfo, in function getNegativeFundingFeeAmount and in function getPnl in the VaultReader contract, getPositionSizeInUsd(key) is used (which gives position size in Usd (sizeInUsd)) instead of the available getPositionSizeInTokens(key) which actually gives the position’s size in tokens(sizeInTokens).
Manual Review
Consider replacing getPositionSizeInUsd(key) by getPositionSizeInTokens(key) in the aforementioned 3 functions, as shown here for the function getPositionInfo:
Only check if there are no tokens. Checking if USD is 0 is equivalent. There is no problem here, even if the variable has an incorrect name: Informational.
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.