Sandeshxmetric distributed and treasury
Updated 2023-02-16
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
›
⌄
-- amount_usd -> amount itself
with xmetrics_out AS
(
select
block_timestamp,
tx_hash,
raw_amount/pow(10,18) as amount_usd,
from_address,
to_address
from polygon.core.fact_token_transfers
where 1=1
-- and tx_hash=lower('0xcc93b9f5b86d176cae42fd31ec6c5c2771e913a085375f8039f6d3af5c1674d3')
and origin_from_address='0xa0f00e59ef57d82449accb05b9512a47b264374b'
and contract_address='0x15848c9672e99be386807b9101f83a16eb017bb5'
and from_address='0x0000000000000000000000000000000000000000'
),
temp as
(
select block_timestamp::date as "date",
sum(amount_usd) as out
from xmetrics_out
group by 1
)
select "date", out, sum(out) over(order by "date" asc) as cummulative, 2079569-cummulative as balance --from polygonscan
from temp
order by 1 desc
Run a query to Download Data