Steadefi

Steadefi
DeFiHardhatFoundryOracle
35,000 USDC
View results
Submission Details
Severity: medium
Valid

GMX Token Value Calculations Inaccurate Due to Incorrect PNL Factor Usage

Summary

The GMXDeposit contract incorrectly uses the PNL factor during deposits, which results in inaccurate token value calculations.

Vulnerability Details

The getLpTokenValue() function in the GMXDeposit contract erroneously sets the isDeposit parameter to false, which triggers the usage of the PNL factor designated for withdrawals instead of deposits. This results in inaccurate token value calculations for deposits.

Impact

Users receive token values that do not conform to the intended risk parameters.

Tools Used

Manual analysis

Recommendations

Review and update the code to ensure that the correct PNL factor, whether for deposits or withdrawals, is consistently applied in token value calculations.

Updates

Lead Judging Commences

hans Lead Judge over 1 year ago
Submission Judgement Published
Validated
Assigned finding tags:

Wrong PNL Factor in GMXDeposit for for lpToken

Impact: Medium Likelihood: High The impact of using a wrong price (conservative vs optimistic) is limited, especially given the users specify the slippage.

Support

FAQs

Can't find an answer? Chat with us on Discord, Twitter or Linkedin.