I am trying to figure out an algorithm that I can apply to my supply/demand vendor system.

Here is the scenario

The base value for product A is $0.28

At Vendor A the price for product A is $0.35 due to the location being further away from the market.

So if the base price is $0.35 at Vendor A, how can I figure out what his/her inflation should be for the supply/demand?

For instance, lets say Vendor A's price is at $0.35/unit and he has 20,000 units in stock. Someone comes in and buys 10,000 units. Now his stock is at 10,000 units, so his price per unit should increase accordingly.

The second trick of this equation is to make the algorithm apply to that the inflation is correct by each base price.

Market Base Price for Product A: $0.28
Vendor A: base price $0.35
Vendor B: base price $0.24
Vendor C: base price $0.32

Please let me know if anyone needs more information to help.