code-423n4 / 2024-03-saltyio-mitigation-findings

0 stars 0 forks source link

M-16 MitigationConfirmed #40

Closed c4-bot-5 closed 6 months ago

c4-bot-5 commented 7 months ago

Lines of code

Vulnerability details

Summary

Instead of the using the bisection search algo, M-16 proposed a direct formula which would not miss the range of profitable arbitrage values which the previous algo was susceptible to missing.

Analysis

The provided formula, it's first derivative and hence the max value of bestArbAmountIn arrived at in the PRs are all correct and implemented in the code correctly, along with overflow protection. Just for academic purposes, in case anyone is interested in validating the first derivative calculations, the step by step process of which were not described in detail in the issue report, then this link can be visited. The values match, as expected.

Conclusion

LGTM

c4-judge commented 6 months ago

Picodes marked the issue as nullified