In recent years, there has been a significant and rapid expansion in the energy sector. Renewable energy sources have made substantial inroads into the electricity grid, resulting in their substantial contribution to the overall energy mix. This shift towards renewables has introduced new complexities into energy estimation and trading, particularly in the electrical energy market, where the reliance on meteorological conditions is significant. Developing effective energy trading strategies has become paramount to ensuring the efficient functioning of smart grids, as they play a crucial role in alleviating system stress. Nevertheless, the burgeoning number of smart grid users has presented substantial challenges for maintaining stability and efficiency in energy trading operations [1], [12]. Furthermore, amidst the escalating global energy crisis, which has been linked to geopolitical conflicts and the dominance of powerful nations in fossil fuel reserves, many countries are pivoting towards clean and sustainable energy sources, accompanied by the implementation of new legal frameworks. One such legal development pertains to commercial laws in the electrical energy sector [2]. This study, centered on the electricity trading landscape, conducted a comparative analysis within the Emir community. It was observed that the number of households on the consumer side has a significant impact on cost escalation. To mitigate this rising cost trend, it becomes imperative to enact legislation that delineates construction criteria to be adhered to by communities [3], [13]. In this study, the introductory section highlights the importance of electricity trading, followed by an examination of peer-to-peer energy trading. The research investigates how the quantity of residential units affects trade dynamics and resulting profitability. The concluding segment of the study presents the findings and provides recommendations for future directions [4].