scottincryptoSushiswap Dex Users UNI Proportion
Updated 2021-12-22Copy 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
29
30
31
32
33
34
35
36
›
⌄
with uni_users as (
select
from_address,
case
when platform in ('uniswap-v2', 'uniswap-v3') then 'uniswap'
when platform in ('sushiswap') then 'sushiswap'
else 'other dex'
end as dex
from
ethereum.dex_swaps
where block_timestamp > '2021-01-01'
-- and platform in ('uniswap-v2', 'uniswap-v3')
group by 1,2
),
date_list as (
SELECT DATEADD(week, (number - 1), '2021-01-01') AS date
FROM (
SELECT ROW_NUMBER() OVER (
ORDER BY n.block_id
)
FROM ethereum.events_emitted n
) S(number)
WHERE number <= (DATEDIFF(week, '2021-01-01', '2021-07-07') + 1)
),
usd_bal_split as(
select
balance_date,
case
when symbol = 'UNI' then 'UNI'
else 'Other Token'
end as token_type,
-- symbol,
-- contract_label,
sum(amount_usd) as usd_balance
Run a query to Download Data