Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions src/config/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ export const config = {
apiUrl: '',
verbose: false,
genesisSHMSupply: 249000000,
burnedSupply: 500000, // 500,000 SHM burned
dbPath: process.env.DB_PATH?.replace(/\/+$/, '') || '.', // remove
rateLimit: 100,
GTM_Id: '',
Expand Down
2 changes: 1 addition & 1 deletion src/stats/supplyStats.ts
Original file line number Diff line number Diff line change
Expand Up @@ -221,7 +221,7 @@ export async function updateSupplyStatsCache(): Promise<void> {

const secureAccountsBalance = await calculateSecureAccountsBalance()

const circulatingSupply = BASE_SUPPLY - totalShmBurned + totalShmRewarded - secureAccountsBalance
const circulatingSupply = BASE_SUPPLY - totalShmBurned + totalShmRewarded - secureAccountsBalance - config.burnedSupply

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggestion: Subtracting both totalShmBurned and config.burnedSupply may result in double-counting burned supply if totalShmBurned already includes the value from config.burnedSupply. Ensure that totalShmBurned and config.burnedSupply are mutually exclusive to avoid underreporting circulating supply. [possible issue, importance: 7]

Suggested change
const circulatingSupply = BASE_SUPPLY - totalShmBurned + totalShmRewarded - secureAccountsBalance - config.burnedSupply
// Ensure totalShmBurned does not already include config.burnedSupply to avoid double-counting
const circulatingSupply = BASE_SUPPLY - (totalShmBurned + config.burnedSupply) + totalShmRewarded - secureAccountsBalance


await saveSupplyStatsCache({
lastCycle: latestCycle,
Expand Down
Loading