After repaying the flash loan, any leftover tokens from the 1inch swap are automatically supplied back into Aave as additional collateral in both the open and unwind flows. During an unwind operation the user's intent is to close the position and retrieve funds — but surplus proceeds are locked back into Aave.
Likelihood:
Every successful unwind where the swap returns more than the flash loan + premium produces surplus — this is the normal case when any slippage buffer is applied
The hardcoded 5% buffer in calculateUnwindParams deliberately over-withdraws collateral, guaranteeing surplus in normal conditions
Impact:
User cannot immediately access surplus funds after unwinding — an additional Aave withdrawal transaction is required
In a multi-position scenario, surplus is silently merged into the shared collateral pool, obscuring per-position accounting
Distinguish between the open and unwind flows when handling surplus. During an unwind the user is exiting — surplus should be sent directly to the user address that was decoded from the flash loan params. During an open, re-supplying to improve health factor is still appropriate.
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.