""" Lockdrop calculation constants and configuration. This module contains all constants used in lockdrop token distribution calculations. """ from decimal import Decimal, ROUND_DOWN, getcontext # Configure decimal precision getcontext().prec = 28 getcontext().rounding = ROUND_DOWN # Token Constants TOKEN_PRECISION = Decimal('0.00000001') # 8 decimal precision TOTAL_SUPPLY = 4294967296 # 1 $Z per Urbit ID LOCKDROP_ALLOCATION_PERCENT = Decimal('0.3') LOCKDROP_ALLOCATION = TOTAL_SUPPLY * LOCKDROP_ALLOCATION_PERCENT # Urbit Point Counts NUM_GALAXIES = pow(2, 8) NUM_STARS = pow(2, 16) - pow(2, 8) NUM_PLANETS = pow(2, 32) - pow(2, 16) # Allocation Distribution 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 BLOCK_DURATION_SECONDS = 2 LOCKDROP_DURATION_BLOCKS = int(LOCKDROP_DURATION_SECONDS / BLOCK_DURATION_SECONDS) # Penalty Rates by Lock Period PENALTY_RATES = { 5: Decimal('0'), 4: Decimal('0.2'), 3: Decimal('0.4'), 2: Decimal('0.6'), 1: Decimal('0.8') } # Preset Scenarios for Experimentation SCENARIOS = { "balanced": { "description": 'Balanced distribution across all lock periods', "stars": {"1_year": 8000, "2_year": 8000, "3_year": 8000, "4_year": 8000, "5_year": 8000}, "galaxies": {"1_year": 40, "2_year": 40, "3_year": 40, "4_year": 40, "5_year": 40} }, "five_year_focused": { "description": 'Most participants choose 5-year lock (maximum bonus scenario)', "stars": {"1_year": 2000, "2_year": 2000, "3_year": 3000, "4_year": 5000, "5_year": 28000}, "galaxies": {"1_year": 10, "2_year": 10, "3_year": 20, "4_year": 30, "5_year": 130} }, "short_term_focused": { "description": 'Most participants choose shorter locks (high penalty scenario)', "stars": {"1_year": 20000, "2_year": 15000, "3_year": 4000, "4_year": 800, "5_year": 200}, "galaxies": {"1_year": 100, "2_year": 80, "3_year": 15, "4_year": 3, "5_year": 2} }, "low_participation": { "description": 'Low overall participation scenario', "stars": {"1_year": 1000, "2_year": 800, "3_year": 600, "4_year": 400, "5_year": 200}, "galaxies": {"1_year": 8, "2_year": 6, "3_year": 4, "4_year": 2, "5_year": 5} } }