File tree Expand file tree Collapse file tree 1 file changed +12
-2
lines changed
learning-examples/bonding-curve-progress Expand file tree Collapse file tree 1 file changed +12
-2
lines changed Original file line number Diff line number Diff line change @@ -94,8 +94,18 @@ def print_curve_status(state: dict) -> None:
94
94
state: The parsed bonding curve state dictionary
95
95
"""
96
96
progress = 0
97
- if state ["token_total_supply" ]:
98
- progress = 100 - (100 * state ["real_token_reserves" ] / state ["token_total_supply" ])
97
+ if state ["complete" ]:
98
+ progress = 100.0
99
+ else :
100
+ # Pump.fun constants (already converted to human-readable format)
101
+ TOTAL_SUPPLY = 1_000_000_000 # 1B tokens
102
+ RESERVED_TOKENS = 206_900_000 # 206.9M tokens reserved for migration
103
+
104
+ initial_real_token_reserves = TOTAL_SUPPLY - RESERVED_TOKENS # 793.1M tokens
105
+
106
+ if initial_real_token_reserves > 0 :
107
+ left_tokens = state ["real_token_reserves" ]
108
+ progress = 100 - (left_tokens * 100 ) / initial_real_token_reserves
99
109
100
110
print ("=" * 30 )
101
111
print (f"Complete: { '✅' if state ['complete' ] else '❌' } " )
You can’t perform that action at this time.
0 commit comments