Submitted by cmichel, also found by danb, Alex the Entreprenerd, hickuphh3, hyh, and WatchPug
The ThecosomataETH.addLiquidity function computes the expectedAmount and then subtracts a slippage percentage from it.
According to the Curve docs 21.4, this amount is already exact and takes the slippage into account (but not fees).
If the pool is imbalanced, the calc_token_amount will already return a wrong amount and the additional slippage check on the wrong amount is unnecessary (except for the fees).
Consider computing the minimum expected LP tokens off-chain and pass them to the performUpkeep function as a parameter to prevent sandwich attacks.
drahrealm (Redacted Cartel) confirmed and commented:
kphed (Redacted Cartel) disputed and commented:
Alex the Entreprenerd (judge) commented:
kphed (Redacted Cartel) commented:
