Formulas

Mining Reward

The LODE reward is calculated at mint creation and locked in:
baseReward = mintableLode x mintPower x numOfDays
baseReward -= baseReward x 0.0011 x (numOfDays - 1)     // 0.11% daily reduction

reward = baseReward
reward += baseReward x EAABonus / (100 x 1e6)            // Early Adopter bonus
reward += baseReward x burnAmpBonus / (100 x 1e18)       // Burn amplifier
reward /= 100                                             // Normalize by max mint power

if referred:
    reward += reward x 5000 / 100000                      // +5% referral bonus

Mint Power Bonus (at claim)

bonus = mintPowerBonus x mintPower x (currentGlobalMintPower - mintGlobalMintPower) x 1e18 / 100
finalReward = mintableLode + bonus / 1e7

Mint Cost

singleMintCost = currentMintCost x mintPower / 100
batchCost = currentMintCost x mintPower x count / 100

Share Calculation

shareBonus = min(numOfDays, 2888) x 1e11 / 825                   // Longer Pays Better
           + min(amount, 100B x 1e18) x 1e11 / (1.25T x 1e18)   // Bigger Pays Better

shares = amount + amount x shareBonus / 1e11
shares = shares / (shareRate / 1e18)

Payout Per Share

payoutPerShare = cyclePoolReward x 1e18 / globalActiveShares
userReward = userShares x payoutPerShare / 1e18

Burn Pool Reward

burnPayoutPerToken = burnPoolReward x 1e18 / totalCycleBurn
userReward = burnPayoutPerToken x userCycleBurn / 1e18

Burn Amplifier

if userBurnTotal >= 80B LODE:
    bonus = 8% (8 x 1e18)
else:
    bonus = 8 x 1e18 x userBurnTotal / (80B x 1e18)

Daily Parameter Updates

Each day, parameters are multiplied by their step factors:
newMintCost = oldMintCost x 10008 / 10000       // +0.08%
newShareRate = oldShareRate x 10003 / 10000      // +0.03%
newMintableLode = oldMintable x 9965 / 10000     // -0.35%
newMintPowerBonus = oldBonus x 9965 / 10000      // -0.35%
newEAABonus = oldEAA - 28571                     // fixed daily reduction (until ~day 350)

Penalties

Late Mint Claim

Days After Grace (7)Penalty
00%
11%
23%
38%
417%
535%
672%
7+99%

End Stake

Before maturity (EES): 50% flat penalty. Requires >= 50% of duration elapsed. After maturity: 7-day grace period, then 1%/day, capped at 99%.
if matured:
    lateDays = (currentTime - maturityTime - gracePeriod) / 86400
    penalty = min(lateDays + 1, 99)
else if >= 50% duration:
    penalty = 50
else:
    revert  // cannot end stake

Fee Distribution

incentiveFee = totalFees x 3300 / 1000000           // 0.33%
remaining = totalFees - incentiveFee

buyAndBurn = remaining x 6200 / 10000               // 62%
burnPool = remaining x 700 / 10000                   // 7%
genesis = remaining x 300 / 10000                    // 3%
cyclePayouts = remaining - buyAndBurn - burnPool - genesis  // ~28%

cycle8Pool += cyclePayouts x 3000 / 10000            // 30%
cycle28Pool += cyclePayouts x 3000 / 10000           // 30%
cycle90Pool += cyclePayouts x 2000 / 10000           // 20%
cycle369Pool += cyclePayouts x 2000 / 10000          // 20%

Exchange Rate (PrelodeBurnRedeemer)

lodeEntitlement = totalPrelodeBurned x exchangeRate
claimable = lodeEntitlement - alreadyClaimed

// Default: exchangeRate = 1e12
// 1 PRELODE (6 dec) x 1e12 = 1e18 raw LODE = 1 LODE (18 dec)