The function calculateSwapAmount is called with parameters in an incorrect order, which may lead to incorrect swap calculations. The function is intended to calculate the amount of USDC to be swapped into the vault's underlying asset. However, the parameters for assetIn and assetOut are reversed.
Relevant links:
Current Implementation below swaps the assets to usdc, whereas when the vault is in credit the usdc should be swapped to assets. This leads to incorrect swap being performed
This issue can lead to incorrect calculations of the swap amount, potentially resulting in insufficient or excessive asset swaps. This could affect the vault's ability to settle its credit accurately, leading to financial discrepancies.
Manual review
Swap the parameters in the calculateSwapAmount function call to ensure the correct assets are being used for the swap 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.