I construct a general, game theoretic model of markets. Agents in the model choose how much of each good to supply/demand, and at what prices. Trading can occur at non-market-clearing prices. There is an explicit rationing mechanism that kicks in if markets fail to clear. The game is very complicated, but a massive simplification occurs in the limit of a large number of players. This allows a proof of existence of a pure strategy equilibrium. I also prove an analogue of the first fundamental theorem of welfare economics.
The game is Keynesian in that 1) markets needn’t clear at equilibrium so there can be unemployment and 2) there is the possibility of multiple equilibria with different levels of aggregate supply/demand, and distinct Pareto rankings. It is perhaps the first adequately microfounded Keynesian model – there are no crude assumptions on individual behaviour, and there are no representative agents. The model can accommodate fiat money as a store of value and a medium of exchange. The model is well placed for investigating dynamics.