As the local energy sources are mostly uncertain and fluctuating in nature, the ‘energy risk’ due to discrepancies between committed energy transactions and metered measurements is prominent in peer to peer (P2P) markets. We propose a P2P market settlement mechanism which lowers this risk and maximizes the welfare of buyers and sellers. The risk in energy production is modeled using Markowitz portfolio theory and the best point where energy return per unit risk is maximum is obtained from the efficient frontier by using the modified Sharpe ratio. The energy portfolio thus obtained is used as a constraint while optimizing the conflicting prosumer benefits using multi-objective stochastic weight trade-off chaotic non-dominated sorting particle swarm optimization (SWTC-NSPSO). In effect, only a reliable proportion of total energy demand submitted in the bid is cleared in the market, foreseeing the real-time fluctuations. The proposed market settlement mechanism also gives room to the existing distribution system operators by assigning them the duty of 1) optimally allocating energy among buyers and sellers in accordance with their competitive bids 2) providing the infrastructure, managing the market and charging for the service and 3) checking the technical feasibility by performing load flow and monitoring power transfer sensitivities to encourage short distance transactions. The energy allocation is done in CIGRE LV benchmark microgrid with ten peers having solar and wind generation. The allocated energy is found to be closer to the metered measurements and hence the reserve cost is observed to be low.