Use Decimals for allocation percentages

This commit is contained in:
Prathamesh Musale 2025-10-30 17:58:17 +05:30
parent 791dfd88a6
commit 68b5761651
2 changed files with 9 additions and 9 deletions

View File

@ -22,8 +22,8 @@ NUM_STARS = pow(2, 16) - pow(2, 8)
NUM_PLANETS = pow(2, 32) - pow(2, 16)
# Allocation Distribution
STAR_ALLOCATION_PERCENT = 0.99
GALAXY_ALLOCATION_PERCENT = 0.01
STAR_ALLOCATION_PERCENT = Decimal('0.99')
GALAXY_ALLOCATION_PERCENT = Decimal('0.01')
# Lockdrop Duration (5 years including 1 leap year)
LOCKDROP_DURATION_SECONDS = 5 * 365.25 * 24 * 60 * 60

View File

@ -31,7 +31,7 @@ def print_constants_summary():
# Lockdrop Allocation Table
lockdrop_df = pd.DataFrame({
'Parameter': ['Total Supply (1 $Z per Urbit ID)', 'Lockdrop Allocation %', 'Lockdrop Allocation ($Z)'],
'Value': [f"{TOTAL_SUPPLY:,}", f"{LOCKDROP_ALLOCATION_PERCENT:.1%}", f"{LOCKDROP_ALLOCATION:,.1f}"]
'Value': [f"{TOTAL_SUPPLY:,}", f"{LOCKDROP_ALLOCATION_PERCENT:.2%}", f"{LOCKDROP_ALLOCATION:,.1f}"]
})
print_table_with_borders(lockdrop_df, "🔒 LOCKDROP ALLOCATION")
@ -46,7 +46,7 @@ def print_constants_summary():
# Penalty Schedule Table
penalty_df = pd.DataFrame({
'Lock Period': ['5 Years', '4 Years', '3 Years', '2 Years', '1 Year'],
'Penalty Rate': [f"{PENALTY_RATES[year]:.1%}" for year in [5, 4, 3, 2, 1]],
'Penalty Rate': [f"{PENALTY_RATES[year]:.2%}" for year in [5, 4, 3, 2, 1]],
'Token % of Max': ['100%', '80%', '60%', '40%', '20%']
})
print_table_with_borders(penalty_df, "⚖️ PENALTY SCHEDULE")
@ -132,7 +132,7 @@ def print_penalty_analysis(allocation_data):
penalty_analysis_df = pd.DataFrame({
'Lock Period': ['5 Years', '4 Years', '3 Years', '2 Years', '1 Year'],
'Penalty Rate': [f"{PENALTY_RATES[year]:.1%}" for year in [5, 4, 3, 2, 1]],
'Penalty Rate': [f"{PENALTY_RATES[year]:.2%}" for year in [5, 4, 3, 2, 1]],
'Star Allocation ($Z)': [f"{adjusted_max_allocation_per_star * (1 - PENALTY_RATES[year]):,.6f}" for year in [5, 4, 3, 2, 1]],
'Galaxy Allocation ($Z)': [f"{adjusted_max_allocation_per_galaxy * (1 - PENALTY_RATES[year]):,.6f}" for year in [5, 4, 3, 2, 1]],
'vs Max Allocation': ['100%', '80%', '60%', '40%', '20%']
@ -153,9 +153,9 @@ def print_participation_summary(allocation_data):
participation_df = pd.DataFrame({
'Lock Period': ['1 Year', '2 Years', '3 Years', '4 Years', '5 Years', 'Total'],
'Stars': [f"{stars_counts[year]:,}" for year in [1, 2, 3, 4, 5]] + [f"{total_stars_locked:,}"],
'% of Total Stars': [f"{stars_counts[year]/NUM_STARS:.2%}" for year in [1, 2, 3, 4, 5]] + [f"{total_stars_locked/NUM_STARS:.1%}"],
'% of Total Stars': [f"{stars_counts[year]/NUM_STARS:.2%}" for year in [1, 2, 3, 4, 5]] + [f"{total_stars_locked/NUM_STARS:.2%}"],
'Galaxies': [f"{galaxies_counts[year]:,}" for year in [1, 2, 3, 4, 5]] + [f"{total_galaxies_locked:,}"],
'% of Total Galaxies': [f"{galaxies_counts[year]/NUM_GALAXIES:.2%}" for year in [1, 2, 3, 4, 5]] + [f"{total_galaxies_locked/NUM_GALAXIES:.1%}"],
'% of Total Galaxies': [f"{galaxies_counts[year]/NUM_GALAXIES:.2%}" for year in [1, 2, 3, 4, 5]] + [f"{total_galaxies_locked/NUM_GALAXIES:.2%}"],
'Total': [f"{stars_counts[year] + galaxies_counts[year]:,}" for year in [1, 2, 3, 4, 5]] + [f"{total_stars_locked + total_galaxies_locked:,}"],
})
@ -218,7 +218,7 @@ def print_final_allocations_and_verification(allocation_data, final_data):
# Star Final Allocations Table
star_final_df = pd.DataFrame({
'Lock Period': ['5 Years', '4 Years', '3 Years', '2 Years', '1 Year'],
'Penalty': [f"{PENALTY_RATES[year]:.1%}" for year in [5, 4, 3, 2, 1]],
'Penalty': [f"{PENALTY_RATES[year]:.2%}" for year in [5, 4, 3, 2, 1]],
'Final Allocation ($Z)': [f"{final_star_allocations[year]:,.8f}" for year in [5, 4, 3, 2, 1]],
'Z per Block': [f"{star_z_per_block[year]:,.8f}" for year in [5, 4, 3, 2, 1]],
'Participants': [f"{stars_counts[year]:,}" for year in [5, 4, 3, 2, 1]]
@ -228,7 +228,7 @@ def print_final_allocations_and_verification(allocation_data, final_data):
# Galaxy Final Allocations Table
galaxy_final_df = pd.DataFrame({
'Lock Period': ['5 Years', '4 Years', '3 Years', '2 Years', '1 Year'],
'Penalty': [f"{PENALTY_RATES[year]:.1%}" for year in [5, 4, 3, 2, 1]],
'Penalty': [f"{PENALTY_RATES[year]:.2%}" for year in [5, 4, 3, 2, 1]],
'Final Allocation ($Z)': [f"{final_galaxy_allocations[year]:,.8f}" for year in [5, 4, 3, 2, 1]],
'Z per Block': [f"{galaxy_z_per_block[year]:,.8f}" for year in [5, 4, 3, 2, 1]],
'Participants': [f"{galaxies_counts[year]:,}" for year in [5, 4, 3, 2, 1]]