MrftiUSDC market cap on Soalana
Updated 2022-10-06Copy Reference Fork
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
›
⌄
WITH output_tbl AS
(
SELECT date_trunc (day, block_timestamp) as date,
sum(amount) AS output_usdc,
sum(output_usdc) OVER ( ORDER BY date ) AS cum_output_usdc
FROM solana.core.fact_transfers a JOIN solana.core.dim_labels b
on b.address = a.tx_to
AND mint ='EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v' --usdc on solana
group by date
)
, input_tbl AS
(
SELECT date_trunc (day, block_timestamp) as date1,
sum(amount) AS input_usdc,
sum(input_usdc) OVER ( ORDER BY date1 ) AS cum_input_usdc
FROM solana.core.fact_transfers a JOIN solana.core.dim_labels b
on b.address = a.tx_from
and mint='EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v' --usdc on solana
group by date1
)
SELECT date,
cum_input_usdc - cum_output_usdc as USDC_marketcap
FROM input_tbl join output_tbl on date=date1
order by date
Run a query to Download Data