Stock-Flow Consistent Framework


‘Monetary Economics: An Integrated Approach to Credit, Money, Income, Production and Wealth’ authored by the late, great, Wynne Godley and Marc Lavoie are the standard reference.


ModelSIM - The simplest model with government money.

Models must expedite:

  • Integration of economic time-series aggregates.
  • Display path dependence, in that exogenous variables become endogenous variables.

Models will solve computationally; not as systems of equations. Models must remain consistent with stock-flow accounting. Sectoral agents are bound by monetary system stocks and flows.

Framework misunderstanding and agent-based model errors are the developer’s responsibility alone.

Model Accounting Public Code
ModelSIM Accounting GitHub Repository

Right click link to open in new tab, if required.

Opening experiments help us understand monetary circuit stock-flow dynamics.


The purpose of this exercise is to test and understand the stock and flow dynamics of a simple monetary system. This is an agent-based representation of Godley & Lavoie’s (G&L) ModelSIM. We start with a stock-flow consistent model of a hypothetical economy in which there is no private (commercial bank) money and hence there are no interest payments.

In this strongly simplified economy, agents, beyond the institution of government, can be divided conceptually into their business activities on the one hand, selling services and paying out wages and, on the other hand, receiving income, consuming and accumulating assets (monetary wealth) when they act as households.

The government wishes to provision itself. It buys services and pays for them with money, that is, Tenjin Republic Dollars (TRD) (See about tenjinMacro). Money is made acceptable as a means of payment because:

  1. There is a law which makes it legal tender.
  2. Government levies taxes and ordains that these be paid in government money.

Thus, this model describes an economy with government (high-powered) money and no portfolio choice. Production responds immediately to demand in this pure labour economy. The supply of labour never constitutes a constraint on production. The economy is not supply constrained; it is demand led. Whatever is demanded is produced.

Agent-based ModelSIM starts with a number of initial parameters and evolves through time for a given number of iterations.

Number of agents in the population:

  • initial-environment = 1
  • initial-governments = 1
  • initial-consumer-households = 110
  • initial-producer-households = 100

Model iterations: 170

Opening Experiments

Experiment Visualisation
tenjinData ModelSIM

Right click link to open in new tab, if required.

Experiment 1


  1. Government agent stimulus: 20 Money units
  2. Government agent tax rate: 20%
  3. Consumption function:

    1. Proportion of disposable income: 60%
    2. Proportion of (agent wealth) at the opening of the period (iteration): 40%

Money circulates for each period (model iteration) within the system:

  1. The government agent comes in and realises it requires certain services. It then demands (purchases) these services from producer household agents, setting a monetary price of 20 TRD for the services ordered.
  2. Producer household agents then supply services that are paid for by the creation of 20 units of money, that is 20 TRD.
  3. Producer household agents pay consumer household agents with these 20 units of money.
  4. Consumer household agents are obligated to pay taxes on 20% of the money received (TRD tax money are thus destroyed when paid back to the government agent).
  5. Consumer households purchase services from producer households and accumulate money wealth (see consumption function).

Results (On achieving a steady state):

  • National income (Y): 100
  • Government purchasing (money stimulus): 20
  • Government tax receipts: 20
  • Consumption (& disposable income): 80

The initial money injection of 20 TRD has ripple effects throughout the economy. We see that the government injection has multiple effect on income until the model reaches a long-run steady state solution. The stationary steady state of the model is a state in which neither stocks nor flows change, government expenditure must be equal to tax receipts, that is, there is neither a government deficit (money into the economy) nor a government surplus (money out of the economy).


G&L say that with these initial system parameters, the story told by the IS/LM model of a standard textbook, national income (Y) would after one period (iteration) be the equilibrium national income of 38.5. Indeed, the reader of a standard textbook would be told provided government expenditures remained at 20 TRD in the following periods, national income would remain forever at its equilibrium level of 38.5. G&L say that this view of the standard Keynesian multiplier process lacks coherence because the equilibrium value of Y is only a short-run equilibrium. It is not a steady state in the sense that it is not a solution that can repeat itself for a large number of periods. According to G&L, the problem with the standard textbook story is that it deals with flows, while not taking into account the impact of flows on stocks - and the subsequent impact of stocks on flows.

Parameter Changes

Experiment 2

Government tax rate: 0%; government purchasing (money stimulus): 20 TRD

At this tax rate, ModelSIM will never reach steady state.

Experiment 3

Government agent tax rate: 100%; government purchasing (money stimulus): 20 TRD

At this tax rate, both national income and government money supply remain in balance at 20 TRD for every iteration. All money supplied at the beginning of each iteration is removed (returned) in total to government through taxation. Consumer agent(s), though employed, experience no disposable income and therefore enjoy no consumption.

Experiment 4

Government agent tax rate: 20%; government purchasing (money stimulus): 20 TRD

At iteration 85, increase the flow of government stimulus (purchasing) from 20 TRD to 25 TRD for each remaining iteration. Disposable income, consumption and therefore national income gradually reflect the increase in government money stimulus.

Experiment 5

Government agent tax rate: 20%; government purchasing (money stimulus): 20 TRD

At iteration 85, decrease the flow of government stimulus (purchasing) from 20 TRD to 15 TRD for each remaining iteration. Disposable income, consumption and therefore national income gradually reflect the decrease in government money stimulus.

Experiment 6

Government agent tax rate: 37%; government purchasing (adjusting money stimulus): Starting at 20 TRD

The government agent will decide the stimulus amount for each iteration based on the disapproval ratings it is receiving from consumer agents. Once ‘disapproval’ reaches a minimum 50% of the consumer agent population, government stimulus is increased by an amount that is between 3% and 8% (randomly decided) of the previous iteration stimulus. Disposable income, consumption, national income, government fiscal balance (deficit / surplus) and of course consumer approval ratings all reflect increased government stimulus spending.

On experiment run 6, the consumer agent population desire to increase its (cash equity) wealth over time causes government fiscal balance (deficit) effects. Experiment 6 circumvents long-run ( > 500 iterations ) government fiscal balance exponential dynamics because:

  1. There is some level of taxation (37%).
  2. Consumer agents pay tax.
  3. Money supply is free of interest (There is no other option in ModelSIM).


Python Programming Language
Project Mesa Agent-Based Modelling Framework
Redis In-Memory Data Structure Store
PostgreSQL Relational Database
Tableau Data Analysis Platform

Start here, or if you have come from chapter 1, go here.