This paper investigates stochastic market clearing solutions in peer-to-peer (P2P) energy markets as two parameters of prosumers’ cost functions are flexibly and randomly chosen in certain intervals to compensate uncertainties and guarantee their energy preferences. For tractability, the scenarios in which one parameter is varied while the other is fixed are considered. It is then shown that a few distributions, namely normal, Cauchy, and gamma distributions, are invariant for P2P energy markets, i.e., if prosumer cost function parameters follow one of those distributions, then market clearing solutions will follow the same type of distribution. Explicit and analytical formulas for probability density functions of market clearing price and trading powers in P2P energy markets are derived for each type of the above-mentioned distributions. As such, variations on P2P energy market clearing solutions can be assessed and predicted when parameters in the stochastic distribution of prosumer cost function parameters are changed. Simulations are carried out for a modified IEEE European Low Voltage Test Feeder system whose results validate the obtained theoretical characterizations.