1: \begin{abstract}
2: In future distribution grids, prosumers (i.e., energy consumers with storage and/or production capabilities) will trade energy with each other and with the main grid.
3: %
4: To ensure an efficient and safe operation of energy trading, in this paper, we formulate a peer-to-peer energy market of prosumers as a generalized aggregative game, in which a network operator is responsible to enforce the operational constraints of the system.
5: %
6: We design a distributed market-clearing mechanism with convergence guarantee to an economically-efficient, strategically-stable, and operationally-safe configuration (i.e., a variational generalized Nash equilibrium).
7: %
8: Numerical studies on the IEEE 37-bus testcase show the scalability of the proposed approach and suggest that active participation in the market is beneficial for both prosumers and the network operator.
9: \end{abstract}
10: