shadilHow old are these swappers?
Updated 2022-07-05
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 q_2 as (select date_trunc('day', flipside_prod_db.algorand.block.block_timestamp) as date_time,
count(distinct address) as total_wallets
from flipside_prod_db.algorand.account join flipside_prod_db.algorand.block
ON flipside_prod_db.algorand.block.block_id = flipside_prod_db.algorand.account.created_at
join (select swapper as wallet_address
from flipside_prod_db.algorand.swaps das
where date_trunc('day', das.block_timestamp) >= '2022-05-01'
and date_trunc('day', das.block_timestamp) < '2022-07-01'
group by wallet_address) as q_1 on address = q_1.wallet_address
GROUP by date_time)
select distribution, total_wallets as distribution_swappers from (
select total_wallets, CASE
WHEN date_time < current_date - 365
THEN 'Older than 1 year'
WHEN date_time < current_date - 270 and date_time >= current_date - 365
THEN 'Older than 9 months'
WHEN date_time < current_date - 180 and date_time >= current_date - 270
THEN 'Older than 6 months'
WHEN date_time < current_date - 90 and date_time >= current_date - 180
THEN 'Older than 3 months'
WHEN date_time < current_date - 30 and date_time >= current_date - 90
THEN 'Older than 1 month'
WHEN date_time >= current_date - 30
THEN 'Younger than 1 month'
END as distribution
from q_2)
group by distribution,distribution_swappers
Run a query to Download Data