Agent based market economy simulator 

where each agent has a job

What if when you spend money to buy something, that money doesn't simply disappear? What if someone else takes that money and spends on something else. When everyone is trying to make a profit, where does all the money end up? Does wealth inequality a natural destination for a market based economy? How does banking interact with the economy? What, ultimately, does it mean for an economy to be rich? 

This is my attempt to understand how modern economies function by implementing a toy simulator that replicates all the major mechanisms. It won't necessarily reflect the real world, but it should offer some insights into how certain mechanisms interact with each other in an interactive and dynamic system.

A break down of the economy:

  • Farmers: 2 wood + 1 tool => 8 food
  • Loggers: alive => 2 wood
  • Miners: alive => 2 ore
  • Smiths: 3 metal => 1 metal
  • Tool maker: 2 metal => 1 tool

Tools have a 10% chance of breaking down

Food Consumption

Each agent consumes 1-4 food per round depending on their food inventory levels (>0, > 5, >10, >20); the more food an agent has, the more they will consume

Trades 

Trades are made when a buyer bids higher than or equal to a seller's asking price.

An agent will lower their bidding price if it couldn't sell all or did buy all in one round; they will raise price if sold all or didn't buy all they wanted. 

Each agent tries to sell their entire inventory and spend as much as their money as they can every turn. This is an initial implementation to keep the economy running. See roadmap for more.

Approval 

Approval is an average of the log of hunger levels of all agents. 1 food = .13 approval, 5 food = .44, 10 food = .63, 20 food = .79

FoodApproval
1.13
5.44
10.63
20.79

Inflation is an exponential average where all commodities are equally weighted w/ n=3 over time

Banking

When  an agent has no money and nothing to sell, they will borrow from the bank to be repaid over 30 turns at 2% interest per turn. Interest will be paid first when agent has less than payment amount. Agent can borrow more (unlimited) to cover for missing payment. Agent will keep 5x input batches worth of cash on person and deposit the rest. Bank will only loan 90% of its deposits, starting with $100 deposit at game start. At some point the bank will not loan out any more and agents can miss payments because they can't borrow to cover. 5 missed payments = 1 defaults. 3 defaults will cause bank to liquidate agents assets. 

Treasury

Government starts the game with $1000 and can go into the negative without bounds. Maintaining a surplus will require enabling taxes.

Player Controls

The player has the ability to influence the market with several monetary and financial levers. 

Reserve and Welfare

Government can keep a reserve of food, and distribute food to agents that has been starving for x days. Government will spend own money in market to replenish food at sub average clearing price (to not compete with population when demand > supply). Government can also increase its own reserve to stimulate demand for a certain good. When reserve is lowered the government will sell back to the market.

Sales Tax

Government can collect a % of clearing price from buyer after each transaction for each commodity.

Income Tax

Government can collect a % of income (pre tax profits) after each round. With controllable tax rate per controllable bracket.

Subsidies

Government can give back to the buyer a percentage of the clearing price for each commodity.

Roadmap:

  • Population growth with minimum food levels per agent
  • Labor market with government control over number of gov jobs
  • Game over screen when approval dips below a certain percentage
  • Approval score to depend on food levels, days starving, inflation, GDP per capita, debt to GDP ratio, etc.
  • More sophisticated trading algorithm (I had experimented with some algorithms where less is put up for auction when prices are less favorable to the agent but that lead to choking trades real quick. )
  • Add multiple currencies, multiple economies (nations), a currency market, importers and exporters to trade between economies, speculators, stock market, bonds, bonds speculators. Everything needed to replicate the effects of a global reserve currency and the exorbitant privilege that entails.

Similarity to Other Economic Simulator Games

The one game other people frequently points to regarding economic simulators are Victoria 2 and 3. There are a few differences vs Victoria 2:

  • In Vic2, money earned is pooled together and redistributed based on output or investment. In EconSim, each agent earns (or loses) money via individual trades based on their offer and accepted prices and cost of production (or survival).
  • There is only 1 auction like Vic2 at the moment. But trade order is decided entirely by price and not prestige or any other overriding modifiers.
  • There are no distinctions between ROG or capitalists etc. Everyone is an agent. An agent can be anyone.
  • The bank will invest in anyone who asks for it. Basically that means it will invest in future growth (and other less productive investments)
  • There is no personal checking accounts, each agent keeps a stash of cash for the current round, left overs are stored in the bank in their own accounts.
  • Banks don't literally take money from people's deposits and lend it to others. Subject to change.
Updated 7 days ago
Published 10 days ago
StatusPrototype
PlatformsHTML5
Authoromikun
GenreSimulation
Made withUnity
TagsEconomy

Leave a comment

Log in with itch.io to leave a comment.