Recently, given the increased integration of renewables and growing uncertainty in demand, the wholesale market price has become highly volatile. Energy communities connected to the main electricity grid may be exposed to this increasing price volatility. Additionally, they may also be exposed to local network congestions, resulting in price spikes. Motivated by this problem, in this paper, we present a coordination mechanism between entities at the distribution grid to reduce price volatility. The mechanism relies on the concept of duality theory in mathematical programming through which explicit constraints can be imposed on the local electricity price. Constraining the dual variable related to price enables the quantification of the demand-side flexibility required to guarantee a certain price limit. We illustrate our approach with a case study of a congested distribution grid and an energy storage system as the source of the required demand-side flexibility. Through detailed simulations, we determine the optimal size and operation of the storage system required to constrain prices. An economic evaluation of the case study shows that the business case for providing the contracted flexibility with the storage system depends strongly on the chosen price limit.