Energy balancing in smart microgrid plays a vital role to improve the reliability and resolves the load shedding problem to ensure consistent energy supply. However, energy balancing is challenging due to uncertain and intermittent nature of renewable energy integrated in smart microgrid. To solve such problems, dynamic energy pricing mechanism is developed that maintain energy balance for overcoming the gap between demand and supply. Thus, the particle swarm optimization based super twisting sliding mode controller (PSO-STSMC) is developed which uses dynamic energy pricing to control renewable energy resources' generation according to the consumers' demand for real time closed loop energy balancing in an energy market. The proposed PSO-STSMC based model is compared with existing models like proportional integral derivative (PID) controller, proportional integral (PI) controller, proportional derivative (PD) controller, and fractional order proportional derivative (FO-PD) controller and the optimized models of the particle swarm optimization based proportional integral (PSO-PI) controller and particle swarm optimization based proportional integral derivative (PSO-PID) controller. Simulations results demonstrate that energy price regulation by PSO-STSMC consistently controls the elastic demand for real time energy balancing.INDEX TERMS Smart grid, dynamic price server, elastic demand, renewable energy sources, dynamic energy price, elastic demand, demand side load management, energy balance, super twisting sliding mode controller.