Submitted by __141345__
https://github.com/Plex-Engineer/lending-market-v2/blob/ea5840de72eab58bec837bb51986ac73712fcfde/contracts/Stableswap/BaseV1-periphery.sol#L522-L526
https://github.com/Plex-Engineer/lending-market-v2/blob/ea5840de72eab58bec837bb51986ac73712fcfde/contracts/Stableswap/BaseV1-periphery.sol#L198-L217
The underlying price for LP pool pair can be manipulated. This kind of price mainpulation happened before, can be found here: Warp Fincance event.
Which may lead to the exploit of the pool by a malicious user.
file: lending-market-v2/contracts/Stableswap/BaseV1-periphery.sol
522-526 198-217:
The price of the LP pair is determined by the TVL of the pool, given by:
amt0 * price0 + amt1 * price1. However, when a malicious user dumps large amount of any token into the pool, the whole TVL will be significantly increased, which leads to inproper calculation of the price.
A differenct approach to calculate the LP price can be found here.
nivasan1 (Canto) confirmed
Alex the Entreprenerd (judge) commented:
