snarkvm_ledger_block

Function block_reward_v2

Source
pub fn block_reward_v2(
    total_supply: u64,
    time_since_last_block: i64,
    coinbase_reward: u64,
    transaction_fees: u64,
) -> u64
Expand description

Calculate the V2 block reward, given the total supply, block interval, coinbase reward, and transaction fees. R_staking = floor((0.05 * S) * clamp(I, MIN_BI, MAX_BI) / S_Y) + CR / 3 + TX_F. S = Total supply. I = Seconds elapsed since last block. S_Y = Seconds in a year (31536000). CR = Coinbase reward. TX_F = Transaction fees. MIN_BI = Minimum block interval. MAX_BI = Maximum block interval.