I've got a rough concept for a trading game in my head and I can't figure out what seems to be basic math.
My cities / space stations / trading posts shall have the following rules:
- supply and demand are limited
- prices adjust according to it
- players as well as NPC traders drive the prices
So the idea is that if X produces less food than it consumes, then over time the price of food rises, and when it's almost empty, it skyrockets. While Y is a net producer, and the price falls over time. This creates a trade opportunity Y -> X whose profitability depends on how many people run the route - if many people trade Y -> X then the prices equal out.
To ensure that players don't simply collude on hoarding food just outside of X, waiting until prices rise and then selling, NPC traders would jump on the most profitable trade routes to keep price differences and demand within reasonable parameters.
I've thought about storage sizes and how prices can swing, but every formula I come up with fails some simple tests. For example, if the total storage of X is 1000 units when the player arrives, he can just buy 500, wait for the price to rise, then sell it again - profit. Obviously, that shouldn't work.
I tried several searches both on Google and here and on Gamasutra and while I found some ideas, I didn't find what seems to me should be a simple formula.