The position function in the LiquidationPool contract, which displays a holder's position (EUROs, TST, and rewards), currently yields inaccurate data due to a flaw in its implementation. This function is essential for individual holders and frontends to accurately display position data.
The issue lies in how the position function calculates the fees a user is entitled to from the distributeFees function, in the scenario where the user's TST balance is greater than zero. It erroneously uses the total EUROs balance from the manager contract for this calculation.
However, the distributeFees function only allocates a fraction of this balance to the pool, specifically governed by the poolFeePercentage. As a result, the fee portion calculated in the position function becomes significantly overestimated.
This miscalculation in the position function leads to incorrect reporting of holders' positions. Users and frontends relying on this function for position information will receive inflated values, potentially causing confusion and mismanagement of assets.
Manual analysis
The protocol should adjust the position function to accurately reflect the actual fee distribution. This involves modifying the calculation to consider only the portion of EUROs allocated as fees, in line with the poolFeePercentage, rather than the total EUROs balance.
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.