Pine AnalyticsOnchain Gold 2
Updated 2024-08-12
99
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
›
⌄
SELECT *
FROM (
SELECT
date_trunc('week', block_timestamp) as week,
'XAUt' as token,
sum(CASE when FROM_ADDRESS LIKE '0x0000000000000000000000000000000000000000' then amount
when TO_ADDRESS LIKE '0x0000000000000000000000000000000000000000' then -amount
else 0 end) as net_supply,
sum(net_supply) over (order by week) as total_supply
from ethereum.core.ez_token_transfers
WHERE contract_address LIKE lower('0x68749665FF8D2d112Fa859AA293F07A622782F38')
GROUP BY 1,2
UNION all
SELECT
date_trunc('week', block_timestamp) as week,
'PAXG' as token,
sum(CASE when FROM_ADDRESS LIKE '0x0000000000000000000000000000000000000000' then amount
when TO_ADDRESS LIKE '0x0000000000000000000000000000000000000000' then -amount
else 0 end) as net_supply,
sum(net_supply) over (order by week) as total_supply
from ethereum.core.ez_token_transfers
WHERE contract_address LIKE lower('0x45804880De22913dAFE09f4980848ECE6EcbAf78')
GROUP BY 1,2
)
ORDER BY week DESC
LIMIT 2
QueryRunArchived: QueryRun has been archived