WITH New_wallets AS (
SELECT
address
FROM
algorand.account
WHERE
created_at>= 18363444 AND created_at<=18974008 -- 18363444 January first block 18974008 January last block
),
BAL100K AS (
SELECT
address,
balance as balance_ALGO
FROM
algorand.account
WHERE
address IN ( SELECT address from New_wallets )
AND balance_ALGO > 100000
)
SELECT
count(address),
avg (balance_ALGO)
FROM
BAL100K