Last active
December 2, 2025 16:04
-
-
Save kdmukai/f16d332a499b7b6b8666aacd7a4354cc to your computer and use it in GitHub Desktop.
Power Law & Power Law Floor calculations
This file contains hidden or 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
| """ | |
| Bitcoin Power Law: | |
| 1.0117e-17 * (days since genesis block)^5.82 | |
| Bitcoin Power Law Floor: | |
| (power law) * 0.42 | |
| Note: Model projections said to be invalid beyond 2040. | |
| """ | |
| import argparse | |
| from datetime import date | |
| from decimal import Decimal | |
| GENESIS = date.fromisoformat('2009-01-03') | |
| POWER_FACTOR = Decimal('5.82') | |
| POWER_COEFFICIENT = Decimal('1.0117e-17') | |
| FLOOR_MULTIPLIER = Decimal('0.42') | |
| def power_law(target_date: date, use_floor_model: bool = False) -> Decimal: | |
| """Calculate the Power Law projection for a given date.""" | |
| days_since_genesis = (target_date - GENESIS).days | |
| power_law_value = Decimal(POWER_COEFFICIENT * Decimal(days_since_genesis)**POWER_FACTOR).quantize(Decimal('1.00')) | |
| if use_floor_model: | |
| return (power_law_value * FLOOR_MULTIPLIER).quantize(Decimal('1.00')) | |
| return power_law_value | |
| def power_law_end_of_year_chart(): | |
| title = "\nPower law & power law floor at end of year:" | |
| print(title) | |
| print("-" * len(title)) | |
| print(f"Year | Power Law | Floor") | |
| print("-" * len(title)) | |
| for year in range(2009, 2041): | |
| target_date = date(year, 12, 31) | |
| power_law_value = power_law(target_date) | |
| power_law_floor = power_law(target_date, use_floor_model=True) | |
| print(f"{year} | {int(power_law_value):9,} | {int(power_law_floor):9,}") | |
| if __name__ == "__main__": | |
| parser = argparse.ArgumentParser( | |
| description="Calculate Bitcoin Power Law projections" | |
| ) | |
| parser.add_argument( | |
| 'date', | |
| type=str, | |
| nargs='?', | |
| help='Calculate power law values for a specific date (format: YYYY-MM-DD, e.g., 2025-12-15)' | |
| ) | |
| args = parser.parse_args() | |
| if args.date: | |
| try: | |
| target_date = date.fromisoformat(args.date) | |
| power_law_value = power_law(target_date) | |
| power_law_floor = power_law(target_date, use_floor_model=True) | |
| # Calculate width needed for right justification | |
| power_law_str = f"${int(power_law_value):,}" | |
| power_law_floor_str = f"${int(power_law_floor):,}" | |
| width = max(len(power_law_str), len(power_law_floor_str)) | |
| print(f"Power Law calculations for {args.date}:") | |
| print(f" Power Law Value: {power_law_str:>{width}}") | |
| print(f" Power Law Floor: {power_law_floor_str:>{width}}") | |
| except ValueError as e: | |
| print(f"Error: Invalid date format. Please use YYYY-MM-DD format (e.g., 2025-12-15)") | |
| raise | |
| else: | |
| power_law_end_of_year_chart() | |
| """ | |
| Power law & power law floor at end of year: | |
| -------------------------------------------- | |
| Year | Power Law | Floor | |
| -------------------------------------------- | |
| 2009 | 0 | 0 | |
| 2010 | 0 | 0 | |
| 2011 | 4 | 2 | |
| 2012 | 26 | 11 | |
| 2013 | 96 | 40 | |
| 2014 | 278 | 116 | |
| 2015 | 682 | 286 | |
| 2016 | 1,488 | 625 | |
| 2017 | 2,954 | 1,240 | |
| 2018 | 5,456 | 2,291 | |
| 2019 | 9,503 | 3,991 | |
| 2020 | 15,791 | 6,632 | |
| 2021 | 25,162 | 10,568 | |
| 2022 | 38,731 | 16,267 | |
| 2023 | 57,869 | 24,305 | |
| 2024 | 84,334 | 35,420 | |
| 2025 | 120,009 | 50,404 | |
| 2026 | 167,365 | 70,293 | |
| 2027 | 229,248 | 96,284 | |
| 2028 | 309,231 | 129,877 | |
| 2029 | 410,744 | 172,512 | |
| 2030 | 538,425 | 226,138 | |
| 2031 | 697,355 | 292,889 | |
| 2032 | 893,904 | 375,439 | |
| 2033 | 1,133,542 | 476,087 | |
| 2034 | 1,424,098 | 598,121 | |
| 2035 | 1,773,791 | 744,992 | |
| 2036 | 2,193,032 | 921,073 | |
| 2037 | 2,689,722 | 1,129,683 | |
| 2038 | 3,276,159 | 1,375,987 | |
| 2039 | 3,964,739 | 1,665,190 | |
| 2040 | 4,771,455 | 2,004,011 | |
| """ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment