Market For Trading LP Tokens

A Pool of LP tokens that can be swapped for their respective token on a first come first serve basis represents the market for the LP token. For example in case of MATIC-USDT pool, USER A provides MATIC LP tokens to this one smart contract and USER B now can send his MATIC to this smart contract which will forward MATIC to USER A and MATIC LP to USER B on a first come first serve basis.
No. 1, Address 1, 200 MATIC LP
No. 2, Address 2, 350 MATIC LP
No. 3, Address 3, 150 MATIC LP
Now if a user comes just to open a new position with a single token for MATIC, let's assume for 500 MATIC. No. 1 will be filled completely while No.2 position will be partially filled with 50 tokens in the balance. Both the address ( Address 1 & Address 2 ) will get MATIC after the transaction.
No. 1, Address 2, 50 MATIC LP
No. 2, Address 3, 150 MATIC LP