  The popularization of distributed energy resources transforms end-users from
consumers into prosumers. Inspired by the sharing economy principle, energy
sharing markets for prosumers are proposed to facilitate the utilization of
renewable energy. This paper proposes a novel two-layer energy sharing market
for massive prosumers, which can promote social efficiency by wider-area
sharing. In this market, there is an upper-level wide-area market (WAM) in the
distribution system and numerous lower-level local-area markets (LAMs) in
communities. Prosumers in the same community share energy with each other in
the LAM, which can be uncleared. The energy surplus and shortage of LAMs are
cleared in the WAM. Thanks to the wide-area two-layer structure, the market
outcome is near-social-optimal in large-scale systems. However, the proposed
market forms a complex mathematical program with equilibrium constraints
(MPEC). To solve the problem, we propose an efficient and hierarchically
distributed bidding algorithm. The proposed two-layer market and bidding
algorithm are verified on the IEEE 123-bus system with 11250 prosumers, which
demonstrates the practicality and efficiency for large-scale markets.
