Skip to content

Commit 6916796

Browse files
authored
fix: update stx year 2050 supply to reflect sip-031 increase (#2334)
* fix: update stx year 2050 supply to reflect sip-031 increase * fix: remove 2050 from response * fix: tests
1 parent 7e8905c commit 6916796

File tree

2 files changed

+10
-7
lines changed

2 files changed

+10
-7
lines changed

src/helpers.ts

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -167,8 +167,11 @@ export function formatMapToObject<TKey extends string, TValue, TFormatted>(
167167
// > Block reward: 1000 STX/block for first 4 yrs;
168168
// > 500 STX/block for following 4 yrs;
169169
// > 250 for the 4 yrs after that; and then 125 STX/block in perpetuity after that.
170-
// We are going to use the year 2050 projected supply because "125 STX/block in perpetuity" means the total supply is infinite.
171-
export const TOTAL_STACKS_YEAR_2050 = new BigNumber(1_818_000_000n.toString());
170+
// We are going to use the year 2050 projected supply because "125 STX/block in perpetuity" means
171+
// the total supply is infinite.
172+
// After SIP-031 was activated with Stacks 3.2, however, the total supply was increased by 500M STX
173+
// to 2.318B STX.
174+
export const TOTAL_STACKS_YEAR_2050 = new BigNumber(2_318_000_000n.toString());
172175

173176
const MICROSTACKS_IN_STACKS = 1_000_000n;
174177
export const STACKS_DECIMAL_PLACES = 6;

tests/api/other.test.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -147,7 +147,7 @@ describe('other tests', () => {
147147
const expectedResp1 = {
148148
unlocked_percent: '100.00',
149149
total_stx: '235000000.000000',
150-
total_stx_year_2050: '1818000000.000000',
150+
total_stx_year_2050: '2318000000.000000',
151151
unlocked_stx: '235000000.000000',
152152
block_height: 1,
153153
};
@@ -175,7 +175,7 @@ describe('other tests', () => {
175175
unlocked_percent: '100.00',
176176
total_stx: microStxToStx(expectedTotalStx2),
177177
unlocked_stx: microStxToStx(expectedTotalStx2),
178-
total_stx_year_2050: '1818000000.000000',
178+
total_stx_year_2050: '2318000000.000000',
179179
block_height: dbBlock1.block_height,
180180
};
181181
expect(JSON.parse(result2.text)).toEqual(expectedResp2);
@@ -206,7 +206,7 @@ describe('other tests', () => {
206206
const expectedResp3 = {
207207
unlocked_percent: '100.00',
208208
total_stx: microStxToStx(expectedTotalStx3),
209-
total_stx_year_2050: '1818000000.000000',
209+
total_stx_year_2050: '2318000000.000000',
210210
unlocked_stx: microStxToStx(expectedTotalStx3),
211211
block_height: dbBlock1.block_height,
212212
};
@@ -236,8 +236,8 @@ describe('other tests', () => {
236236
unlockedSupplyFormatted: new Intl.NumberFormat('en', {
237237
minimumFractionDigits: STACKS_DECIMAL_PLACES,
238238
}).format(parseInt(microStxToStx(expectedTotalStx3))),
239-
totalStacksYear2050: '1818000000.000000',
240-
totalStacksYear2050Formatted: '1,818,000,000.000000',
239+
totalStacksYear2050: '2318000000.000000',
240+
totalStacksYear2050Formatted: '2,318,000,000.000000',
241241
blockHeight: dbBlock1.block_height.toString(),
242242
};
243243
expect(JSON.parse(result6.text)).toEqual(expectedResp6);

0 commit comments

Comments
 (0)