Summary: The unwindPosition function in Stratax.sol incorrectly uses the liquidationThreshold instead of the ltv (Loan-to-Value) ratio when calculating the amount of collateral to withdraw. Since liquidationThreshold is always greater than ltv (an Aave invariant), the denominator in the withdrawal formula is larger than intended, resulting in the user withdrawing significantly less collateral than they are entitled to.
Severity: Critical
Guaranteed Loss: Every user who unwinds a position suffers a direct loss of collateral.
Math Error: The loss is not due to market slippage but a fundamental error in the contract's accounting logic.
Impact: High
Direct Financial Loss: For USDC (LTV 75%, LiqThreshold 78%), users lose ~3.85% of their collateral principal on every unwind. For WETH (LTV 80%, LiqThreshold 83%), the loss is ~3.61%.
Protocol Trust: The protocol is effectively "stealing" a percentage of user funds due to this bug.
Likelihood: Certain
The bug is in the core logic path (_executeUnwindOperation) and affects every single unwind transaction.
Affected Component:
File: src/Stratax.sol
Function: _executeUnwindOperation
Source Confirmation:
Root Cause: Implementation error where the developer extracted the wrong return value from AaveProtocolDataProvider and used it in the formula. The comment on line 574 correctly states the formula should use ltv, but the code uses liqThreshold.
PoC (End-to-End Verified):
This PoC uses a Mainnet Fork to query real Aave data and mathematically prove the loss.
Verification Evidence:
Recommended Fix:
Update _executeUnwindOperation to extract ltv from the data provider and use it in the calculation.
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.
The contest is complete and the rewards are being distributed.