SpiltadavidWeekly USDT inflows & outflows
Updated 2022-10-08Copy 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
›
⌄
with outflow as (
select date_trunc('week',BLOCK_TIMESTAMP)::date as date,
sum(amount) as outflow_amount,
sum(outflow_amount) over ( order by date ) as cum_outflow_amount
from solana.core.fact_transfers t,solana.core.dim_labels l
where t.TX_TO = l.address
and mint='Es9vMFrzaCERmJfrF4H2FYD4KCoNkY11McCe8BenwNYB'
group by 1
),
inflow as (
select date_trunc('week',BLOCK_TIMESTAMP)::date as date,
sum(amount) as inflow_amount,
sum(inflow_amount) over ( order by date ) as cum_inflow_amount
from solana.core.fact_transfers t,solana.core.dim_labels l
where t.TX_FROM = l.address
and mint='Es9vMFrzaCERmJfrF4H2FYD4KCoNkY11McCe8BenwNYB'
group by 1
)
select
a.date,
inflow_amount,
outflow_amount,
inflow_amount - outflow_amount as netflow,
cum_inflow_amount - cum_outflow_amount as cum_netflow
from inflow a inner join outflow b on a.date=b.date
where a.date >= '2022-01-01'
order by 1 asc
Run a query to Download Data