Skip to content

Commit 3486811

Browse files
committed
fix: balance ranges in rollup-daily-balance-distribution
1 parent 8f6b8be commit 3486811

File tree

1 file changed

+16
-16
lines changed

1 file changed

+16
-16
lines changed

scripts/rollup-daily-balance-distribution.mjs

+16-16
Original file line numberDiff line numberDiff line change
@@ -105,18 +105,18 @@ class BigMap {
105105

106106
const get_daily_stats = ({ account_frontiers_cache, time }) => {
107107
const balance_ranges = [
108-
{ key: '_1000000', value: 1e39 },
109-
{ key: '_100000', value: 1e38 },
110-
{ key: '_10000', value: 1e37 },
111-
{ key: '_1000', value: 1e36 },
112-
{ key: '_100', value: 1e35 },
113-
{ key: '_10', value: 1e34 },
114-
{ key: '_1', value: 1e33 },
115-
{ key: '_01', value: 1e32 },
116-
{ key: '_001', value: 1e31 },
117-
{ key: '_0001', value: 1e30 },
118-
{ key: '_00001', value: 1e29 },
119-
{ key: '_000001', value: 1e28 },
108+
{ key: '_1000000', value: 1000000000000000000000000000000000000n }, // 1M
109+
{ key: '_100000', value: 100000000000000000000000000000000000n }, // 100K
110+
{ key: '_10000', value: 10000000000000000000000000000000000n }, // 10K
111+
{ key: '_1000', value: 1000000000000000000000000000000000n }, // 1K
112+
{ key: '_100', value: 100000000000000000000000000000000n }, // 100
113+
{ key: '_10', value: 10000000000000000000000000000000n }, // 10
114+
{ key: '_1', value: 1000000000000000000000000000000n }, // 1
115+
{ key: '_01', value: 100000000000000000000000000000n }, // 0.1
116+
{ key: '_001', value: 10000000000000000000000000000n }, // 0.01
117+
{ key: '_0001', value: 1000000000000000000000000000n }, // 0.001
118+
{ key: '_00001', value: 100000000000000000000000000n }, // 0.0001
119+
{ key: '_000001', value: 10000000000000000000000000n }, // 0.00001
120120
{ key: '_000001_below', value: 0 }
121121
].map((range) => ({ ...range, value: new BigNumber(range.value) }))
122122

@@ -211,8 +211,8 @@ const rollup_daily_balance_distribution = async ({
211211
.with(
212212
'account_tags',
213213
db.raw(`
214-
SELECT
215-
accounts_tags.account,
214+
SELECT
215+
accounts_tags.account,
216216
array_agg(tag) as tags
217217
FROM accounts_tags
218218
JOIN latest_balances ON accounts_tags.account = latest_balances.account
@@ -264,8 +264,8 @@ const rollup_daily_balance_distribution = async ({
264264
.with(
265265
'daily_account_tags',
266266
db.raw(`
267-
SELECT
268-
accounts_tags.account,
267+
SELECT
268+
accounts_tags.account,
269269
array_agg(tag) as tags
270270
FROM accounts_tags
271271
JOIN latest_daily_balances ON accounts_tags.account = latest_daily_balances.account

0 commit comments

Comments
 (0)