Aave V3 defines two distinct collateral parameters: LTV (Loan-to-Value) and Liquidation Threshold. LTV determines the maximum amount a user can borrow against collateral. Liquidation Threshold (always higher than LTV) determines when the position becomes liquidatable. For example, WETH has LTV=82.5% and Liquidation Threshold=86%.
In calculateOpenParams, the LTV is correctly used to calculate how much can be borrowed. However, in _executeUnwindOperation, the Liquidation Threshold is used instead of LTV to calculate how much collateral to withdraw. Since Liquidation Threshold > LTV, the unwind operation calculates that it can withdraw more collateral per unit of debt than was actually borrowed per unit of collateral during the open operation.
Likelihood:
Every call to unwindPosition executes _executeUnwindOperation which uses liqThreshold for collateral calculation. This is a systematic error that affects all unwind operations for all assets, not an edge case.
The gap between LTV and Liquidation Threshold exists for every Aave asset (typically 2-5% difference).
Impact:
The unwind calculates a lower collateral withdrawal than expected because liqThreshold is in the denominator and liqThreshold > LTV. This means less collateral is withdrawn per unit of debt, potentially leaving residual collateral locked in Aave.
Conversely, using calculateUnwindParams (which uses neither -- it calculates based on raw price ratios) creates an inconsistency between what the view function suggests and what the actual _executeUnwindOperation computes.
The arithmetic below demonstrates the mismatch using WETH's real Aave V3 parameters (LTV = 8250, liquidationThreshold = 8600). The open operation borrows at 82.5% of collateral value, but the unwind divides by 86% instead, systematically under-withdrawing collateral by approximately 4% of position value.
Replace the liqThreshold lookup with ltv so that the unwind calculation mirrors the same collateralization ratio used during position opening. This ensures the full collateral backing the debt is withdrawn.
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.