Lord Thane
If that is how it works, why not just automate it:
Buying Algorithm
The total cost of a transaction is the sum of the prices of each individual unit, where each unit's price increases incrementally.
Price of a single unit (Pn): The price of the nth unit is the Current Price plus the Per-Unit Adjustment multiplied by the unit's position in the order (n).
Pn = Current Price + (Per-Unit Adjustment * n)
Total Cost: The total cost is the sum of the prices of all units from 1 to the total quantity (Q).
Total Cost = SUM[n=1 to Q] (Current Price + (Per-Unit Adjustment * n))
This formula can also be simplified for calculation:
Total Cost = (Current Price * Q) + (Per-Unit Adjustment * (Q * (Q+1) / 2))
Final Market Price: The new Current Price is the price of the last unit bought.
Final Market Price = Current Price + (Per-Unit Adjustment * Q)
Selling Algorithm
The total revenue from a transaction is the sum of the prices of each individual unit, where each unit's price decreases incrementally.
Price of a single unit (Pn): The price of the nth unit is the Current Price minus the Per-Unit Adjustment multiplied by the unit's position in the order (n).
Pn = Current Price - (Per-Unit Adjustment * n)
Total Revenue: The total revenue is the sum of the prices of all units from 1 to the total quantity (Q).
Total Revenue = SUM[n=1 to Q] (Current Price - (Per-Unit Adjustment * n))
This formula can also be simplified for calculation:
Total Revenue = (Current Price * Q) - (Per-Unit Adjustment * (Q * (Q+1) / 2))
Final Market Price: The new Current Price is the price of the last unit sold.
Final Market Price = Current Price - (Per-Unit Adjustment * Q)
Example: Buying 500,000 Wood
Let's use the following values:
Current Price: 150 gold
Quantity (Q): 500,000
Per-Unit Adjustment: 0.0000005
Calculate the Total Cost
Using the simplified formula:
Total Cost = (150 * 500,000) + (0.0000005 * (500,000 * 500,001 / 2))
Total Cost = 75,000,000 + (0.0000005 * 125,000,250,000)
Total Cost = 75,000,000 + 62,500.125
Total Cost = approximately 75,062,500 gold
Calculate the Final Market Price
The new market price is the price of the very last unit (the 500,000th unit) that was bought.
Final Market Price = 150 + (0.0000005 * 500,000)
Final Market Price = 150 + 0.25
Final Market Price = 150.25 gold
After this transaction, the market price will publicly update from 150 to 150.25, and any future transactions will be based on this new value. Obviously, the per-unit adjustment would be whatever you like for how quickly you want the market to adjust.