MasiUntitled Query
Updated 2022-09-18
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 uniswap_date as ( select trunc(block_timestamp,'day') as day ,
LIQUIDITY_PROVIDER as user ,
tx_hash,
AMOUNT0_ADJUSTED as amount
from ethereum.uniswapv3.ez_lp_actions
where TOKEN0_SYMBOL = 'WETH' and ACTION = 'DECREASE_LIQUIDITY'
UNION
select trunc(block_timestamp,'day') as day ,
LIQUIDITY_PROVIDER as user ,
tx_hash,
AMOUNT1_ADJUSTED as amount
from ethereum.uniswapv3.ez_lp_actions
where TOKEN1_SYMBOL = 'WETH' and ACTION = 'DECREASE_LIQUIDITY' )
select 'Uniswap' as platform,
count(DISTINCT user) as total_users,
count(DISTINCT tx_hash) as total_tx,
sum(amount)*-1 as total_amount,
total_amount/total_users as eth_per_user,
avg(amount) as avg_amount,
min(amount) as min_amount,
max(amount) as max_amount,
median(amount) as median_amoutn
from uniswap_date
where day >= CURRENT_DATE - 14
group by 1
UNION
select 'AAVE' as platform,
count(DISTINCT DEPOSITOR_ADDRESS) as total_users,
count(DISTINCT tx_hash) as total_tx,
sum(WITHDRAWN_TOKENS)*-1 as total_amount,
total_amount/total_users as eth_per_user,
avg(WITHDRAWN_TOKENS) as avg_amount,
min(WITHDRAWN_TOKENS) as min_amount,
max(WITHDRAWN_TOKENS) as max_amount,
Run a query to Download Data