<div>This paper presents a scalable mechanism for peer-</div><div>to-peer (P2P) energy trading among prosumers in a smart grid.</div><div><br></div><div>In the proposed mechanism, prosumers engage in a non-mediated</div><div>negotiation with their peers to reach an agreement on the price</div><div>and quantity of energy to be exchanged. Instead of concurrent</div><div>bilateral negotiation between all peers with high overheads, an</div><div>iterative peer matching process is employed to match peers</div><div>for bilateral negotiation. The proposed negotiation algorithm</div><div>enables prosumers to come to an agreement, given that they</div><div>have no prior knowledge about the preference structure of their</div><div>trading partners. A greediness factor is introduced to model the</div><div>selfish behavior of prosumers in the negotiation process and</div><div>to investigate its impact on the negotiation outcome. In order</div><div>to recover the costs related to power losses, a transaction fee</div><div>is applied to each transaction that enables the grid operator</div><div>to recover incurred losses due to P2P trades. The case studies</div><div>demonstrate that the proposed mechanism discourages greedy</div><div>behavior of prosumers in the negotiation process as it does not</div><div>increase their economic surplus. Also, it has an appropriate</div><div>performance from the computation overheads and scalability</div><div>perspectives.</div>