In the realm of dynamic demand, prosumers are agents that can produce and consume goods. In this paper, the problem we address involves a large population of prosumers and each prosumer has to decide if (s)he wants to produce or consume a certain amount of goods. The strategy of each agent depends on the average behavior of the population. We set the problem in a game-theoretic framework by modeling every prosumer as a player. For every player, a cost functional is designed to incentivize cooperation among the players. By taking the population size very large, a mean field game arises. The contributions of this paper are as follows. Firstly, we formulate the problem as first-order and second-order mean field games, the latter arises when we take stochastic disturbances into account. Secondly, mean field equilibria are derived by studying the corresponding linear-quadratic optimal control problem. Thirdly, results on stability of the first-order and second-order equilibria are established. A numerical study covering our findings concludes the paper.