In the provide_liquidity function in contracts/pool-manager/src/liquidity/commands.rs, any user can be the first liquidity provider to a pool. This creates a potential risk where regular users who are not associated with the project could unknowingly become the first liquidity provider and be subject to minimum liquidity requirements or other initialization parameters that may not be optimal for them.
The first liquidity provider plays a crucial role in:
Currently, there is no mechanism to ensure that the pool creator, who understands the pools design and intended parameters, is the first liquidity provider, also this minimum liquidity requirement is enforced for the initial provider as a method to curb the famous first depositor attack; however, this then unfairly costs a user their tokens.
/contracts/pool-manager/src/liquidity/commands.rs#L182-L213
QA, considering this is a common pattern in DeFi protocols to help curb the first depositor attack window; however, enforcing the creator is the first liquidity provider easily sorts a lot of stuff as we can ensure they also set the correct price for the pool.
Implement a mechanism to ensure the pool creator is the first liquidity provider.
