Maintaining the balance between electricity supply and demand is one of the major concerns of utility operators. With the increasing contribution of renewable energy sources in the typical supply portfolio of an energy provider, volatility in supply is increasing while the control is decreasing. Real time pricing based on aggregate demand, unfortunately cannot control the non-linear price sensitivity of deferrable/flexible loads and leads to other peaks [4, 5] due to overly homogenous consumption response. In this paper, we present a day-ahead group-based real-time pricing mechanism for optimal demand shaping. We use agent-based simulations to model the system-wide consequences of deploying different pricing mechanisms and design a heuristic search mechanism in the strategy space to efficiently arrive at an optimal strategy. We prescribe a pricing mechanism for each groups of consumers, such that even though consumption synchrony within each group gives rise to local peaks, these happen at different time slots, which when aggregated result in a flattened macro demand response. Simulation results show that our group-based pricing strategy out-performs traditional real-time pricing, and results in a fairly flat peak-to-average ratio.