mhmUSDC marketcap
Updated 2022-10-09Copy 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
26
27
28
29
30
31
32
›
⌄
with
ins as (
select
trunc(block_timestamp,'day') as date,
sum(amount) as amount_in
from solana.core.fact_transfers x
join solana.core.dim_labels y on x.tx_from = y.address
where mint='EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v' --USDC
group by 1
),
outs as (
select
trunc(block_timestamp,'day') as date,
sum(amount) as amount_out
from solana.core.fact_transfers x
join solana.core.dim_labels y on x.tx_to = y.address
where mint='EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v' --USDC
group by 1
),
final as (
select
x.date,
amount_in,amount_out*(-1) as amount_outs,
amount_in - amount_out as netflow,
sum(amount_in) over (order by x.date) as total_amount_in,
sum(amount_out) over (order by x.date) as total_amount_out,
total_amount_in-total_amount_out as USDC_marketcap
from ins x
join outs y on x.date=y.date
order by 1 asc
)
select * from final where date >= '2022-09-01'
Run a query to Download Data