toddmedema / electrify

Take Charge of the Power Market
http://electrifygame.com
MIT License
6 stars 2 forks source link

Make INTEREST_RATE_YEARLY and INFLATION dynamic, simulated values #88

Open toddmedema opened 3 months ago

toddmedema commented 3 months ago

The interest rate for a company is a combination of two factors:

  1. Macroeconomic conditions and prime interest rate (download and use historic monthly prime rates back to 1980 from something like https://www.jpmorganchase.com/about/our-business/historical-prime-rate, and then in the future, it should range between 3.25% and 15%, biased towards 5%, and moving in large swings and then stabilizing, like a sine curve that rests at the top and bottom, at a random 6-12 year cadence)
  2. Also better-simulate inflation, and the interaction between the two (e.g. high growth leads to high inflation leads to high interest rates, which then inverts the cycle, on a 8-12 year cadence)
  3. The company's trustworthiness (perhaps a reasonable proxy would be to blend profit margin as a % of revenue and cash on hand). A perfectly trustworthy company would have, say, 10%+ of its net worth as liquid cash, and a profit margin of 10%+, and would pay just the prime rate. For every X point either is lower, the company should pay 5X% of prime, e.g. if they're at 0% and 5%, they have 15 "points" x 5 = 60% higher than prime (so if Prime were 5%, they'd pay 8%). Note that profit margin can go negative, and it should accumulate further points if so.

Simulating it means it will need to be calculated as part of the timeline/monthlyHistory

Then we can track it as part of timeline / history and add it to the Finances tab, as a row in the expanded table (perhaps just below "loan interest") + a metric you can chart

Consideration: This will, on average, make the game more difficult, given that the current rate is hard-coded at 4%. So, rebalance scenarios by boosting all their starting cash by 10% (in Scenarios.tsx)