Skip to content

Overview

Si Li edited this page Feb 27, 2025 · 2 revisions

Introduction

Where does new money come from? Where does money go after you spend it? Who ends up accumulating wealth and how long does that last? What happens to the economy when wealth disparity grows without bounds? What are the limits of wealth inequality? These are some of the questions I want to answer and communicate via a simulation of trade between individually modeled agents with their own cash, inventory of goods, and their asymmetric knowledge of the market.

Goals

EconSim strives to create a plausible circulation of goods and currency between a group of agents that would follow certain trends, such as

  • Price fluctuates with supply and demand
  • Lower interest rate would increase loans,
    • this drives up money supply
      • and thus demand
        • and thus price
  • Multiple markets and with their own currencies,
    • Currency exchange rates would fluctuate, same as price
      • demand for currency depends on what goods can be bought with it
      • supply depends on availability as deposits in banks?
  • taxing profit, import, or wealth could influence demand and thus price
  • understand where all the money is circulated in the system
    • that they disappear into savings and must be clawed back out with
      • taxes
      • bonds
      • stock market
    • Loans are another way to recycle savings to put them back into the economy at the cost of interest -> inflation or devaluation of money

Implementation

AuctionHouse.cs

Each district is a self enclosed auction house of all agents in the district

  • each agent consumes own input, produces outputs, creates bids and asks
  • each round, facilitates trades between agents
  • lowest priced asks matched with highest bids, transactions cleared with average of offer prices

AuctionStats.cs

Keeps track of all trading stats of a district, currently also of the simulation but that needs to be moved out

EconAgent.cs

Each agent has an inventory of commodities called InventoryItems, Each turn an agent will

  • consume inputs at the maximum allowed
  • produce as many goods as it can per turn
  • consume food at rate based on available inventory
  • Determine number of bids to make to refill inventory based on available food and cash on hand
  • Borrows money from bank if not enough to bid on things or pay back on loan
  • Makes loan payments before bidding
  • Detailed Overview

Government

A derivative of EconAgent. Government is the player controlled character that can make direct impact to the simulation

  • Buy and sell goods to achieve balance (agents with unsold inventory tend to be poor, can't buy food, and ends up starving to death)
  • Change interest rate to promote borrowing
  • Tax trades or profit or wealth, reduce money supply to curb inflation
  • subsidize expensive goods to keep vital production

InventoryItem.cs

Each item adjusts it's own price beliefs after each round of trading

  • uses market condition, avg trading prices, number of goods sold/bought by agent, inventory quantity, etc to raise or lower it's own expectation of it's own price (which may be very different from actual price because transaction prices are averaged across bid and ask prices)
  • Detailed overview

Clone this wiki locally