Skip to main content

Mining Math (On-chain)

Definitions

Let:

  • SS = room slots (max miners that can run at once)
  • EE = base_emission_per_hash_per_sec (GOLD per second per hash)
  • For each equipped miner instance ii:
    • hih_i = miner hash
    • cdicd_i = cooldown end time (unix seconds)
  • nownow = current time (unix seconds)

Effective hash

Each miner contributes either its hash or 0 if it’s cooling down:

hieff={hiif nowcdi0if now<cdih_i^{eff} = \begin{cases} h_i & \text{if } now \ge cd_i \\ 0 & \text{if } now < cd_i \end{cases}

Total hash in a room

Take the miners equipped in the active room (up to SS slots) and sum:

H=i=1ShieffH = \sum_{i=1}^{S} h_i^{eff}

Base emission (tokens per second)

GOLD/sec=H×E\text{GOLD/sec} = H \times E

Multipliers (room + fuel)

If the contract applies room and fuel multipliers:

GOLD/sec=H×E×Mroom×Mfuel\text{GOLD/sec} = H \times E \times M_{room} \times M_{fuel}

Where MroomM_{room} and MfuelM_{fuel} are multipliers like 1.01.0, 1.21.2, 2.02.0, etc.

Example

Active room slots: S=4S = 4

Equipped miner hashes: [10000, 4000, 1500, 600]

No cooldowns active hieff=hi\Rightarrow h_i^{eff} = h_i

H=10000+4000+1500+600=16100H = 10000 + 4000 + 1500 + 600 = 16100

Example emission rate E=0.0001E = 0.0001:

GOLD/sec=16100×0.0001=1.61\text{GOLD/sec} = 16100 \times 0.0001 = 1.61