boomer77days since first tx LP
Updated 2021-12-01
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 remove_lp as (select from_address, pool_name, sum(rune_amount_usd+asset_amount_usd) as liquidity_removed
from thorchain.liquidity_actions
where lp_action = 'remove_liquidity' and block_timestamp between '2021-11-17' and '2021-11-24'
group by 1,2),
first_tx as (select from_address, min(date(block_timestamp)) as dt, (CURRENT_DATE - dt) as days_online
from thorchain.transfers
where from_address in (select from_address from remove_lp)
group by 1),
final as (select a.from_address, sum(a.liquidity_removed) as liquidity_removed, b.days_online, case
when days_online < 30 then '<1_month_old'
when days_online between 30 and 60 then '<2_month_old'
when days_online between 60 and 90 then '<3_month_old'
when days_online between 90 and 120 then '<4_month_old'
when days_online between 120 and 150 then '<5_month_old'
else 'over_5_months' end as address_age
from remove_lp A
left outer join first_tx B on a.from_address = b.from_address
where a.liquidity_removed > 1 and b.days_online is not null
group by 1,3)
select address_age, count(distinct from_address)
from final
group by 1
order by 1 asc
Run a query to Download Data