Hello. I'm breaking down some individual aspects of

Warzone Idle and framing them as mathematical problems that I plan to solve analytically.

Some of you have probably wondered how much you can earn by reselling purchased market items. I'm going to calculate the maximum profit for one alloy (or item) based on three assumptions:

1. The sell price of the alloy is

c_1.

2. The initial market price is

c_0, where

c_0 <

c_1.

3. The price increases by

β with each alloy bought. More precisely, the cost of a single alloy depends on

n and equals:

c_n = c_0 + β ⋅ n

Thus, the cost follows an arithmetic progression.

4. The game only shows an average cost

c per alloy for a planned purchase of

n items. The cost

c depends on

n.

**TL;DR:** You need to buy

n_0 = (n + 1) / 2 ⋅ (c_1 - c_0) / (c - c_0)

alloys to gain the profit:

P = n_0 ⋅ [c_1 - c_0 - (n_0 + 1) / (n + 1) ⋅ (c - c_0)]

Derivation:

1. If you plan to buy

n alloys, the game only shows the average cost

c per alloy. Let

c be the average cost for

n alloys. Then:

c ⋅ n = Σ_k=1^n (c_0 + β ⋅ k)

The sum of this arithmetic progression is

Σ_k=1^n (c_0 + β ⋅ n) = n / 2 ⋅ (β + 2 c_0 + β ⋅ n)

We can derive

β from the equation:

c ⋅ n = n / 2 ⋅ (β + 2 c_0 + β ⋅n)

yielding:

β = 2 (c - c_0) / (n + 1)

Since the in-game values are shown rounded, this is only an approximation.

2. Using this, we can find the number

n_0 of alloys for which the sell price equals the buy price. Beyond this point, selling alloys is no longer profitable. This number satisfies the equation

c_1 = c_0 + β ⋅ n_0

giving:

n_0 = (c_1 - c_0) / β

3. Now we can calculate the total profit. Each alloy is sold at a constant price

c_1, and the cost of the bought alloys is the sum of an arithmetic progression:

P = c_1 ⋅ n_0 - Σ_k=1^n_0 (c_0 + β ⋅ n) = c_1 ⋅ n_0 - n_0 / 2 ⋅ (β + 2 c_0 + β ⋅ n_0)

Substituting

β and simplifying (calculations omitted):

P = n_0 ⋅ [c_1 - c_0 - (n_0 + 1) / (n + 1) ⋅ (c - c_0)]

where

n_0, by substituting the expression for

β, is:

n_0 = (n + 1) / 2 ⋅ (c_1 - c_0) / (c - c_0)

All you need to know is: the average price

c of an alloy for

n items.

I hope I haven't messed anything up. I tested the formula only once in practice and worked fine.

Initially, I made a mistake assuming that the cost grows exponentially, looking at the percentage increase. But the price increases arithmetically instead. The profit does not depend on the batch size, that is amount of alloys you buy in a single transaction.

Edited 8/19/2024 13:19:22