FatemeTheLadySolana-open2
Updated 2022-11-24
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
›
⌄
with outflow as (select sum(amount) as outflow_amount,
date_trunc(week,BLOCK_TIMESTAMP)::date as outflow_date,
sum(outflow_amount) over ( order by outflow_date ) as cum_outflow_amount
from solana.core.fact_transfers t,solana.core.dim_labels l
where t.TX_TO = l.address and mint='EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v'
group by 2
)
, inflow as (select sum(amount) as inflow_amount,
date_trunc(week,BLOCK_TIMESTAMP)::date as inflow_date,
sum(inflow_amount) over ( order by inflow_date ) as cum_inflow_amount
from solana.core.fact_transfers t,solana.core.dim_labels l
where t.TX_FROM = l.address and mint='EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v'
group by 2
)
select inflow_date as date
,inflow_amount as "Inflow"
,outflow_amount as "Outflow"
,cum_outflow_amount as "Cumulative Outflow"
,cum_inflow_amount as "Cumulative Inflow"
,inflow_amount - outflow_amount as "Market cap changes"
,case when "Market cap changes" >0 then 'increase' when "Market cap changes" <0 then 'decrease' else 'No changes' end as "status"
,cum_inflow_amount - cum_outflow_amount as "cumulative market cap"
from inflow inner join outflow
on inflow_date=outflow_date
order by date asc
Run a query to Download Data