There were no trades while I was doing this experiment. The trick here is to select the maximum number of shares that will give you only PRV in exchange. If QUEST had decimals, that would have given me around 0.9999… QUEST, but those decimals got truncated and it gave me 0 QUEST.
I was thinking that maybe removing liquidity without getting something from the other side is needed, because if the price were to be modified and your shares don’t allow you to remove at least 1 QUEST, then I would be impossible it that moment to remove liquidity. So that is a loss that you would have to accept.
Now, there is one thing that can be done. I guess you know by now that the pDEX has a constant value that is obtained by multiplying the PRV and QUEST in the pool, and that constant must not change when a trade is done, but it actually changes when someone buys QUEST with more PRV than the actual price of a QUEST.
For example, supposing the price of a QUEST is 0.7, and someone ask to buy 1 with 1 PRV, then that 1 PRV gets to the liquidity, and while that could mean he would get around 1.3 QUEST, he only can get 1, so the remaining 0.3 PRV that went to the liquidity affect the constant value, and so the price. My idea here, is that the blockchain should give you your change, those 0.3 that remained of that 1 PRV, because you could only buy 1 QUEST that had a cost of 0.7 PRV, not 1 PRV.