The math makes sense to me when you buy/sell assets from a pool with two assets without considering fees.
If we have a pool of 100 ETH and 300,000 USDC and someone buys 2 ETH, the pool will look like: 98 ETH and ~306,122.45 USDC (x•y=k stuff). So the buyer paid ~6,122.45 USDC for 2 ETH.
But usually about 0.1% of buying token goes to fees so 0.1% of 6,122.45 is ~6.12. So actually only 6,116.37 USDC (6,122.45 – 6.12) is added to the pool which throws off the K value. Since, 98•6116.37 doesn’t give us the K value we want. So how does the pool keep the balance with K while considering fees?
Any resources linking to this?