Created
February 22, 2024 23:19
-
-
Save harding/3af02613d233554837f7921d7fd44e68 to your computer and use it in GitHub Desktop.
Discrete version of payout matrix from https://delvingbitcoin.org/t/an-onchain-implementation-of-mining-feerate-futures/547/5
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
strategic_hr = 0.25 | |
normal_hr = 0.005 | |
normal_hr = 1 - strategic_hr | |
a = 1 | |
b = 2 | |
a_1 = 0.9 | |
b_1 = 2.2 | |
assert(a_1 < a) | |
assert( (a_1 + b_1) > (a + b ) ) | |
###################### | |
## Strategic payout ## | |
###################### | |
# Finds two blocks in a row | |
strategic_payout = (strategic_hr ** 2) * (a_1 + b_1) | |
# Finds first block only | |
strategic_payout += ((1 - strategic_hr ) * strategic_hr) * a_1 | |
# Finds second block only | |
strategic_payout += (strategic_hr * (1 - strategic_hr)) * b | |
# Finds neither block | |
# (no revenue change) | |
print("Strategic payout per hashrate: ", strategic_payout / strategic_hr) | |
################### | |
## Normal payout ## | |
################### | |
# Finds two blocks in a row | |
normal_payout = (normal_hr ** 2) * (a + b) | |
# Finds first block only | |
normal_payout += (normal_hr * (1 - normal_hr)) * a | |
# Finds second block only | |
normal_payout += ((1 - normal_hr ) * normal_hr) * b_1 | |
# Finds neither block | |
# (no revenue change) | |
print("Normal payout per hashrate: ", normal_payout / normal_hr) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment