total supply over time of a token
You can either use that token's specific tables as long as they are decoded:
1
SELECT
2
week,
3
SUM(transfer) over (order by week)
4
FROM
5
(
6
SELECT
7
date_trunc('week', evt_block_time) as week,
8
sum(amount/1e18) as transfer
9
FROM ptokens."pBTC_evt_Minted" tr
10
GROUP BY 1
11
UNION
12
SELECT
13
date_trunc('week', evt_block_time) as week,
14
sum(-amount/1e18) as transfer
15
FROM ptokens."pBTC_evt_Burned" tr
16
GROUP BY 1
17
) as net;
Copied!
Or you can use a more general purpose query like this one:
(Please note that while this works for most tokens, some tokens do have slight changes in their structure that break this query)
1
Select
2
sum(amount),
3
day
4
5
from erc20."view_token_balances_daily"
6
where token_address = '\x429881672B9AE42b8EbA0E26cD9C73711b891Ca5'
7
and wallet_address != '\x0000000000000000000000000000000000000000' --mint address
8
and wallet_address != '\x000000000000000000000000000000000000dead' --burn address
9
group by 2
10
11
--mint and burn address are not standardized, make sure to query for the right ones
Copied!
Last modified 3mo ago
Copy link