My Smart Contract has the rebase function which reduces the X coin supply in the Pancakeswap liquidity pair every 4 hours. Doing this to increase the price of the X coin. But the price model AMM was not working as expected.
X * Y (BNB) = K (Constant)
20, 000 * 0.2 = 4000
If the contract reduce the X supply to 10,000 then liquidity will be
10,000 * 0.2
Now if user needs to buy 1 X, then the user should pay (0.2 BNB) so that K will reach the constant value right?
4000(K) % 9999(X) = 0.4(Y)
9,999 * 0.4 = 4000
But it is not working in this way, Pancakeswap calculates the price of 1X by 0.2 % 9,999.
Please give me clarification.