Formula for bulk buying with value based on available stock

22 Views Asked by At

I'm putting together a simulated economy for a game and need help putting together the formula for calculating the total cost of a bulk exchange, where the value of the items changes based on how many are available. I have a formula for single-item exchange, which is
$v=\frac{a}{b}\times{c}$
Where
a = desired amount
b = amount available
c = value when a = b

Would I just use the average of the above value and the calculated value after the exchange?
Like
$v=\frac{(\frac{a}{b}\times{c})+(\frac{a}{b-n}\times{c})}{2}$

I apologize in advance if I've missed something, or asked an obvious question