indexToken should be swapped to collateralToken before Compound action
The Compound action is used to move idle funds in vault to deposit into GMX. These funds can either be from funding fees or adl/liquidation.
For positive funding fees, it will be collected in indexToken, and needs to be swapped to collateralToken before compounding.
https://github.com/CodeHawks-Contests/2025-02-gamma/blob/main/contracts/PerpetualVault.sol#L399
Some funding fees will be left idle in PerpetualVault as indexToken.
N/A
Also perform the indexToken->collateralToken dex swap before the compound action.
Likelihood: Low/Medium, during FLOW.COMPOUND. Impact: Low, no use of the index tokens during a compound (funding fees, liquidation)
Likelihood: Low/Medium, during FLOW.COMPOUND. Impact: Low, no use of the index tokens during a compound (funding fees, liquidation)
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.