c2ctraderImpact of Terra integration on new wallets created (Percent of Growth)
Updated 2022-04-19
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
33
34
35
36
›
⌄
with integration_datetime as(
select min(block_timestamp) datetime
from thorchain.swaps
where blockchain = 'TERRA'
),
transfers as (
select 'transfer' flag, t.block_timestamp datetime, t.from_address wallet_address
from thorchain.transfers t
where wallet_address is not null
),
swaps as(
select 'swap' flag, s.block_timestamp datetime, s.from_address wallet_address
from thorchain.swaps s
where wallet_address is not null
),
liquidity as(
select 'liquidity' flag, l.block_timestamp datetime, l.from_address wallet_address
from thorchain.liquidity_actions l
where wallet_address is not null
),
all_wallet_address as(
select * from transfers UNION ALL select * from swaps UNION all select * from liquidity
),
unique_wallet_address as(
select min(datetime) datetime,wallet_address from all_wallet_address
group by wallet_address
),
number_of_wallets_before_integration as(
select date_trunc('day',datetime) datetime_before_integration ,count(wallet_address) number_of_wallets_before_integration from unique_wallet_address
where datetime BETWEEN dateadd('day',-10,(select datetime from integration_datetime)) and (select * from integration_datetime)
group by datetime_before_integration
order by datetime_before_integration
),
number_of_wallets_after_integration as(
select date_trunc('day',datetime) datetime_after_integration ,count(wallet_address) number_of_wallets_after_integration from unique_wallet_address
where datetime BETWEEN (select * from integration_datetime) and dateadd('day',10,(select datetime from integration_datetime))
Run a query to Download Data