DeFiFoundry
50,000 USDC
View results
Submission Details
Severity: low
Invalid

There is no slippage check for paraswap dex

Summary

In numerous places in the app, _doDexSwap() is being used to swap collateral to index or vice-versa.

In comparison to _doGmxSwap(), _doDexSwap() doesn't contain any parameter in regards to slippage check, so the possibility of a frontrunning attack or just a non-malicious large trade executing just before it, moving the price up and giving the user less tokens than expected.

Impact

Partial loss of funds due to the possibility of a sandwich attack or just a large non-malicious trade executing just before our paraswap trade.

Tools Used

Manual review

Recommendations

Create a slippage check such as minAmount when a trade happens

Updates

Lead Judging Commences

n0kto Lead Judge 8 months ago
Submission Judgement Published
Invalidated
Reason: Non-acceptable severity
Assigned finding tags:

invalid_swap_slippage_and_deadline

Slippage and deadline are handled externally. Paraswap implementation used by the current code (behind the proxy): https://etherscan.io/address/0xdffd706ee98953d3d25a3b8440e34e3a2c9beb2c GMX code: https://github.com/gmx-io/gmx-synthetics/blob/caf3dd8b51ad9ad27b0a399f668e3016fd2c14df/contracts/order/OrderUtils.sol#L150C15-L150C33

Support

FAQs

Can't find an answer? Chat with us on Discord, Twitter or Linkedin.