I implemented the logic of the uniswap protocol on my blockchain using uniswap v2 whitepaper. To check if its working, I am comparing it with real examples of creating liquidity. I come across examples of calculating the creation of a liquidity pool with different results, which are described by the
sminted = √(xdeposited · ydeposited) formula. Here are some of them:
Correct calculation for example Uniswap V2: COIN 11 :
10000000e18 * 1900e18 = 19000000000e36 sqrt(19000000000e36) - 1000 = 137840487520902217678559
Incorrect calculation for the Uniswap V2: USDT 2 example:
sqrt(1.103511e18 * 0.005e18) - 1000 = 74280245364 // but in the transaction itself, the number of pool shares is 74280245364
Could I have missed something in the calculations?